update ver

This commit is contained in:
Megghy
2023-12-22 11:45:29 +08:00
parent caa3c390a2
commit cb23bb7fc6
10 changed files with 5608 additions and 3429 deletions

View File

@@ -21,11 +21,14 @@ const message = useMessage()
const resetEmailModalVisiable = ref(false)
const resetPasswordModalVisiable = ref(false)
const bindBiliCodeModalVisiable = ref(false)
const resetNameModalVisiable = ref(false)
const newEmailAddress = ref('')
const newEmailVerifyCode = ref('')
const canSendEmailVerifyCode = ref(true)
const newName = ref('')
const oldPassword = ref('')
const newPassword = ref('')
const newPassword2 = ref('')
@@ -107,6 +110,26 @@ async function resetPassword() {
message.error('发生错误')
})
}
async function resetName() {
if (accountInfo.value?.name == newName.value) {
message.error('新用户名与旧用户名一致')
return
}
await QueryGetAPI(ACCOUNT_API_URL + 'verify/reset-name', { name: newName.value })
.then(async (data) => {
if (data.code == 200) {
message.success('用户名已修改')
setTimeout(() => {
location.reload()
}, 1000)
} else {
message.error(data.message)
}
})
.catch((err) => {
message.error('发生错误')
})
}
async function BindBili() {
if (!biliCode.value) {
message.error('身份码不能为空')
@@ -276,6 +299,14 @@ async function ChangeBili() {
<NButton @click="resetPassword" type="warning"> 确定修改 </NButton>
</template>
</NModal>
<NModal v-model:show="resetNameModalVisiable" preset="card" title="修改用户名" style="width: 400px; max-width: 90%">
<NSpace vertical>
<NInput v-model:value="newName" type="password" placeholder="新用户名" />
</NSpace>
<template #footer>
<NButton @click="resetName" type="warning"> 确定修改 </NButton>
</template>
</NModal>
<NModal v-model:show="bindBiliCodeModalVisiable" preset="card" title="绑定/更新身份码" style="width: 400px; max-width: 90%">
<NSpace vertical>
<NInputGroup>

View File

@@ -559,6 +559,9 @@ onMounted(async () => {
<NPagination v-model:page="fivesingCurrentPage" :page-count="fivesingTotalPageCount" simple @update-page="getFivesingSearchList(false)" />
</template>
</NTabPane>
<NTabPane name="file" tab="从文件导入">
开发中...
</NTabPane>
</NTabs>
</NSpin>
</NModal>