Commit 1f355521 by XiaHou

修改登录

parent 2471daa3
......@@ -8,14 +8,15 @@ export function getCaptchaImage() {
})
}
export function login(username, password,authCode) {
export function login(username, password,authCode,uuid) {
return request({
url: '/admin/login',
method: 'post',
data: {
username,
password,
authCode
authCode,
uuid
}
})
}
......
......@@ -49,7 +49,7 @@ const user = {
Login({ commit }, userInfo) {
const username = userInfo.username.trim()
return new Promise((resolve, reject) => {
login(username, userInfo.password, userInfo.authCode).then(response => {
login(username, userInfo.password, userInfo.authCode,userInfo.uuid).then(response => {
const data = response.data
const tokenStr = data.tokenHead+data.token
setToken(tokenStr)
......
......@@ -110,6 +110,7 @@ export default {
username: '',
password: '',
authCode: null,
uuid:'',
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
......@@ -143,7 +144,8 @@ export default {
// });
getCaptchaImage().then(res => {
console.log(res)
this.captchaImage = res.data.url
this.captchaImage = res.data.url;
this.loginForm.uuid = res.data.uuid;
})
},
refreshCode() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment