服务器更替

This commit is contained in:
2026-03-27 17:16:58 +08:00
parent 741769cbeb
commit 9b573e376a
14 changed files with 144 additions and 120 deletions
+14 -5
View File
@@ -31,15 +31,24 @@ watch(
)
async function handleCropperAvatarSuccess(avatarUrl: string) {
if (!avatarUrl) {
uni.showToast({ title: t('common.prompt.picture-wrong-please-try-again'), icon: 'none' })
return
}
try {
await uni.showLoading({
uni.showLoading({
title: t('common.prompt.up-cross'),
mask: true,
})
const res = await upload(avatarUrl, '.png', 'app/avatar/')
console.log('111111', res)
form.value.avatar = res as string
}finally {
const res = await upload(avatarUrl)
form.value.avatar = String(res || '')
} catch (error: any) {
console.log('avatar upload error', error)
uni.showToast({
title: error?.message || t('common.prompt.up-failed'),
icon: 'none',
})
} finally {
uni.hideLoading()
}
}