mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
fix: Page optimization when the application is unavailable (#3580)
This commit is contained in:
parent
ea56fd6212
commit
b299ef0c53
|
|
@ -57,6 +57,8 @@ class AuthProfileSerializer(serializers.Serializer):
|
|||
self.is_valid(raise_exception=True)
|
||||
access_token = self.data.get("access_token")
|
||||
application_access_token = QuerySet(ApplicationAccessToken).filter(access_token=access_token).first()
|
||||
if application_access_token is None:
|
||||
raise NotFound404(404, _("Invalid access_token"))
|
||||
application_id = application_access_token.application_id
|
||||
profile = {
|
||||
'authentication': False
|
||||
|
|
|
|||
|
|
@ -37,9 +37,7 @@ router.beforeEach(
|
|||
try {
|
||||
authentication = await chatUser.isAuthentication()
|
||||
} catch (e: any) {
|
||||
next({
|
||||
path: '/404',
|
||||
})
|
||||
next()
|
||||
return
|
||||
}
|
||||
const p_token = to.query.token
|
||||
|
|
@ -86,7 +84,12 @@ router.beforeEach(
|
|||
}
|
||||
}
|
||||
} else {
|
||||
await chatUser.anonymousAuthentication()
|
||||
try {
|
||||
await chatUser.anonymousAuthentication()
|
||||
} catch (e: any) {
|
||||
next()
|
||||
return
|
||||
}
|
||||
}
|
||||
if (!chatUser.application) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -25,11 +25,16 @@ const {
|
|||
|
||||
const currentTemplate = computed(() => {
|
||||
let modeName = ''
|
||||
if (!mode || mode === 'pc') {
|
||||
modeName = common.isMobile() ? 'mobile' : 'pc'
|
||||
if (chatUser.application) {
|
||||
if (!mode || mode === 'pc') {
|
||||
modeName = common.isMobile() ? 'mobile' : 'pc'
|
||||
} else {
|
||||
modeName = mode
|
||||
}
|
||||
} else {
|
||||
modeName = mode
|
||||
modeName = 'no-service'
|
||||
}
|
||||
|
||||
const name = `/src/views/chat/${modeName}/index.vue`
|
||||
return components[name].default
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<template>
|
||||
<div class="not-found-container flex-center">
|
||||
<div>
|
||||
<img src="@/assets/500.png" width="250" alt="" />
|
||||
<h4 class="text-center">{{ $t('common.notFound.NoService') }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.not-found-container {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue