fix;合并修复问题

This commit is contained in:
ljy
2026-07-09 21:42:36 +08:00
parent 3d3588babb
commit 336116fbf2
18 changed files with 341 additions and 190 deletions
+6 -1
View File
@@ -1,4 +1,5 @@
import { apiBase, request } from './api';
import { showPartnerToast } from './toast';
export type OssMediaType = 'IMAGE' | 'VIDEO' | 'FILE';
@@ -32,9 +33,13 @@ export async function uploadFileToOss(
const json = await res.json();
if (json.code === 401) {
localStorage.removeItem('accessToken');
showPartnerToast('未登录', 'error');
throw new Error('未登录');
}
if (json.code !== 0) throw new Error(json.message || '上传失败');
if (json.code !== 0) {
showPartnerToast(json.message || '上传失败', 'error');
throw new Error(json.message || '上传失败');
}
const data = json.data as UploadFileResult;
return {