forked from github/dataease
perf(X-Pack): 客户端免登录禁用登出和改密
This commit is contained in:
parent
6f7ac6ee7e
commit
44819280ce
@ -26,6 +26,8 @@ interface LinkItem {
|
||||
}
|
||||
const linkList = ref([{ id: 5, label: t('common.about'), method: 'toAbout' }] as LinkItem[])
|
||||
|
||||
const inPlatformClient = computed(() => !!wsCache.get('de-platform-client'))
|
||||
|
||||
const logout = async () => {
|
||||
await logoutApi()
|
||||
logoutHandler()
|
||||
@ -43,6 +45,14 @@ const xpackLinkLoaded = items => {
|
||||
}
|
||||
}
|
||||
items.forEach(item => linkList.value.push(item))
|
||||
if (inPlatformClient.value) {
|
||||
len = linkList.value.length
|
||||
while (len--) {
|
||||
if (linkList.value[len]?.id === 2) {
|
||||
linkList.value.splice(len, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
linkList.value.sort(compare('id'))
|
||||
}
|
||||
|
||||
@ -153,7 +163,7 @@ if (uid.value === '1') {
|
||||
</div>
|
||||
</div>
|
||||
<el-divider />
|
||||
<div class="uinfo-footer">
|
||||
<div class="uinfo-footer" v-if="!inPlatformClient">
|
||||
<div class="uinfo-main-item de-container" @click="logout">
|
||||
<span>{{ t('common.exit_system') }}</span>
|
||||
</div>
|
||||
|
@ -39,7 +39,7 @@ export const logoutHandler = (justClean?: boolean) => {
|
||||
const removeCache = () => {
|
||||
const keys = Object.keys(wsCache['storage'])
|
||||
keys.forEach(key => {
|
||||
if (key.startsWith('de-plugin-')) {
|
||||
if (key.startsWith('de-plugin-') || key === 'de-platform-client') {
|
||||
wsCache.delete(key)
|
||||
}
|
||||
})
|
||||
|
@ -83,6 +83,10 @@ export const isLarkPlatform = () => {
|
||||
return !!getQueryString('state') && !!getQueryString('code')
|
||||
}
|
||||
|
||||
export const isPlatformClient = () => {
|
||||
return !!getQueryString('client') || getQueryString('state')?.includes('client')
|
||||
}
|
||||
|
||||
export function isMobile() {
|
||||
return navigator.userAgent.match(
|
||||
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
||||
|
@ -16,7 +16,7 @@ import { XpackComponent } from '@/components/plugin'
|
||||
import { logoutHandler } from '@/utils/logout'
|
||||
import DeImage from '@/assets/login-desc-de.png'
|
||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import { isLarkPlatform } from '@/utils/utils'
|
||||
import { isLarkPlatform, isPlatformClient } from '@/utils/utils'
|
||||
import xss from 'xss'
|
||||
const { wsCache } = useCache()
|
||||
const appStore = useAppStoreWithOut()
|
||||
@ -137,7 +137,11 @@ const showLoginImage = computed<boolean>(() => {
|
||||
const checkPlatform = () => {
|
||||
const flagArray = ['/casbi', 'oidcbi']
|
||||
const pathname = window.location.pathname
|
||||
if (!flagArray.some(flag => pathname.includes(flag)) && !isLarkPlatform()) {
|
||||
if (
|
||||
!flagArray.some(flag => pathname.includes(flag)) &&
|
||||
!isLarkPlatform() &&
|
||||
!isPlatformClient()
|
||||
) {
|
||||
cleanPlatformFlag()
|
||||
}
|
||||
}
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit 4394504d95c59ae8a44883a771d77ad0cdc187a8
|
||||
Subproject commit 553dad60ba69dd3be3551919d00ab1124d070ce4
|
Loading…
Reference in New Issue
Block a user