Skip to content

Commit

Permalink
修改个人简介
Browse files Browse the repository at this point in the history
  • Loading branch information
putianyi889 committed May 25, 2024
1 parent 29064d0 commit a582bb7
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 63 deletions.
47 changes: 29 additions & 18 deletions front_end/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ export type LocaleConfig = LocaleMessage<VueMessageType> & {
common: {
time: string
},
forgetPassword: {
title: string,
email: string,
captcha: string,
getEmailCode: string,
emailCode: string,
password: string,
confirmPassword: string,
confirm: string
},
login: {
title: string,
username: string,
password: string,
captcha: string,
forgetPassword: string,
keepMeLoggedIn: string,
confirm: string
},
menu: {
ranking: string,
video: string,
Expand All @@ -27,14 +46,16 @@ export type LocaleConfig = LocaleMessage<VueMessageType> & {
links: string,
team: string
},
login: {
title: string,
username: string,
password: string,
captcha: string,
forgetPassword: string,
keepMeLoggedIn: string,
confirm: string
profile: {
changeAvatar: string,
realname: string,
realnameInput: string,
signature: string,
signatureInput: string,
change: string,
confirmChange: string,
cancelChange: string,
designator: string
},
register: {
title: string,
Expand All @@ -49,16 +70,6 @@ export type LocaleConfig = LocaleMessage<VueMessageType> & {
termsAndConditions: string,
confirm: string
},
forgetPassword: {
title: string,
email: string,
captcha: string,
getEmailCode: string,
emailCode: string,
password: string,
confirmPassword: string,
confirm: string
}
example: {
// 占位符配置示例 TODO 删除占位符配置示例
placeholder: string
Expand Down
47 changes: 29 additions & 18 deletions front_end/src/i18n/locales/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ export const dev: LocaleConfig = {
common: {
time: 'common.time'
},
forgetPassword: {
title: 'forgetPassword.title',
email: 'forgetPassword.email',
captcha: 'forgetPassword.captcha',
getEmailCode: 'forgetPassword.getEmailCode',
emailCode: 'forgetPassword.emailCode',
password: 'forgetPassword.password',
confirmPassword: 'forgetPassword.confirmPassword',
confirm: 'forgetPassword.confirm'
},
login: {
title: 'login.title',
username: 'login.username',
password: 'login.password',
captcha: 'login.captcha',
forgetPassword: 'login.forgetPassword',
keepMeLoggedIn: 'login.keepMeLoggedIn',
confirm: 'login.confirm'
},
menu: {
ranking: 'menu.ranking',
video: 'menu.video',
Expand All @@ -21,14 +40,16 @@ export const dev: LocaleConfig = {
links: 'menu.links',
team: 'menu.team'
},
login: {
title: 'login.title',
username: 'login.username',
password: 'login.password',
captcha: 'login.captcha',
forgetPassword: 'login.forgetPassword',
keepMeLoggedIn: 'login.keepMeLoggedIn',
confirm: 'login.confirm'
profile: {
changeAvatar: 'profile.changeAvatar',
realname: 'profile.realname',
realnameInput: 'profile.realnameInput',
signature: 'profile.signature',
signatureInput: 'profile.signatureInput',
change: 'profile.change',
confirmChange: 'profile.confirmChange',
cancelChange: 'profile.cancelChange',
designator: 'profile.designator'
},
register: {
title: 'register.title',
Expand All @@ -43,16 +64,6 @@ export const dev: LocaleConfig = {
termsAndConditions: 'register.termsAndConditions',
confirm: 'register.confirm'
},
forgetPassword: {
title: 'forgetPassword.title',
email: 'forgetPassword.email',
captcha: 'forgetPassword.captcha',
getEmailCode: 'forgetPassword.getEmailCode',
emailCode: 'forgetPassword.emailCode',
password: 'forgetPassword.password',
confirmPassword: 'forgetPassword.confirmPassword',
confirm: 'forgetPassword.confirm'
},
example: {
placeholder: 'example.placeholder: {0}',
},
Expand Down
47 changes: 29 additions & 18 deletions front_end/src/i18n/locales/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ export const zhCn: LocaleConfig = {
common: {
time: '用时'
},
forgetPassword: {
title: '找回密码',
email: '请输入邮箱',
captcha: '验证码',
getEmailCode: '获取邮箱验证码',
emailCode: '请输入邮箱验证码',
password: '请输入新的6-20位密码',
confirmPassword: '请输入确认密码',
confirm: '确认修改密码'
},
login: {
title: '欢迎登录',
username: '用户名',
password: '密码',
captcha: '验证码',
forgetPassword: '(找回密码)',
keepMeLoggedIn: '记住我',
confirm: '登录'
},
menu: {
ranking: '排行榜',
video: '录像',
Expand All @@ -21,14 +40,16 @@ export const zhCn: LocaleConfig = {
links: '友链',
team: '团队'
},
login: {
title: '欢迎登录',
username: '用户名',
password: '密码',
captcha: '验证码',
forgetPassword: '(找回密码)',
keepMeLoggedIn: '记住我',
confirm: '登录'
profile: {
changeAvatar: '*点击图片修改头像',
realname: '姓名:',
realnameInput: '请输入真实姓名',
signature: '个人简介',
signatureInput: '请输入个人简介',
change: '修改简介',
confirmChange: '确认',
cancelChange: '取消',
designator: '我的标识:',
},
register: {
title: '用户注册',
Expand All @@ -43,16 +64,6 @@ export const zhCn: LocaleConfig = {
termsAndConditions: '元扫雷网用户协议',
confirm: '注册'
},
forgetPassword: {
title: '找回密码',
email: '请输入邮箱',
captcha: '验证码',
getEmailCode: '获取邮箱验证码',
emailCode: '请输入邮箱验证码',
password: '请输入新的6-20位密码',
confirmPassword: '请输入确认密码',
confirm: '确认修改密码'
},
example: {
placeholder: '占位符: {0}',
},
Expand Down
21 changes: 12 additions & 9 deletions front_end/src/views/PlayerView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
<Plus />
</el-icon>
</el-upload>
<div style="font-size: 14px;color: #AAA;text-align: center;">*点击图片修改头像</div>
<div style="font-size: 14px;color: #AAA;text-align: center;">{{ $t('profile.changeAvatar') }}</div>
<div style="margin-top: 12px;margin-bottom: 4px;">
姓名:
{{ $t('profile.realname') }}
</div>
<div>
<el-input v-model.trim="realname_edit" placeholder="请输入真实姓名" minlength="2"
<el-input v-model.trim="realname_edit" :placeholder="$t('profile.realnameInput')" minlength="2"
maxlength="10"></el-input>
</div>
<div style="margin-top: 12px;margin-bottom: 4px;">
个人简介:
{{ $t('profile.signature') }}
</div>
<div>
<el-input v-model.trim="signature_edit" placeholder="请输入个人简介" minlength="0" maxlength="188"
<el-input v-model.trim="signature_edit" :placeholder="$t('profile.signatureInput')" minlength="0" maxlength="188"
type="textarea" :rows="8"></el-input>
</div>

<button class="edit_button_ok" @click="upload_info">确认</button>
<button class="edit_button_cancel" @click="is_editing = false;">取消</button>
<button class="edit_button_ok" @click="upload_info">{{ $t('profile.confirmChange') }}</button>
<button class="edit_button_cancel" @click="is_editing = false;">{{ $t('profile.cancelChange') }}</button>

</div>

Expand All @@ -48,9 +48,9 @@
{{ realname }}</div>
<div style="overflow: auto ;font-size: 16px;margin-bottom: 12px;">{{ signature }}</div>
<button class="edit_button" v-show="show_edit_button"
@click="is_editing = true; visible = true;">修改简介</button>
@click="is_editing = true; visible = true;">{{ $t('profile.change') }}</button>
<!-- <div style="overflow: auto ;">人气:{{ popularity }}</div> -->
<div style="overflow: auto ;"><strong>我的标识:</strong>{{ designators.join(", ") }}</div>
<div style="overflow: auto ;"><strong>{{ $t('profile.designator') }}</strong>{{ designators.join(", ") }}</div>
</div>

<el-dialog v-model="visible" title="请注意" width="50%" align-center draggable :lock-scroll="false">
Expand Down Expand Up @@ -113,6 +113,9 @@ import { compress, compressAccurately } from 'image-conversion';
import { useUserStore } from '../store'
const store = useUserStore()
import { useI18n } from 'vue-i18n';
const t = useI18n();
const loading = ref(true)
//编辑前的
Expand Down

0 comments on commit a582bb7

Please sign in to comment.