diff --git a/src/api/user.js b/src/api/user.js index 4f0b33a..d78d1f2 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -1,3 +1,4 @@ +import store from '@/store' import request from '@/utils/request' export function login(data) { @@ -13,12 +14,14 @@ export function login(data) { }) } -export function getInfo(token) { - // return request({ - // url: '/vue-admin-template/user/info', - // method: 'get', - // params: { token } - // }) +export function getUserInfo() { + return request({ + url: '/sys/profile', + method: 'POST', + headers: { + Authorization: `Bearer ${store.getters.token}` + } + }) } export function logout() { diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 33e5ab6..831f3d8 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -5,6 +5,7 @@