fix: 上传接口变更

This commit is contained in:
TsMask
2025-02-26 11:12:06 +08:00
parent 7429a55734
commit 5a61fc355e
13 changed files with 47 additions and 26 deletions

View File

@@ -93,16 +93,16 @@ function fnUpload(up: UploadRequestOption) {
hide();
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('views.system.quickStart.sysUploadOk'), 3);
state.filePath = res.data.fileName;
state.filePath = res.data.filePath;
// 兼容旧前端可改配置文件
const baseUrl = import.meta.env.PROD
? sessionGet('baseUrl') || import.meta.env.VITE_API_BASE_URL
: import.meta.env.VITE_API_BASE_URL;
if (state.type === 'icon') {
state.icon = `${baseUrl}${res.data.fileName}`;
state.icon = `${baseUrl}${res.data.filePath}`;
}
if (state.type === 'brand') {
state.brand = `${baseUrl}${res.data.fileName}`;
state.brand = `${baseUrl}${res.data.filePath}`;
}
} else {
message.error(res.msg, 3);