File tree Expand file tree Collapse file tree 4 files changed +35
-7
lines changed
Expand file tree Collapse file tree 4 files changed +35
-7
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ def profile(self):
5757 self .is_valid (raise_exception = True )
5858 access_token = self .data .get ("access_token" )
5959 application_access_token = QuerySet (ApplicationAccessToken ).filter (access_token = access_token ).first ()
60+ if application_access_token is None :
61+ raise NotFound404 (404 , _ ("Invalid access_token" ))
6062 application_id = application_access_token .application_id
6163 profile = {
6264 'authentication' : False
Original file line number Diff line number Diff line change @@ -37,9 +37,7 @@ router.beforeEach(
3737 try {
3838 authentication = await chatUser . isAuthentication ( )
3939 } catch ( e : any ) {
40- next ( {
41- path : '/404' ,
42- } )
40+ next ( )
4341 return
4442 }
4543 const p_token = to . query . token
@@ -86,7 +84,12 @@ router.beforeEach(
8684 }
8785 }
8886 } else {
89- await chatUser . anonymousAuthentication ( )
87+ try {
88+ await chatUser . anonymousAuthentication ( )
89+ } catch ( e : any ) {
90+ next ( )
91+ return
92+ }
9093 }
9194 if ( ! chatUser . application ) {
9295 try {
Original file line number Diff line number Diff line change @@ -25,11 +25,16 @@ const {
2525
2626const currentTemplate = computed (() => {
2727 let modeName = ' '
28- if (! mode || mode === ' pc' ) {
29- modeName = common .isMobile () ? ' mobile' : ' pc'
28+ if (chatUser .application ) {
29+ if (! mode || mode === ' pc' ) {
30+ modeName = common .isMobile () ? ' mobile' : ' pc'
31+ } else {
32+ modeName = mode
33+ }
3034 } else {
31- modeName = mode
35+ modeName = ' no-service '
3236 }
37+
3338 const name = ` /src/views/chat/${modeName }/index.vue `
3439 return components [name ].default
3540})
Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" not-found-container flex-center" >
3+ <div >
4+ <img src =" @/assets/500.png" width =" 250" alt =" " />
5+ <h4 class =" text-center" >{{ $t('common.notFound.NoService') }}</h4 >
6+ </div >
7+ </div >
8+ </template >
9+ <script setup lang="ts">
10+ import { useRouter } from ' vue-router'
11+ const router = useRouter ()
12+ </script >
13+ <style lang="scss" scoped>
14+ .not-found-container {
15+ height : 100vh ;
16+ width : 100vw ;
17+ }
18+ </style >
You can’t perform that action at this time.
0 commit comments