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