pref: ErrorHandler

This commit is contained in:
KUN1007 2023-10-22 16:17:46 +08:00
parent 2aedb618d3
commit bc9b280fc1
6 changed files with 38 additions and 8 deletions

View file

@ -46,6 +46,7 @@
"mockjs",
"moemoe",
"moemoepoint",
"moemoepoints",
"Murasame",
"Nanami",
"nawa",

View file

@ -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);
}

View file

@ -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) => {

View file

@ -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> -->

View file

@ -46,6 +46,7 @@ const handleClickReply = () => {
cursor: pointer;
transition: all 0.2s;
margin-right: 10px;
&::before,
&::after {
content: '';

View file

@ -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()