From 829e25b2a33a292f5b2ff6fe8e76b948e40aaa60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9F=E8=B4=A4?= Date: Wed, 29 May 2019 15:03:18 +0800 Subject: [PATCH] fix ts error --- AccountCenter/src/_mock.ts | 4 ++-- AccountSettings/src/_mock.ts | 6 +++--- DashboardAnalysis/src/_mock.ts | 2 +- DashboardMonitor/src/_mock.ts | 2 +- DashboardWorkplace/src/_mock.ts | 10 +++++----- FormAdvancedForm/src/_mock.ts | 2 +- FormBasicForm/src/_mock.ts | 2 +- FormStepForm/src/_mock.ts | 2 +- ListBasicList/src/_mock.ts | 4 ++-- ListCardList/src/_mock.ts | 2 +- ListSearchApplications/src/_mock.ts | 2 +- ListSearchApplications/src/data.d.ts | 2 +- ListSearchArticles/src/_mock.ts | 2 +- ListSearchProjects/src/_mock.ts | 2 +- ListTableList/src/_mock.ts | 6 +++--- ProfileAdvanced/src/_mock.ts | 2 +- ProfileBasic/src/_mock.ts | 2 +- UserLogin/src/_mock.ts | 4 ++-- UserRegister/src/_mock.ts | 2 +- 19 files changed, 30 insertions(+), 30 deletions(-) diff --git a/AccountCenter/src/_mock.ts b/AccountCenter/src/_mock.ts index 6dcf4e0d..40e859d1 100644 --- a/AccountCenter/src/_mock.ts +++ b/AccountCenter/src/_mock.ts @@ -173,9 +173,9 @@ function getFakeList(req: { query: any }, res: { json: (arg0: ListItemDataType[] } export default { - 'GET /api/BLOCK_NAME/fake_list': getFakeList, + 'GET /api/fake_list': getFakeList, // 支持值为 Object 和 Array - 'GET /api/BLOCK_NAME/currentUser': { + 'GET /api/currentUser': { name: 'Serati Ma', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', userid: '00000001', diff --git a/AccountSettings/src/_mock.ts b/AccountSettings/src/_mock.ts index 1eaefd6b..442209d9 100644 --- a/AccountSettings/src/_mock.ts +++ b/AccountSettings/src/_mock.ts @@ -14,7 +14,7 @@ function getCity( // 代码中会兼容本地 service mock 以及部署站点的静态数据 export default { // 支持值为 Object 和 Array - 'GET /api/BLOCK_NAME/currentUser': { + 'GET /api/currentUser': { name: 'Serati Ma', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', userid: '00000001', @@ -64,6 +64,6 @@ export default { address: '西湖区工专路 77 号', phone: '0752-268888888', }, - 'GET /api/BLOCK_NAME/province': getProvince, - 'GET /api/BLOCK_NAME/city/:province': getCity, + 'GET /api/province': getProvince, + 'GET /api/city/:province': getCity, }; diff --git a/DashboardAnalysis/src/_mock.ts b/DashboardAnalysis/src/_mock.ts index 4ad3addd..8d1b78ab 100644 --- a/DashboardAnalysis/src/_mock.ts +++ b/DashboardAnalysis/src/_mock.ts @@ -193,5 +193,5 @@ const getFakeChartData: IAnalysisData = { }; export default { - 'GET /api/BLOCK_NAME/fake_chart_data': getFakeChartData, + 'GET /api/fake_chart_data': getFakeChartData, }; diff --git a/DashboardMonitor/src/_mock.ts b/DashboardMonitor/src/_mock.ts index e6db3d9c..b523dfbd 100644 --- a/DashboardMonitor/src/_mock.ts +++ b/DashboardMonitor/src/_mock.ts @@ -1,7 +1,7 @@ import mockjs from 'mockjs'; export default { - 'GET /api/BLOCK_NAME/tags': mockjs.mock({ + 'GET /api/tags': mockjs.mock({ 'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }], }), }; diff --git a/DashboardWorkplace/src/_mock.ts b/DashboardWorkplace/src/_mock.ts index 16c0597f..61956574 100644 --- a/DashboardWorkplace/src/_mock.ts +++ b/DashboardWorkplace/src/_mock.ts @@ -223,7 +223,7 @@ const radarOriginData = [ }, ]; -const radarData = []; +const radarData: any[] = []; const radarTitleMap = { ref: '引用', koubei: '口碑', @@ -244,13 +244,13 @@ radarOriginData.forEach(item => { }); export default { - 'GET /api/BLOCK_NAME/project/notice': getNotice, - 'GET /api/BLOCK_NAME/activities': getActivities, - 'GET /api/BLOCK_NAME/fake_chart_data': { + 'GET /api/project/notice': getNotice, + 'GET /api/activities': getActivities, + 'GET /api/fake_chart_data': { radarData, }, - 'GET /api/BLOCK_NAME/currentUser': { + 'GET /api/currentUser': { name: 'Serati Ma', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', userid: '00000001', diff --git a/FormAdvancedForm/src/_mock.ts b/FormAdvancedForm/src/_mock.ts index 8e7996de..e94c8af9 100644 --- a/FormAdvancedForm/src/_mock.ts +++ b/FormAdvancedForm/src/_mock.ts @@ -1,5 +1,5 @@ export default { - 'POST /api/BLOCK_NAME/forms': (req, res) => { + 'POST /api/forms': (req: any, res: any) => { res.send({ message: 'Ok' }); }, }; diff --git a/FormBasicForm/src/_mock.ts b/FormBasicForm/src/_mock.ts index 8e7996de..e94c8af9 100644 --- a/FormBasicForm/src/_mock.ts +++ b/FormBasicForm/src/_mock.ts @@ -1,5 +1,5 @@ export default { - 'POST /api/BLOCK_NAME/forms': (req, res) => { + 'POST /api/forms': (req: any, res: any) => { res.send({ message: 'Ok' }); }, }; diff --git a/FormStepForm/src/_mock.ts b/FormStepForm/src/_mock.ts index fd0b6f89..9e686e7b 100644 --- a/FormStepForm/src/_mock.ts +++ b/FormStepForm/src/_mock.ts @@ -1,5 +1,5 @@ export default { - 'POST /api/BLOCK_NAME/forms': (req: any, res: { send: (arg0: { message: string }) => void }) => { + 'POST /api/forms': (req: any, res: { send: (arg0: { message: string }) => void }) => { res.send({ message: 'Ok' }); }, }; diff --git a/ListBasicList/src/_mock.ts b/ListBasicList/src/_mock.ts index d74d31be..f94d793b 100644 --- a/ListBasicList/src/_mock.ts +++ b/ListBasicList/src/_mock.ts @@ -145,6 +145,6 @@ function postFakeList(req: { body: any }, res: { json: (arg0: BasicListItemDataT } export default { - 'GET /api/BLOCK_NAME/fake_list': getFakeList, - 'POST /api/BLOCK_NAME/fake_list': postFakeList, + 'GET /api/fake_list': getFakeList, + 'POST /api/fake_list': postFakeList, }; diff --git a/ListCardList/src/_mock.ts b/ListCardList/src/_mock.ts index a07146e0..23e164fe 100644 --- a/ListCardList/src/_mock.ts +++ b/ListCardList/src/_mock.ts @@ -110,5 +110,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: CardListItemDataTy } export default { - 'GET /api/BLOCK_NAME/fake_list': getFakeList, + 'GET /api/fake_list': getFakeList, }; diff --git a/ListSearchApplications/src/_mock.ts b/ListSearchApplications/src/_mock.ts index 2de3a072..f2a8de9c 100644 --- a/ListSearchApplications/src/_mock.ts +++ b/ListSearchApplications/src/_mock.ts @@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void }) } export default { - 'GET /api/BLOCK_NAME/fake_list': getFakeList, + 'GET /api/fake_list': getFakeList, }; diff --git a/ListSearchApplications/src/data.d.ts b/ListSearchApplications/src/data.d.ts index 4effd165..6a4a88ce 100644 --- a/ListSearchApplications/src/data.d.ts +++ b/ListSearchApplications/src/data.d.ts @@ -4,7 +4,7 @@ export interface Member { id: string; } -export interface ListItemDatatype { +export interface ListItemDataType { id: string; owner: string; title: string; diff --git a/ListSearchArticles/src/_mock.ts b/ListSearchArticles/src/_mock.ts index 2de3a072..f2a8de9c 100644 --- a/ListSearchArticles/src/_mock.ts +++ b/ListSearchArticles/src/_mock.ts @@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void }) } export default { - 'GET /api/BLOCK_NAME/fake_list': getFakeList, + 'GET /api/fake_list': getFakeList, }; diff --git a/ListSearchProjects/src/_mock.ts b/ListSearchProjects/src/_mock.ts index 2de3a072..f2a8de9c 100644 --- a/ListSearchProjects/src/_mock.ts +++ b/ListSearchProjects/src/_mock.ts @@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void }) } export default { - 'GET /api/BLOCK_NAME/fake_list': getFakeList, + 'GET /api/fake_list': getFakeList, }; diff --git a/ListTableList/src/_mock.ts b/ListTableList/src/_mock.ts index 918e7fb4..1800036b 100644 --- a/ListTableList/src/_mock.ts +++ b/ListTableList/src/_mock.ts @@ -85,7 +85,7 @@ function getRule( pagination: { total: dataSource.length, pageSize, - current: parseInt(params.currentPage, 10) || 1, + current: parseInt(`${params.currentPage}`, 10) || 1, }, }; @@ -155,6 +155,6 @@ function postRule( } export default { - 'GET /api/BLOCK_NAME': getRule, - 'POST /api/BLOCK_NAME': postRule, + 'GET /api/': getRule, + 'POST /api/': postRule, }; diff --git a/ProfileAdvanced/src/_mock.ts b/ProfileAdvanced/src/_mock.ts index 6a34f734..a9a05fef 100644 --- a/ProfileAdvanced/src/_mock.ts +++ b/ProfileAdvanced/src/_mock.ts @@ -70,5 +70,5 @@ const getProfileAdvancedData = { }; export default { - 'GET /api/BLOCK_NAME/advanced': getProfileAdvancedData, + 'GET /api/advanced': getProfileAdvancedData, }; diff --git a/ProfileBasic/src/_mock.ts b/ProfileBasic/src/_mock.ts index 8fe12b97..2bc3a353 100644 --- a/ProfileBasic/src/_mock.ts +++ b/ProfileBasic/src/_mock.ts @@ -82,5 +82,5 @@ const getProfileBasicData = { }; export default { - 'GET /api/BLOCK_NAME/basic': getProfileBasicData, + 'GET /api/basic': getProfileBasicData, }; diff --git a/UserLogin/src/_mock.ts b/UserLogin/src/_mock.ts index f416d456..7af2f656 100644 --- a/UserLogin/src/_mock.ts +++ b/UserLogin/src/_mock.ts @@ -3,7 +3,7 @@ function getFakeCaptcha(req: any, res: { json: (arg0: string) => void }) { } export default { - 'POST /api/BLOCK_NAME/account': ( + 'POST /api/account': ( req: { body: { password: any; userName: any; type: any } }, res: { send: (data: any) => void; @@ -32,5 +32,5 @@ export default { currentAuthority: 'guest', }); }, - 'GET /api/BLOCK_NAME/captcha': getFakeCaptcha, + 'GET /api/captcha': getFakeCaptcha, }; diff --git a/UserRegister/src/_mock.ts b/UserRegister/src/_mock.ts index 6fc7eb46..dd86f440 100644 --- a/UserRegister/src/_mock.ts +++ b/UserRegister/src/_mock.ts @@ -1,5 +1,5 @@ export default { - 'POST /api/BLOCK_NAME/register': ( + 'POST /api/register': ( req: any, res: { send: (arg0: { status: string; currentAuthority: string }) => void }, ) => { -- GitLab