|
@@ -1,8 +1,10 @@
|
|
|
import storage from 'store'
|
|
|
+import expirePlugin from 'store/plugins/expire'
|
|
|
import { login, getInfo, logout } from '@/api/login'
|
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|
|
import { welcome } from '@/utils/util'
|
|
|
|
|
|
+storage.addPlugin(expirePlugin)
|
|
|
const user = {
|
|
|
state: {
|
|
|
token: '',
|
|
@@ -38,7 +40,7 @@ const user = {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
login(userInfo).then(response => {
|
|
|
const result = response.result
|
|
|
- storage.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
|
|
|
+ storage.set(ACCESS_TOKEN, result.token, new Date().getTime() + 7 * 24 * 60 * 60 * 1000)
|
|
|
commit('SET_TOKEN', result.token)
|
|
|
resolve()
|
|
|
}).catch(error => {
|