From 963e854c71dd62ba66109638bba51dcea8e5729f Mon Sep 17 00:00:00 2001 From: zhengjie <201507802@qq.com> Date: Mon, 10 Jun 2019 16:55:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=8A=A0=E5=85=A5=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.js | 13 +++++++++++-- src/store/modules/user.js | 4 +++- src/views/login/index.vue | 39 ++++++++++++++++++++++++++++++++++----- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/api/login.js b/src/api/login.js index 1ba7cad..fd55a3b 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,12 +1,14 @@ import request from '@/utils/request' -export function login(username, password) { +export function login(username, password, code, uuid) { return request({ url: 'auth/login', method: 'post', data: { username, - password + password, + code, + uuid } }) } @@ -17,3 +19,10 @@ export function getInfo() { method: 'get' }) } + +export function getCodeImg() { + return request({ + url: 'auth/vCode', + method: 'get' + }) +} diff --git a/src/store/modules/user.js b/src/store/modules/user.js index eac6178..bfac849 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -30,9 +30,11 @@ const user = { Login({ commit }, userInfo) { const username = userInfo.username const password = userInfo.password + const code = userInfo.code + const uuid = userInfo.uuid const rememberMe = userInfo.rememberMe return new Promise((resolve, reject) => { - login(username, password).then(res => { + login(username, password, code, uuid).then(res => { setToken(res.token, rememberMe) commit('SET_TOKEN', res.token) setUserInfo(res.user, commit) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 50b29e6..650a874 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -12,6 +12,12 @@ + + + + 记住密码 @@ -19,26 +25,30 @@ 登 录 中... -

系统默认用户名:admin,密码:123456