mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:07:58 +08:00
代码优化
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ export default [
|
||||
data: {
|
||||
account: option.body.account,
|
||||
token: '@string',
|
||||
failure_time: Date.parse(new Date()) / 1000 + 24 * 60 * 60
|
||||
failure_time: Math.ceil(new Date().getTime() / 1000) + 24 * 60 * 60
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,7 @@ const getters = {
|
||||
isLogin: state => {
|
||||
let retn = false
|
||||
if (state.token) {
|
||||
let unix = Date.parse(new Date())
|
||||
if (unix < state.failure_time * 1000) {
|
||||
if (new Date().getTime() < state.failure_time * 1000) {
|
||||
retn = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user