diff --git a/mock/user.js b/mock/user.js index 43f93a04..9810b161 100644 --- a/mock/user.js +++ b/mock/user.js @@ -26,7 +26,7 @@ const users = { export default [ // user login { - url: '/user/login', + url: '/user/loogin', type: 'post', response: config => { const { username } = config.body @@ -80,5 +80,17 @@ export default [ data: 'success' } } + }, + + // plot prediction graph + { + url: '/testpredict', + type: 'get', + response: _ => { + return { + code: 20000, + token: 'success' + } + } } ] diff --git a/src/api/user.js b/src/api/user.js index 45c13b4d..883e00b8 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -3,6 +3,7 @@ import request from '@/utils/request' export function login(data) { return request({ url: '/user/login', + baseURL: 'http://localhost:8010', method: 'post', data }) @@ -12,6 +13,7 @@ export function getInfo(token) { return request({ url: '/user/info', method: 'get', + authorization: token, params: { token } }) } @@ -27,8 +29,9 @@ export function sendAnalyzeRequest(token) { return request({ url: '/testpredict', method: 'get', - baseURL: 'http://localhost:8888', - params: { token } + // baseURL: 'http://localhost:8010', + // authorization: token, + // params: { token } }) } @@ -36,7 +39,8 @@ export function sendAnalyzeOnDateRequest(token, fromDate, toDate) { return request({ url: '/predictOnDate', method: 'get', - baseURL: 'http://localhost:8888', + baseURL: 'http://localhost:8010', + authorization: token, params: { token, fromDate, toDate } }) } diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 2d49dd87..82f6b78f 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -21,6 +21,7 @@ class="nest-menu" /> + @@ -57,6 +58,12 @@ export default { return {} }, methods: { + // addNewTask() { + // this.item.children.push({ + // name: "Task 2", + // path: "" + // }) + // }, hasOneShowingChild(children = [], parent) { const showingChildren = children.filter(item => { if (item.hidden) { @@ -67,6 +74,7 @@ export default { return true } }) + // console.log(showingChildren) // When there is only one child router, the child router is displayed by default if (showingChildren.length === 1) { diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index fb014a23..5b2c16c5 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -15,6 +15,7 @@ + diff --git a/src/layout/index.vue b/src/layout/index.vue index 316bf698..4f0b244a 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -5,7 +5,7 @@
- +

Data Uploader

@@ -113,7 +114,7 @@