pref: ErrorHandler
This commit is contained in:
parent
2aedb618d3
commit
bc9b280fc1
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -46,6 +46,7 @@
|
||||||
"mockjs",
|
"mockjs",
|
||||||
"moemoe",
|
"moemoe",
|
||||||
"moemoepoint",
|
"moemoepoint",
|
||||||
|
"moemoepoints",
|
||||||
"Murasame",
|
"Murasame",
|
||||||
"Nanami",
|
"Nanami",
|
||||||
"nawa",
|
"nawa",
|
||||||
|
|
|
@ -86,7 +86,10 @@ onBeforeRouteLeave(() => {
|
||||||
|
|
||||||
<div class="kungalgamer-info">
|
<div class="kungalgamer-info">
|
||||||
<!-- showKUNGalgamePanel 为 store 里的布尔值,其真假控制设置面板的显示与关闭 -->
|
<!-- showKUNGalgamePanel 为 store 里的布尔值,其真假控制设置面板的显示与关闭 -->
|
||||||
<span @click="showKUNGalgamePanel = !showKUNGalgamePanel">
|
<span
|
||||||
|
class="settings"
|
||||||
|
@click="showKUNGalgamePanel = !showKUNGalgamePanel"
|
||||||
|
>
|
||||||
<Icon icon="uiw:setting-o" />
|
<Icon icon="uiw:setting-o" />
|
||||||
</span>
|
</span>
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
|
@ -240,13 +243,16 @@ $navNumber: v-bind(navItemNum);
|
||||||
|
|
||||||
.kungalgamer-info {
|
.kungalgamer-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 50px;
|
margin-right: 50px;
|
||||||
> span {
|
|
||||||
|
.settings {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
color: var(--kungalgame-font-color-2);
|
color: var(--kungalgame-font-color-2);
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
margin-top: 10px;
|
|
||||||
margin-right: 30px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,9 +260,15 @@ $navNumber: v-bind(navItemNum);
|
||||||
.avatar {
|
.avatar {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
font-size: medium;
|
||||||
|
margin-left: 30px;
|
||||||
|
color: var(--kungalgame-font-color-2);
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--kungalgame-blue-5);
|
color: var(--kungalgame-blue-5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@ const errorMessagesEN: Record<number, string> = {
|
||||||
10103: 'Email verification code error',
|
10103: 'Email verification code error',
|
||||||
10104: 'Email is already registered, please change it',
|
10104: 'Email is already registered, please change it',
|
||||||
10105: 'Username is already registered, please change it',
|
10105: 'Username is already registered, please change it',
|
||||||
|
|
||||||
|
10201: 'Your daily topic limit has been reached for today.',
|
||||||
|
10202: `Your moemoepoints are less than 1100, so you can't use the topic suggestion feature`,
|
||||||
}
|
}
|
||||||
|
|
||||||
const errorMessagesCN: Record<number, string> = {
|
const errorMessagesCN: Record<number, string> = {
|
||||||
|
@ -12,6 +15,9 @@ const errorMessagesCN: Record<number, string> = {
|
||||||
10103: '邮箱验证码错误',
|
10103: '邮箱验证码错误',
|
||||||
10104: '邮箱已被注册,请更改',
|
10104: '邮箱已被注册,请更改',
|
||||||
10105: '用户名已被注册,请修改',
|
10105: '用户名已被注册,请修改',
|
||||||
|
|
||||||
|
10201: '您今日可以发表的话题数已达上限',
|
||||||
|
10202: '您的萌萌点不足 1100, 无法使用推话题功能',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getErrorMessageEN = (errorCode: number) => {
|
export const getErrorMessageEN = (errorCode: number) => {
|
||||||
|
|
|
@ -142,9 +142,9 @@ Link: https://www.kungal.com/topic/${props.info.tid}`
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 分享 -->
|
<!-- 分享 -->
|
||||||
<span @click="handleClickShare" class="icon"
|
<span @click="handleClickShare" class="icon">
|
||||||
><Icon icon="majesticons:share-line"
|
<Icon icon="majesticons:share-line" />
|
||||||
/></span>
|
</span>
|
||||||
|
|
||||||
<!-- 只看 TODO: -->
|
<!-- 只看 TODO: -->
|
||||||
<!-- <span class="icon"><Icon icon="ph:user-focus-duotone" /></span> -->
|
<!-- <span class="icon"><Icon icon="ph:user-focus-duotone" /></span> -->
|
||||||
|
|
|
@ -46,6 +46,7 @@ const handleClickReply = () => {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
|
||||||
&::before,
|
&::before,
|
||||||
&::after {
|
&::after {
|
||||||
content: '';
|
content: '';
|
||||||
|
|
|
@ -6,8 +6,8 @@ import { Icon } from '@iconify/vue'
|
||||||
import { useKUNGalgameMessageStore } from '@/store/modules/message'
|
import { useKUNGalgameMessageStore } from '@/store/modules/message'
|
||||||
// 全局消息组件(顶部)
|
// 全局消息组件(顶部)
|
||||||
import Message from '@/components/alert/Message'
|
import Message from '@/components/alert/Message'
|
||||||
// 导入话题页面 store
|
|
||||||
import { useKUNGalgameTopicStore } from '@/store/modules/topic'
|
import { useKUNGalgameTopicStore } from '@/store/modules/topic'
|
||||||
|
import { useKUNGalgameUserStore } from '@/store/modules/kungalgamer'
|
||||||
|
|
||||||
// 接受父组件的传值
|
// 接受父组件的传值
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -94,6 +94,16 @@ const handleClickUpvote = async () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当前用户不可以推自己,后端也有判断
|
||||||
|
if (useKUNGalgameUserStore().moemoepoint < 1100) {
|
||||||
|
Message(
|
||||||
|
`Your moemoepoints are less than 1100, so you can't use the topic suggestion feature`,
|
||||||
|
'您的萌萌点不足 1100, 无法使用推话题功能',
|
||||||
|
'warn'
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 为零是楼主的话题
|
// 为零是楼主的话题
|
||||||
if (props.rid === 0) {
|
if (props.rid === 0) {
|
||||||
upvoteTopic()
|
upvoteTopic()
|
||||||
|
|
Loading…
Reference in a new issue