refactor: 解耦code2Session,去掉请求的isLogin标识

This commit is contained in:
ivinwu
2019-01-10 22:46:22 +08:00
parent 02b2c2fdb7
commit 739a8be9f7
10 changed files with 244 additions and 190 deletions

View File

@@ -1,7 +1,7 @@
import { IRequestOption, IUploadFileOption } from "../interface";
declare function start(obj: IRequestOption | IUploadFileOption): void;
declare function end(obj: IRequestOption | IUploadFileOption): void;
declare function report(name: string, start: number, end: number): void;
declare function report(name: string, startTime: number, endTime: number): void;
declare const _default: {
start: typeof start;
end: typeof end;

View File

@@ -1,10 +1,15 @@
import { IRequestOption, IUploadFileOption } from "../interface";
declare function systemError(obj: IRequestOption | IUploadFileOption, res: wx.GeneralCallbackResult): void;
declare function logicError(obj: IRequestOption | IUploadFileOption, res: wx.RequestSuccessCallbackResult | wx.UploadFileSuccessCallbackResult): void;
declare function getErrorMsg(res: wx.RequestSuccessCallbackResult | wx.UploadFileSuccessCallbackResult): {
title: string;
content: string;
};
declare function doError(title: string, content: string): void;
declare const _default: {
systemError: typeof systemError;
logicError: typeof logicError;
doError: typeof doError;
getErrorMsg: typeof getErrorMsg;
};
export default _default;

View File

@@ -1,7 +1,9 @@
import { IRequestOption, IUploadFileOption } from "../interface";
declare function format(originUrl: string): string;
declare function request(obj: IRequestOption): void;
declare function uploadFile(obj: IUploadFileOption): void;
declare const _default: {
format: typeof format;
request: typeof request;
uploadFile: typeof uploadFile;
};

File diff suppressed because one or more lines are too long