Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dpyzo0o committed Dec 16, 2019
1 parent a9cfe24 commit 7ae7648
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/service/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,19 @@ export interface FetchOption {
}

export interface ResponseData {
/**
* 后台定义的状态码
*/
errorCode: number;

/**
* 后台定义的 message
*/
errorMessage: string;

/**
* 实际返回数据
*/
data?: any;
}

Expand Down
7 changes: 7 additions & 0 deletions src/service/mock/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ const mockData: MockData = {
[apiDef.login]: {
errorCode: 200,
errorMessage: 'success',
data: {
name: 'dpyzo0o',
age: 100,
},
},
[apiDef.test]: () => ({
errorCode: 200,
errorMessage: 'success',
data: {
greeting: 'hello taro-toolkit',
},
}),
};

Expand Down

0 comments on commit 7ae7648

Please sign in to comment.