|
|
@ -229,7 +229,17 @@ import { useRouter } from 'vue-router'; |
|
|
|
import { useQuasar, useInterval } from 'quasar'; |
|
|
|
import { useI18n } from 'vue-i18n'; |
|
|
|
|
|
|
|
import { axios, Environment, SessionManager, I18nMessageManager, AuthenticationManager, ComponentManager, NotifyManager, Tools } from '@/platform'; |
|
|
|
import { |
|
|
|
axios, |
|
|
|
Environment, |
|
|
|
SessionManager, |
|
|
|
I18nMessageManager, |
|
|
|
TagViewManager, |
|
|
|
AuthenticationManager, |
|
|
|
ComponentManager, |
|
|
|
NotifyManager, |
|
|
|
Tools, |
|
|
|
} from '@/platform'; |
|
|
|
import LoginDialog from '@/platform/views/LoginDialog'; |
|
|
|
import AboutDialog from './AboutDialog.vue'; |
|
|
|
import ChangePasswordDialog from './ChangePasswordDialog.vue'; |
|
|
@ -297,12 +307,39 @@ const openLoginDialog = () => { |
|
|
|
if (AuthenticationManager.isOauth2()) { |
|
|
|
loginDialog.value.open(); |
|
|
|
} else { |
|
|
|
window.location.href = Environment.apiContextPath('/login'); |
|
|
|
quasar |
|
|
|
.dialog({ |
|
|
|
title: t('security.login.title'), |
|
|
|
message: t('security.login.dialog.title'), |
|
|
|
ok: { |
|
|
|
outline: true, |
|
|
|
ripple: true, |
|
|
|
'no-caps': true, |
|
|
|
label: t('confirm'), |
|
|
|
color: 'primary', |
|
|
|
}, |
|
|
|
cancel: { |
|
|
|
outline: true, |
|
|
|
ripple: true, |
|
|
|
'no-caps': true, |
|
|
|
label: t('cancel'), |
|
|
|
}, |
|
|
|
persistent: true, |
|
|
|
}) |
|
|
|
.onOk(() => { |
|
|
|
window.location.href = Tools.concatUrl(Environment.getWebContextPath(), Environment.getConfigure().setting.loginPage); |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const logout = () => { |
|
|
|
if (gc.theme.login.logoutConfirm) { |
|
|
|
if (AuthenticationManager.isOauth2()) { |
|
|
|
console.debug('logoutSuccessUrl: ' + Environment.getWebContextPath()); |
|
|
|
} else { |
|
|
|
console.debug('logoutUrl: ' + Environment.apiContextPath(Environment.getConfigure().setting.logoutUrl)); |
|
|
|
console.debug('logoutSuccessUrl: ' + Tools.concatUrl(Environment.getWebContextPath(), Environment.getConfigure().setting.logoutSuccessUrl)); |
|
|
|
} |
|
|
|
quasar |
|
|
|
.dialog({ |
|
|
|
title: t('logout'), |
|
|
@ -331,18 +368,21 @@ const logout = () => { |
|
|
|
}; |
|
|
|
|
|
|
|
const doLogout = () => { |
|
|
|
// 清除存储在 SessionStore 中的用于保存用户打开的标签, 可避免用户更换用户登录后仍然显示上一用户打开的标签 |
|
|
|
// 因为客户端 SessionStore 代表的是浏览器的一个 Tab 标签 |
|
|
|
TagViewManager.clearTagViewsAndBreadcrumbs(); |
|
|
|
if (AuthenticationManager.isOauth2()) { |
|
|
|
AuthenticationManager.removeLocalAccessToken(); |
|
|
|
window.location.href = Environment.getWebContextPath(); |
|
|
|
} else { |
|
|
|
axios.post(Environment.apiContextPath(Environment.getConfigure().setting.logoutActionUrl)).then(() => { |
|
|
|
window.location.href = Environment.getWebContextPath(); |
|
|
|
axios.post(Environment.apiContextPath(Environment.getConfigure().setting.logoutUrl)).then(() => { |
|
|
|
window.location.href = Tools.concatUrl(Environment.getWebContextPath(), Environment.getConfigure().setting.logoutSuccessUrl); |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const findUnCompletedTasks = () => { |
|
|
|
axios.get(Environment.apiContextPath('/api/flowable/process/query/myTask')).then((response) => { |
|
|
|
axios.get(Environment.apiContextPath('/api/flowable/process/query/myTask?page=1&size=10&pageable=true')).then((response) => { |
|
|
|
unCompletedTasksRef.value = response.data.content || []; |
|
|
|
unCompletedTasksTotalCountRef.value = response.data.totalElements; |
|
|
|
}); |
|
|
@ -373,7 +413,7 @@ const findUnReadedNotifications = () => { |
|
|
|
}; |
|
|
|
|
|
|
|
const findUnReadedAnnouncements = () => { |
|
|
|
axios.get(Environment.apiContextPath('/api/system/announcement/findUnReadedAnnouncements')).then((response) => { |
|
|
|
axios.get(Environment.apiContextPath('/api/system/announcement/findUnReadedAnnouncements?page=1&size=10&pageable=true')).then((response) => { |
|
|
|
unReadedAnnouncementsRef.value = response.data.content || []; |
|
|
|
unReadedAnnouncementsTotalCountRef.value = response.data.totalElements; |
|
|
|
}); |
|
|
|