From 6b6cbd02a39b74a87aa5a08c83b10b54102c6203 Mon Sep 17 00:00:00 2001 From: "jqtmviyu@gmail.com" Date: Fri, 15 Jan 2021 17:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E8=A3=85=E7=94=A8=E6=88=B7=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.js | 15 +++++++++------ src/views/dashboard/index.vue | 6 ++++++ 2 files changed, 15 insertions(+), 6 deletions(-) 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 @@