use Message instead of Toast
This commit is contained in:
@@ -53,12 +53,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DialogPlugin, Toast } from "tdesign-mobile-vue";
|
||||
import { DialogPlugin } from "tdesign-mobile-vue";
|
||||
import { AttachmentAPI, type Gender, UserAPI, useUserStore } from "timi-web";
|
||||
import PhotoField from "@/components/PhotoField.vue";
|
||||
import { useNavBarStore } from "@/store/navBarStore";
|
||||
import { buildFallbackAvatar } from "@/utils/avatar";
|
||||
import { compressUploadImage } from "@/utils/imageCompression";
|
||||
import { Message } from "@/utils/message";
|
||||
|
||||
type UserAvatarSource = NonNullable<Parameters<typeof UserAPI.getAvatarURL>[0]> & {
|
||||
name?: string;
|
||||
@@ -135,7 +136,7 @@ async function handleAvatarSelected(event: Event): Promise<void> {
|
||||
const compressedFile = await compressUploadImage(file);
|
||||
const [tempFile] = await AttachmentAPI.upload(compressedFile);
|
||||
if (!tempFile?.id) {
|
||||
Toast.error("头像上传失败");
|
||||
Message.error("头像上传失败");
|
||||
return;
|
||||
}
|
||||
avatarTempFileId.value = tempFile.id;
|
||||
@@ -156,7 +157,7 @@ async function toPassword(): Promise<void> {
|
||||
|
||||
async function saveProfile(): Promise<void> {
|
||||
if (!formModel.name) {
|
||||
Toast.warning("请填写用户名");
|
||||
Message.warning("请填写用户名");
|
||||
return;
|
||||
}
|
||||
isSaving.value = true;
|
||||
@@ -169,7 +170,7 @@ async function saveProfile(): Promise<void> {
|
||||
tempFileIdList: avatarTempFileId.value ? [avatarTempFileId.value] : undefined
|
||||
});
|
||||
await userStore.updateLoginUser(result);
|
||||
Toast.success("资料已保存");
|
||||
Message.success("资料已保存");
|
||||
await router.back();
|
||||
} finally {
|
||||
isSaving.value = false;
|
||||
|
||||
Reference in New Issue
Block a user