vue2-client 1.2.115 → 1.2.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/pages/login/Login.vue +12 -8
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -199,16 +199,20 @@ export default {
|
|
|
199
199
|
this.$message.success(timeFix().CN + `,${result.name} 欢迎回来`, 3)
|
|
200
200
|
},
|
|
201
201
|
setAccessToken (data) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
202
|
+
if (data) {
|
|
203
|
+
localStorage.setItem(ACCESS_TOKEN, data)
|
|
204
|
+
let timestamp = new Date().getTime()// 当前的时间戳
|
|
205
|
+
timestamp = timestamp + 12 * 60 * 60 * 1000
|
|
206
|
+
// 格式化时间获取年月日, 登陆过期时间
|
|
207
|
+
const dateAfter = new Date(timestamp)
|
|
208
|
+
setAuthorization({ token: data, expireAt: dateAfter })
|
|
209
|
+
}
|
|
208
210
|
},
|
|
209
211
|
setV4AccessToken (data) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
if (data.token) {
|
|
213
|
+
localStorage.setItem(ACCESS_TOKEN, data.token)
|
|
214
|
+
setAuthorization({ token: data.token, expire: data.expire })
|
|
215
|
+
}
|
|
212
216
|
}
|
|
213
217
|
}
|
|
214
218
|
}
|