feat:部分 utils、store、hooks 里的 uni.showToast 替换成 wd-toast

This commit is contained in:
YunaiV
2025-12-15 23:06:07 +08:00
parent b9cbcd5b45
commit f9fc5a8abe
5 changed files with 63 additions and 41 deletions

View File

@@ -1,3 +1,4 @@
import { useToast } from 'wot-design-uni'
import { http } from '@/http/http'
import { useTokenStore } from '@/store/token'
import { useUserStore } from '@/store/user'
@@ -66,7 +67,8 @@ export function uploadFile(filePath: string, directory?: string): Promise<string
if (result.code === 0) {
resolve(result.data)
} else {
uni.showToast({ icon: 'none', title: result.msg || '上传失败' })
const toast = useToast()
toast.show(result.msg || '上传失败')
reject(new Error(result.msg || '上传失败'))
}
} else {