Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
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
王立鹏
corporate-culture-qd
Commits
dd2ad8ed
Commit
dd2ad8ed
authored
Mar 19, 2026
by
王立鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '代码优化/10803' into 'master'
【代码优化 10803】feat: 获取新token优化、发表视频按钮优化等 See merge request
!9
parents
9ecaf19a
c97f8332
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
18 deletions
+36
-18
onlineTime.ts
src/stores/onlineTime.ts
+2
-2
error.ts
src/utils/request/error.ts
+32
-16
index.vue
src/views/publishVideo/index.vue
+2
-0
No files found.
src/stores/onlineTime.ts
View file @
dd2ad8ed
import
{
defineStore
}
from
'pinia'
import
{
use
Local
Storage
}
from
'@vueuse/core'
import
{
useStorage
}
from
'@vueuse/core'
export
const
useOnlineTimeStore
=
defineStore
(
'onlineTime'
,
()
=>
{
const
showOnlineTime
=
use
Local
Storage
(
'show-online-time'
,
true
)
const
showOnlineTime
=
useStorage
(
'show-online-time'
,
true
)
return
{
showOnlineTime
,
}
...
...
src/utils/request/error.ts
View file @
dd2ad8ed
...
...
@@ -13,7 +13,7 @@ import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'
import
service
from
'./index'
import
{
useUserStore
}
from
'@/stores/user'
import
{
push
,
type
PushClearMethods
}
from
'notivue'
import
{
generateLoginKey
}
from
'@/api'
/**
* 后端逻辑code报错处理
* @param backendServiceResult 后端传来错误信息
...
...
@@ -129,25 +129,41 @@ async function handleUnAuthorized(axiosError: AxiosError) {
// 捕捉这一个错误
await
promiseFlashing
return
service
.
request
(
axiosError
.
config
as
AxiosRequestConfig
)
}
catch
(
e
)
{
// 获取refreshToken接口报错
}
catch
(
e
:
any
)
{
console
.
log
(
e
)
create401ErrorMsg
()
userStore
.
clearAllUserInfo
()
return
Promise
.
reject
(
e
)
// 获取refreshToken接口报错
// 直接重新登陆
// 获取登陆的key
const
{
data
}
=
await
generateLoginKey
({
timestamp
:
Date
.
now
(),
type
:
1
,
userId
:
userStore
.
userInfo
?.
userId
||
''
,
})
// 清理sessionStorage
localStorage
.
clear
()
await
userStore
.
getUserInfoByCode
({
code
:
data
,
isCodeLogin
:
1
,
})
window
.
location
.
reload
()
// console.log(e)
// create401ErrorMsg()
// userStore.clearAllUserInfo()
// return Promise.reject(e)
}
finally
{
promiseFlashing
=
null
}
}
let
msgIns
:
PushClearMethods
|
null
=
null
//
let msgIns: PushClearMethods | null = null
function
create401ErrorMsg
()
{
if
(
!
msgIns
)
{
msgIns
=
push
.
error
({
message
:
'重新获取token失败,请关闭标签页,重新打开'
,
duration
:
0
,
})
}
return
msgIns
}
//
function create401ErrorMsg() {
//
if (!msgIns) {
//
msgIns = push.error({
//
message: '重新获取token失败,请关闭标签页,重新打开',
//
duration: 0,
//
})
//
}
//
return msgIns
//
}
src/views/publishVideo/index.vue
View file @
dd2ad8ed
...
...
@@ -260,6 +260,7 @@
@
click=
"handleSubmit(ReleaseStatusTypeEnum.DRAFT)"
size=
"large"
class=
"w-full !border-gray-200 hover:!border-indigo-300 hover:!text-indigo-600 transition-colors duration-200"
:loading=
"loading"
>
<el-icon
class=
"mr-2"
>
<IEpDocument
/>
...
...
@@ -269,6 +270,7 @@
<el-button
type=
"primary"
size=
"large"
:loading=
"loading"
class=
"w-full !bg-gradient-to-r !from-indigo-500 !to-purple-600 !border-none shadow-lg hover:shadow-xl transition-shadow duration-300"
@
click=
"handleSubmit(ReleaseStatusTypeEnum.PUBLISH)"
>
...
...
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