no message
Former-commit-id: f35427ac714ea00ff560778838f100da33a5d039 Former-commit-id: 7da1c550f6aef9472b3e03c34ca3d6361dc58cdd Former-commit-id: 6ae6fe82c618260b4db2c8a1fed26aeaee4c84d4
This commit is contained in:
@@ -77,12 +77,16 @@ export default {
|
||||
})
|
||||
.then(res => {
|
||||
this.$log('登录结果', res)
|
||||
// cookie 一天的有效期
|
||||
const setting = {
|
||||
expires: 1
|
||||
}
|
||||
Cookies.set('username', res.username, setting)
|
||||
Cookies.set('password', res.password, setting)
|
||||
// 不要像下面这样写 请改写为你的保存用户逻辑
|
||||
// 保存用户名密码 不等于真正保存到了本地
|
||||
// Cookies.set('username', res.username, setting)
|
||||
// Cookies.set('password', res.password, setting)
|
||||
Cookies.set('token', res.token, setting)
|
||||
// 跳转路由
|
||||
this.$router.push({
|
||||
name: 'index'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user