Commit 829e25b2 authored by 期贤's avatar 期贤

fix ts error

parent c468a497
...@@ -173,9 +173,9 @@ function getFakeList(req: { query: any }, res: { json: (arg0: ListItemDataType[] ...@@ -173,9 +173,9 @@ function getFakeList(req: { query: any }, res: { json: (arg0: ListItemDataType[]
} }
export default { export default {
'GET /api/BLOCK_NAME/fake_list': getFakeList, 'GET /api/fake_list': getFakeList,
// 支持值为 Object 和 Array // 支持值为 Object 和 Array
'GET /api/BLOCK_NAME/currentUser': { 'GET /api/currentUser': {
name: 'Serati Ma', name: 'Serati Ma',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
userid: '00000001', userid: '00000001',
......
...@@ -14,7 +14,7 @@ function getCity( ...@@ -14,7 +14,7 @@ function getCity(
// 代码中会兼容本地 service mock 以及部署站点的静态数据 // 代码中会兼容本地 service mock 以及部署站点的静态数据
export default { export default {
// 支持值为 Object 和 Array // 支持值为 Object 和 Array
'GET /api/BLOCK_NAME/currentUser': { 'GET /api/currentUser': {
name: 'Serati Ma', name: 'Serati Ma',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
userid: '00000001', userid: '00000001',
...@@ -64,6 +64,6 @@ export default { ...@@ -64,6 +64,6 @@ export default {
address: '西湖区工专路 77 号', address: '西湖区工专路 77 号',
phone: '0752-268888888', phone: '0752-268888888',
}, },
'GET /api/BLOCK_NAME/province': getProvince, 'GET /api/province': getProvince,
'GET /api/BLOCK_NAME/city/:province': getCity, 'GET /api/city/:province': getCity,
}; };
...@@ -193,5 +193,5 @@ const getFakeChartData: IAnalysisData = { ...@@ -193,5 +193,5 @@ const getFakeChartData: IAnalysisData = {
}; };
export default { export default {
'GET /api/BLOCK_NAME/fake_chart_data': getFakeChartData, 'GET /api/fake_chart_data': getFakeChartData,
}; };
import mockjs from 'mockjs'; import mockjs from 'mockjs';
export default { 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 }], 'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }],
}), }),
}; };
...@@ -223,7 +223,7 @@ const radarOriginData = [ ...@@ -223,7 +223,7 @@ const radarOriginData = [
}, },
]; ];
const radarData = []; const radarData: any[] = [];
const radarTitleMap = { const radarTitleMap = {
ref: '引用', ref: '引用',
koubei: '口碑', koubei: '口碑',
...@@ -244,13 +244,13 @@ radarOriginData.forEach(item => { ...@@ -244,13 +244,13 @@ radarOriginData.forEach(item => {
}); });
export default { export default {
'GET /api/BLOCK_NAME/project/notice': getNotice, 'GET /api/project/notice': getNotice,
'GET /api/BLOCK_NAME/activities': getActivities, 'GET /api/activities': getActivities,
'GET /api/BLOCK_NAME/fake_chart_data': { 'GET /api/fake_chart_data': {
radarData, radarData,
}, },
'GET /api/BLOCK_NAME/currentUser': { 'GET /api/currentUser': {
name: 'Serati Ma', name: 'Serati Ma',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
userid: '00000001', userid: '00000001',
......
export default { export default {
'POST /api/BLOCK_NAME/forms': (req, res) => { 'POST /api/forms': (req: any, res: any) => {
res.send({ message: 'Ok' }); res.send({ message: 'Ok' });
}, },
}; };
export default { export default {
'POST /api/BLOCK_NAME/forms': (req, res) => { 'POST /api/forms': (req: any, res: any) => {
res.send({ message: 'Ok' }); res.send({ message: 'Ok' });
}, },
}; };
export default { 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' }); res.send({ message: 'Ok' });
}, },
}; };
...@@ -145,6 +145,6 @@ function postFakeList(req: { body: any }, res: { json: (arg0: BasicListItemDataT ...@@ -145,6 +145,6 @@ function postFakeList(req: { body: any }, res: { json: (arg0: BasicListItemDataT
} }
export default { export default {
'GET /api/BLOCK_NAME/fake_list': getFakeList, 'GET /api/fake_list': getFakeList,
'POST /api/BLOCK_NAME/fake_list': postFakeList, 'POST /api/fake_list': postFakeList,
}; };
...@@ -110,5 +110,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: CardListItemDataTy ...@@ -110,5 +110,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: CardListItemDataTy
} }
export default { export default {
'GET /api/BLOCK_NAME/fake_list': getFakeList, 'GET /api/fake_list': getFakeList,
}; };
...@@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void }) ...@@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void })
} }
export default { export default {
'GET /api/BLOCK_NAME/fake_list': getFakeList, 'GET /api/fake_list': getFakeList,
}; };
...@@ -4,7 +4,7 @@ export interface Member { ...@@ -4,7 +4,7 @@ export interface Member {
id: string; id: string;
} }
export interface ListItemDatatype { export interface ListItemDataType {
id: string; id: string;
owner: string; owner: string;
title: string; title: string;
......
...@@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void }) ...@@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void })
} }
export default { export default {
'GET /api/BLOCK_NAME/fake_list': getFakeList, 'GET /api/fake_list': getFakeList,
}; };
...@@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void }) ...@@ -109,5 +109,5 @@ function getFakeList(req: { query: any }, res: { json: (arg0: any[]) => void })
} }
export default { export default {
'GET /api/BLOCK_NAME/fake_list': getFakeList, 'GET /api/fake_list': getFakeList,
}; };
...@@ -85,7 +85,7 @@ function getRule( ...@@ -85,7 +85,7 @@ function getRule(
pagination: { pagination: {
total: dataSource.length, total: dataSource.length,
pageSize, pageSize,
current: parseInt(params.currentPage, 10) || 1, current: parseInt(`${params.currentPage}`, 10) || 1,
}, },
}; };
...@@ -155,6 +155,6 @@ function postRule( ...@@ -155,6 +155,6 @@ function postRule(
} }
export default { export default {
'GET /api/BLOCK_NAME': getRule, 'GET /api/': getRule,
'POST /api/BLOCK_NAME': postRule, 'POST /api/': postRule,
}; };
...@@ -70,5 +70,5 @@ const getProfileAdvancedData = { ...@@ -70,5 +70,5 @@ const getProfileAdvancedData = {
}; };
export default { export default {
'GET /api/BLOCK_NAME/advanced': getProfileAdvancedData, 'GET /api/advanced': getProfileAdvancedData,
}; };
...@@ -82,5 +82,5 @@ const getProfileBasicData = { ...@@ -82,5 +82,5 @@ const getProfileBasicData = {
}; };
export default { export default {
'GET /api/BLOCK_NAME/basic': getProfileBasicData, 'GET /api/basic': getProfileBasicData,
}; };
...@@ -3,7 +3,7 @@ function getFakeCaptcha(req: any, res: { json: (arg0: string) => void }) { ...@@ -3,7 +3,7 @@ function getFakeCaptcha(req: any, res: { json: (arg0: string) => void }) {
} }
export default { export default {
'POST /api/BLOCK_NAME/account': ( 'POST /api/account': (
req: { body: { password: any; userName: any; type: any } }, req: { body: { password: any; userName: any; type: any } },
res: { res: {
send: (data: any) => void; send: (data: any) => void;
...@@ -32,5 +32,5 @@ export default { ...@@ -32,5 +32,5 @@ export default {
currentAuthority: 'guest', currentAuthority: 'guest',
}); });
}, },
'GET /api/BLOCK_NAME/captcha': getFakeCaptcha, 'GET /api/captcha': getFakeCaptcha,
}; };
export default { export default {
'POST /api/BLOCK_NAME/register': ( 'POST /api/register': (
req: any, req: any,
res: { send: (arg0: { status: string; currentAuthority: string }) => void }, res: { send: (arg0: { status: string; currentAuthority: string }) => void },
) => { ) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment