优化
This commit is contained in:
@@ -102,15 +102,15 @@ jwt:
|
|||||||
# 必须使用最少88位的Base64对该令牌进行编码
|
# 必须使用最少88位的Base64对该令牌进行编码
|
||||||
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
|
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
|
||||||
# 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
# 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
||||||
token-validity-in-seconds: 900000
|
token-validity-in-seconds: 7200000
|
||||||
# 在线用户key
|
# 在线用户key
|
||||||
online-key: online-token-
|
online-key: online-token-
|
||||||
# 验证码
|
# 验证码
|
||||||
code-key: code-key-
|
code-key: code-key-
|
||||||
# token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
# token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
||||||
detect: 900000
|
detect: 1800000
|
||||||
# 续期时间范围,默认 1小时,这里单位毫秒
|
# 续期时间范围,默认 1小时,这里单位毫秒
|
||||||
renew: 900000
|
renew: 3600000
|
||||||
|
|
||||||
# IP 本地解析
|
# IP 本地解析
|
||||||
ip:
|
ip:
|
||||||
|
|||||||
@@ -1,11 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app" @mousemove="moveEvent" @click="moveEvent">
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'App'
|
name: 'App',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timmer: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
moveEvent: function() {
|
||||||
|
const path = ['/login']
|
||||||
|
if (!path.includes(this.$route.path)) {
|
||||||
|
clearTimeout(this.timmer)
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
init: function() {
|
||||||
|
this.timmer = setTimeout(() => {
|
||||||
|
sessionStorage.clear()
|
||||||
|
this.logout()
|
||||||
|
}, 1000 * 60 * 1) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
|
||||||
|
},
|
||||||
|
logout() {
|
||||||
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
|
location.reload()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user