diff --git a/src/api/development.js b/src/api/development.js new file mode 100644 index 0000000..31364f4 --- /dev/null +++ b/src/api/development.js @@ -0,0 +1,70 @@ +import request from '@/config/request'; + +async function http(config) { + return new Promise(resolve => { + request(config) + .then(res => { + resolve(res.data); + }) + .catch(err => { + console.log(err); + resolve(false); + }); + }); +} + +export const apiDevelopment = { + LevelList, + LevelDetail, + CurrentTask +}; + +export default apiDevelopment; + +// personId 这个用于临时测试用 +const personId = 15; + +/** + * 等级列表 + * @returns + */ +function LevelList() { + return http({ + url: '/api/Level/List', + method: 'get', + params: { + personId: personId + } + }); +} + +/** + * 等级详情 + * @param + * \{ levelId ,personId \} + * + * @returns + */ +function LevelDetail(params) { + return http({ + url: '/api/Level/LevelDetail', + method: 'get', + params: { + personId: personId, + ...params + } + }); +} + +/** + * 任务列表 + */ +function CurrentTask() { + return http({ + url: '/api/Task/CurrentTask', + method: 'get', + params: { + personId: personId + } + }); +} diff --git a/src/views/development/index.vue b/src/views/development/index.vue index 1814fe8..9d6f239 100644 --- a/src/views/development/index.vue +++ b/src/views/development/index.vue @@ -9,35 +9,38 @@
-