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

fix ts error

parent c468a497
......@@ -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',
......
......@@ -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,
};
......@@ -193,5 +193,5 @@ const getFakeChartData: IAnalysisData = {
};
export default {
'GET /api/BLOCK_NAME/fake_chart_data': getFakeChartData,
'GET /api/fake_chart_data': getFakeChartData,
};
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 }],
}),
};
......@@ -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',
......
export default {
'POST /api/BLOCK_NAME/forms': (req, res) => {
'POST /api/forms': (req: any, res: any) => {
res.send({ message: 'Ok' });
},
};
export default {
'POST /api/BLOCK_NAME/forms': (req, res) => {
'POST /api/forms': (req: any, res: any) => {
res.send({ message: 'Ok' });
},
};
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' });
},
};
......@@ -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,
};
......@@ -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,
};
......@@ -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,
};
......@@ -4,7 +4,7 @@ export interface Member {
id: string;
}
export interface ListItemDatatype {
export interface ListItemDataType {
id: string;
owner: string;
title: string;
......
......@@ -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,
};
......@@ -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,
};
......@@ -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,
};
......@@ -70,5 +70,5 @@ const getProfileAdvancedData = {
};
export default {
'GET /api/BLOCK_NAME/advanced': getProfileAdvancedData,
'GET /api/advanced': getProfileAdvancedData,
};
......@@ -82,5 +82,5 @@ const getProfileBasicData = {
};
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 }) {
}
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,
};
export default {
'POST /api/BLOCK_NAME/register': (
'POST /api/register': (
req: any,
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