重构小程序端管理模块

This commit is contained in:
2024-07-21 19:58:08 +08:00
parent 48ea6d0301
commit 23a25e1285
55 changed files with 3177 additions and 333 deletions
+19
View File
@@ -213,3 +213,22 @@ export async function uploadOssByGroupId(file: File, GroupId: string) {
}
return Promise.reject(new Error(res.data.message));
}
/**
* 上传阿里云OSS
*/
export async function uploadOssByAppId(file: File, appId: string) {
const formData = new FormData();
formData.append('file', file);
const res = await request.post<ApiResult<FileRecord>>(
SERVER_API_URL + '/oss/upload',
formData,
{
headers: { appId }
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}