Commit f3e2e4e9 by lijiabin

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

parents 3a384238 cf442883
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { useLocalStorage } from '@vueuse/core' import { useStorage } from '@vueuse/core'
export const useOnlineTimeStore = defineStore('onlineTime', () => { export const useOnlineTimeStore = defineStore('onlineTime', () => {
const showOnlineTime = useLocalStorage('show-online-time', true) const showOnlineTime = useStorage('show-online-time', true)
return { return {
showOnlineTime, showOnlineTime,
} }
......
...@@ -13,7 +13,7 @@ import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios' ...@@ -13,7 +13,7 @@ import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'
import service from './index' import service from './index'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import { push, type PushClearMethods } from 'notivue' import { push, type PushClearMethods } from 'notivue'
import { generateLoginKey } from '@/api'
/** /**
* 后端逻辑code报错处理 * 后端逻辑code报错处理
* @param backendServiceResult 后端传来错误信息 * @param backendServiceResult 后端传来错误信息
...@@ -127,25 +127,41 @@ async function handleUnAuthorized(axiosError: AxiosError) { ...@@ -127,25 +127,41 @@ async function handleUnAuthorized(axiosError: AxiosError) {
// 捕捉这一个错误 // 捕捉这一个错误
await promiseFlashing await promiseFlashing
return service.request(axiosError.config as AxiosRequestConfig) return service.request(axiosError.config as AxiosRequestConfig)
} catch (e) { } catch (e: any) {
// 获取refreshToken接口报错
console.log(e) console.log(e)
create401ErrorMsg() // 获取refreshToken接口报错
userStore.clearAllUserInfo() // 直接重新登陆
return Promise.reject(e) // 获取登陆的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 { } finally {
promiseFlashing = null promiseFlashing = null
} }
} }
let msgIns: PushClearMethods | null = null // let msgIns: PushClearMethods | null = null
function create401ErrorMsg() { // function create401ErrorMsg() {
if (!msgIns) { // if (!msgIns) {
msgIns = push.error({ // msgIns = push.error({
message: '重新获取token失败,请关闭标签页,重新打开', // message: '重新获取token失败,请关闭标签页,重新打开',
duration: 0, // duration: 0,
}) // })
} // }
return msgIns // return msgIns
} // }
...@@ -50,8 +50,14 @@ ...@@ -50,8 +50,14 @@
class="text-gray-600 text-sm sm:text-base leading-relaxed transition-all duration-300" class="text-gray-600 text-sm sm:text-base leading-relaxed transition-all duration-300"
:class="{ 'line-clamp-3': !item.isExpand }" :class="{ 'line-clamp-3': !item.isExpand }"
> >
<template v-if="item.cultureCommentListVo?.replyName"> <template
{{ item.cultureCommentListVo?.replyName }} v-if="
item.cultureCommentListVo?.replyName || item.cultureCommentListVo?.hiddenName
"
>
{{
item.cultureCommentListVo?.replyName || item.cultureCommentListVo?.hiddenName
}}
<span v-html="parseEmoji(item.cultureCommentListVo?.content)"></span> <span v-html="parseEmoji(item.cultureCommentListVo?.content)"></span>
</template> </template>
<template v-else> <template v-else>
......
...@@ -260,6 +260,7 @@ ...@@ -260,6 +260,7 @@
@click="handleSubmit(ReleaseStatusTypeEnum.DRAFT)" @click="handleSubmit(ReleaseStatusTypeEnum.DRAFT)"
size="large" size="large"
class="w-full !border-gray-200 hover:!border-indigo-300 hover:!text-indigo-600 transition-colors duration-200" 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"> <el-icon class="mr-2">
<IEpDocument /> <IEpDocument />
...@@ -269,6 +270,7 @@ ...@@ -269,6 +270,7 @@
<el-button <el-button
type="primary" type="primary"
size="large" 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" 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)" @click="handleSubmit(ReleaseStatusTypeEnum.PUBLISH)"
> >
......
...@@ -120,8 +120,7 @@ const { list, loading, searchParams, total, refresh, goToPage, changePageSize } ...@@ -120,8 +120,7 @@ const { list, loading, searchParams, total, refresh, goToPage, changePageSize }
const handleEdit = (item: any) => { const handleEdit = (item: any) => {
if (item.type === ArticleTypeEnum.VIDEO) { if (item.type === ArticleTypeEnum.VIDEO) {
// router.push(`/publishVideo/${item.id}`) router.push(`/publishVideo?id=${item.id}`)
push.warning('视频编辑功能暂未开放')
} else { } else {
router.push(`/publishLongArticle/${item.type}?id=${item.id}`) 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