Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.10.2 #3696

Merged
merged 2 commits into from
Jan 17, 2024
Merged

v3.10.2 #3696

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions src/utils/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import orgUtil from '@/utils/org'
import orgs from '@/api/orgs'
import { getPropView, isViewHasOrgs } from '@/utils/jms'
import request from '@/utils/request'
import i18n from '@/i18n/i18n'
import { MessageBox } from 'element-ui'

const whiteList = ['/login', process.env.VUE_APP_LOGIN_PATH] // no redirect whitelist

Expand Down Expand Up @@ -41,30 +39,12 @@ async function checkLogin({ to, from, next }) {
return reject('No session mark found in cookie')
} else if (sessionExpire === 'close') {
let startTime = new Date().getTime()
this.newLoginHasOpen = false
const intervalId = setInterval(() => {
const endTime = new Date().getTime()
const delta = (endTime - startTime)
startTime = endTime
Vue.$log.debug('Set session expire: ', delta)
const currentTimeStamp = Math.floor(endTime / 1000)
const sessionExpireTimestamp = VueCookie.get('jms_session_expire_timestamp')
if (currentTimeStamp >= parseInt(sessionExpireTimestamp, 10)) {
if (!this.newLoginHasOpen) {
this.newLoginHasOpen = true
MessageBox.confirm(
i18n.t('auth.LoginRequiredMsg'),
i18n.t('common.Info'),
{
confirmButtonText: i18n.t('auth.ReLogin'),
cancelButtonText: i18n.t('common.Cancel'),
type: 'warning'
}).finally(() => {
window.location = '/core/auth/logout/'
clearInterval(intervalId)
})
}
} else if (!isRenewalExpired(120)) {
if (!isRenewalExpired(120)) {
VueCookie.set('jms_session_expire', 'close', { expires: '2m' })
} else {
clearInterval(intervalId)
Expand Down