更新用户头像和表单字数限制

This commit is contained in:
wangqiao
2025-09-08 10:15:32 +08:00
parent 9054376279
commit 7839fa565e
2 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@
<div class="login-container flex flex-col justify-between">
<div class="ma-auto mt-[25px] w-[100%] flex flex-col items-center">
<el-image
:src="userStore.userInfoRes.avatar || 'https://tuxixi.oss-cn-chengdu.aliyuncs.com/avater.png'"
:src="userStore.userInfoRes.avatar || 'https://static.tuxixi.net/1757297277142/2025/09/08/10/07/57/tuxixi.png'"
alt=""
srcset=""
class="h-[69px] w-[69px] rd-[50%]"
@ -11,7 +11,7 @@
@click="handleUserInfo"
/>
<div class="mt-[10px] text-[16px] text-[#333333] font-normal flex items-center">
Hi{{ userStore.userInfoRes.nickname || '欢迎访问~' }}
Hi{{ userStore.userInfoRes.nickname || '欢迎访问图夕夕' }}
<img v-if="userStore.userInfoRes.vipLevel === 1" src="~/assets/svg/vip.svg" alt="" class="relative top-[1px]" />
<img v-if="userStore.userInfoRes.vipLevel === 2" src="~/assets/svg/svip.svg" alt="" class="relative top-[1px]" />
</div>

View File

@ -17,11 +17,11 @@
label="标题:"
:prop="`${props.vaildRules}.title`"
:rules="[
{ required: true, message: '20-50 字符,结构可用分类关键词+作品名/资源价值版本/使用场景', trigger: ['blur', 'change'] },
{ required: true, message: '10-25 字符,结构可用分类关键词+作品名/资源价值版本/使用场景', trigger: ['blur', 'change'] },
{
validator: (rule: any, value: any, callback: any) => {
if (value && value.length < 20) {
callback(new Error('20-50 字符,结构可用分类关键词+作品名/资源价值版本/使用场景'))
if (value && value.length < 10) {
callback(new Error('10-25 字符,结构可用分类关键词+作品名/资源价值版本/使用场景'))
}
callback()
},
@ -29,7 +29,7 @@
},
]"
>
<el-input v-model="form.title" placeholder="20-50 字符,结构可用分类关键词+作品名/资源价值版本/使用场景" minlength="20" maxlength="50"></el-input>
<el-input v-model="form.title" placeholder="10-25 字符,结构可用分类关键词+作品名/资源价值版本/使用场景" minlength="20" maxlength="50"></el-input>
</el-form-item>
<el-form-item
label-width="110px"
@ -139,12 +139,12 @@
label="作品描述:"
:prop="`${props.vaildRules}.description`"
:rules="[
{ required: true, message: '简介字数限制60-150 字符,需包含用途、文件介绍、适用场景等', trigger: ['blur', 'change'] },
{ required: true, message: '简介字数限制30-75 字符,需包含用途、文件介绍、适用场景等', trigger: ['blur', 'change'] },
{
validator: (rule, value, callback) => {
console.log(rule)
if (value.length < 60) {
callback(new Error('简介字数限制60-150 字符,需包含用途、文件介绍、适用场景等'))
if (value.length < 30) {
callback(new Error('简介字数限制30-75 字符,需包含用途、文件介绍、适用场景等'))
} else {
callback()
}
@ -153,7 +153,7 @@
},
]"
>
<el-input v-model="form.description" type="textarea" :rows="6" placeholder="简介字数限制60-150 字符,需包含用途、文件介绍、适用场景等" minlength="60" maxlength="150" show-word-limit></el-input>
<el-input v-model="form.description" type="textarea" :rows="6" placeholder="简介字数限制30-75 字符,需包含用途、文件介绍、适用场景等" minlength="60" maxlength="150" show-word-limit></el-input>
</el-form-item>
</div>
</template>