From 7164a9afbcafacc77e7295694d9d791c6fbe5d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Sun, 25 Mar 2018 21:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Davue,=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20thx@=E5=B0=8F=E4=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.js | 13 +++++++++++++ src/page/login/codelogin.vue | 32 +++++++++++++++++++++++--------- src/router/router.js | 20 +++++++++++++++++++- src/store/modules/user.js | 23 +++++++++++++---------- src/views/admin/menu/index.vue | 9 +++++++-- 5 files changed, 75 insertions(+), 22 deletions(-) diff --git a/src/api/login.js b/src/api/login.js index 9fc94861..746c7e32 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -15,6 +15,19 @@ export const loginByUsername = (username, password, code, randomStr) => { }) } +export function mobileLogin(mobile, code) { + var grant_type = 'mobile' + var scope = 'server' + return request({ + url: '/auth/mobile/token', + headers: { + 'Authorization': 'Basic cGlnOnBpZw==' + }, + method: 'post', + params: { mobile, code, grant_type, scope } + }) +} + export const getUserInfo = () => { return request({ url: '/admin/user/info', diff --git a/src/page/login/codelogin.vue b/src/page/login/codelogin.vue index 6423a1f7..f81d005a 100644 --- a/src/page/login/codelogin.vue +++ b/src/page/login/codelogin.vue @@ -1,7 +1,7 @@