Commit f3e2e4e9 by lijiabin

Merge branch 'master' into feature/21096-YAYA文化岛自动获取亚币及碎片功能(包含碎片兑换)

parents 3a384238 cf442883
import { defineStore } from 'pinia'
import { useLocalStorage } from '@vueuse/core'
import { useStorage } from '@vueuse/core'
export const useOnlineTimeStore = defineStore('onlineTime', () => {
const showOnlineTime = useLocalStorage('show-online-time', true)
const showOnlineTime = useStorage('show-online-time', true)
return {
showOnlineTime,
}
......
......@@ -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 后端传来错误信息
......@@ -127,25 +127,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
// }
......@@ -50,8 +50,14 @@
class="text-gray-600 text-sm sm:text-base leading-relaxed transition-all duration-300"
:class="{ 'line-clamp-3': !item.isExpand }"
>
<template v-if="item.cultureCommentListVo?.replyName">
{{ item.cultureCommentListVo?.replyName }}
<template
v-if="
item.cultureCommentListVo?.replyName || item.cultureCommentListVo?.hiddenName
"
>
{{
item.cultureCommentListVo?.replyName || item.cultureCommentListVo?.hiddenName
}}
<span v-html="parseEmoji(item.cultureCommentListVo?.content)"></span>
</template>
<template v-else>
......
......@@ -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)"
>
......
......@@ -120,8 +120,7 @@ const { list, loading, searchParams, total, refresh, goToPage, changePageSize }
const handleEdit = (item: any) => {
if (item.type === ArticleTypeEnum.VIDEO) {
// router.push(`/publishVideo/${item.id}`)
push.warning('视频编辑功能暂未开放')
router.push(`/publishVideo?id=${item.id}`)
} else {
router.push(`/publishLongArticle/${item.type}?id=${item.id}`)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment