mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-05 08:52:03 +00:00
perf: 优化user secret key 处理逻辑
This commit is contained in:
parent
7b990a264f
commit
fd64e71a3b
@ -12,7 +12,6 @@ export function getProfile(token) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/api/v1/users/profile/',
|
url: '/api/v1/users/profile/',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
// params: { token }
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
20
src/main.js
20
src/main.js
@ -22,6 +22,7 @@ import ECharts from 'vue-echarts'
|
|||||||
import service from '@/utils/request'
|
import service from '@/utils/request'
|
||||||
import { message } from '@/utils/message'
|
import { message } from '@/utils/message'
|
||||||
import xss from '@/utils/xss'
|
import xss from '@/utils/xss'
|
||||||
|
import request from '@/utils/request'
|
||||||
import ElTableTooltipPatch from '@/utils/elTableTooltipPatch.js'
|
import ElTableTooltipPatch from '@/utils/elTableTooltipPatch.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,6 +71,7 @@ Vue.prototype.$xss = xss
|
|||||||
|
|
||||||
// 注册全局事件总线
|
// 注册全局事件总线
|
||||||
Vue.prototype.$eventBus = eventBus
|
Vue.prototype.$eventBus = eventBus
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
i18n,
|
i18n,
|
||||||
@ -77,3 +79,21 @@ new Vue({
|
|||||||
store,
|
store,
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
;(function() {
|
||||||
|
request({
|
||||||
|
url: '/api/v1/authentication/user-session/',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
|
||||||
|
let IdBeforeunload = false
|
||||||
|
|
||||||
|
window.addEventListener('beforeunload', (event) => {
|
||||||
|
if (IdBeforeunload) return
|
||||||
|
IdBeforeunload = true
|
||||||
|
request({
|
||||||
|
url: '/api/v1/authentication/user-session/',
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user