Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
5019a8fc
Commit
5019a8fc
authored
Nov 08, 2024
by
nick zheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'beta' into 'master'
chore: 身份过期提示语多语言 See merge request
!57
parents
255a4bd6
fc2fc3ef
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
3 deletions
+16
-3
useEventSource.ts
src/composables/useEventSource.ts
+4
-1
en.yaml
src/locales/langs/en.yaml
+1
-0
zh-cn.yaml
src/locales/langs/zh-cn.yaml
+1
-0
zh-hk.yaml
src/locales/langs/zh-hk.yaml
+1
-0
request.ts
src/utils/request.ts
+4
-1
fetch-event-stream-source.ts
...s/multi-model-dialogue/utils/fetch-event-stream-source.ts
+4
-1
locales.d.ts
types/locales.d.ts
+1
-0
No files found.
src/composables/useEventSource.ts
View file @
5019a8fc
import
i18n
from
'@/locales'
import
{
fetchEventSource
}
from
'@microsoft/fetch-event-source'
import
{
BASE_URLS
}
from
'@/config/base-url'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useSystemLanguageStore
}
from
'@/store/modules/system-language'
import
{
languageKeyTransform
}
from
'@/utils/language-key-transform'
const
{
t
}
=
i18n
.
global
const
ENV
=
import
.
meta
.
env
.
VITE_APP_ENV
const
EVENT_SOURCE_BASE_URL
=
`
${
BASE_URLS
[
ENV
||
'DEV'
]}
`
...
...
@@ -43,7 +46,7 @@ export function fetchCustomEventSource(config: {
const
data
=
JSON
.
parse
(
e
.
data
)
if
(
data
.
code
===
-
10
)
{
window
.
$message
.
info
(
'身份已过期,请重新登陆'
)
window
.
$message
.
info
(
t
(
'common_module.expired_identity'
)
)
config
.
onError
&&
config
.
onError
(
data
)
...
...
src/locales/langs/en.yaml
View file @
5019a8fc
...
...
@@ -81,6 +81,7 @@ common_module:
no_file
:
'
No
file'
view_file
:
'
View
file'
total_file
:
'
1
file
in
total
|
{count}
files
in
total'
expired_identity
:
'
Your
identity
has
expired.
Please
login
again'
dialogue_module
:
...
...
src/locales/langs/zh-cn.yaml
View file @
5019a8fc
...
...
@@ -80,6 +80,7 @@ common_module:
no_file
:
'
暂无文件'
view_file
:
'
查看文件'
total_file
:
'
共{count}个文件'
expired_identity
:
'
身份已过期,请重新登录'
dialogue_module
:
...
...
src/locales/langs/zh-hk.yaml
View file @
5019a8fc
...
...
@@ -80,6 +80,7 @@ common_module:
no_file
:
'
暫無文件'
view_file
:
'
查看文件'
total_file
:
'
共{count}個文件'
expired_identity
:
'
身份已過期,請重新登錄'
dialogue_module
:
continue_question_message
:
'
你可以繼續提問'
...
...
src/utils/request.ts
View file @
5019a8fc
import
axios
,
{
type
AxiosRequestConfig
,
type
AxiosResponse
}
from
'axios'
import
i18n
from
'@/locales'
import
{
BASE_URLS
}
from
'@/config/base-url'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useRouter
}
from
'vue-router'
...
...
@@ -7,6 +8,8 @@ import { debounce } from 'lodash-es'
import
{
useSystemLanguageStore
}
from
'@/store/modules/system-language'
import
{
languageKeyTransform
}
from
'./language-key-transform'
const
{
t
}
=
i18n
.
global
interface
PagingInfoParams
{
pageNo
:
number
pageSize
:
number
...
...
@@ -39,7 +42,7 @@ const handleLogout = debounce(
router
.
replace
({
name
:
'Login'
,
query
:
{
redirect
:
encodeURIComponent
(
currentRoute
.
fullPath
)
}
})
useUserStore
().
logout
()
window
.
$message
.
warning
(
'身份已过期,请重新登录'
)
window
.
$message
.
warning
(
t
(
'common_module.expired_identity'
)
)
},
2000
,
{
leading
:
true
,
trailing
:
false
},
...
...
src/views/multi-model-dialogue/utils/fetch-event-stream-source.ts
View file @
5019a8fc
import
i18n
from
'@/locales'
import
{
fetchEventSource
}
from
'@microsoft/fetch-event-source'
import
{
BASE_URLS
}
from
'@/config/base-url'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useSystemLanguageStore
}
from
'@/store/modules/system-language'
import
{
languageKeyTransform
}
from
'@/utils/language-key-transform'
const
{
t
}
=
i18n
.
global
const
ENV
=
import
.
meta
.
env
.
VITE_APP_ENV
const
EVENT_SOURCE_BASE_URL
=
`
${
BASE_URLS
[
ENV
||
'DEV'
]}
`
...
...
@@ -43,7 +46,7 @@ export function fetchEventStreamSource(config: {
const
data
=
JSON
.
parse
(
e
.
data
)
if
(
data
.
code
===
-
10
)
{
window
.
$message
.
info
(
'身份已过期,请重新登陆'
)
window
.
$message
.
info
(
t
(
'common_module.expired_identity'
)
)
config
.
onError
&&
config
.
onError
(
data
)
...
...
types/locales.d.ts
View file @
5019a8fc
...
...
@@ -81,6 +81,7 @@ declare namespace I18n {
no_file
:
string
view_file
:
string
total_file
:
string
expired_identity
:
string
dialogue_module
:
{
continue_question_message
:
string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment