Fix: change uname

This commit is contained in:
Lazy 2024-01-03 13:57:17 +08:00
parent 65651c767e
commit 9052d628d6
1 changed files with 13 additions and 13 deletions

View File

@ -29,10 +29,10 @@ const rules = reactive<FormRules<FormData>>({
});
const { execute, isLoading } = changeUNameApi();
const changeUName = async () => {
try {
await formDataRef.value?.validate(async (valid, fields) => {
if (valid) {
const changeUName = () => {
formDataRef.value?.validate(async (valid, fields) => {
if (valid) {
try {
await execute({
headers: {
Authorization: token.value
@ -46,16 +46,16 @@ const changeUName = async () => {
open.value = false;
formDataRef.value?.resetFields();
await getUserInfo();
} catch (err: any) {
console.error(err.message);
ElNotification({
title: "错误",
message: err.response.data.error || err.message,
type: "error"
});
}
});
} catch (err: any) {
console.error(err.message);
ElNotification({
title: "错误",
message: err.response.data.error || err.message,
type: "error"
});
}
}
});
};
</script>