feat: 兼容新版本后端

This commit is contained in:
奔跑的面条
2023-05-01 21:49:08 +08:00
parent f23439d31f
commit 092a252ac4
3 changed files with 30 additions and 20 deletions
+11 -4
View File
@@ -294,10 +294,17 @@ export const useSync = () => {
const uploadRes = await uploadFile(uploadParams)
// 保存预览图
if(uploadRes && uploadRes.code === ResultEnum.SUCCESS) {
await updateProjectApi({
id: fetchRouteParamsLocation(),
indexImage: `${systemStore.getFetchInfo.OSSUrl}${uploadRes.data.fileName}`
})
if (uploadRes.data.httpurl) {
await updateProjectApi({
id: fetchRouteParamsLocation(),
indexImage: `${uploadRes.data.httpurl}`
})
} else {
await updateProjectApi({
id: fetchRouteParamsLocation(),
indexImage: `${systemStore.getFetchInfo.OSSUrl}${uploadRes.data.fileName}`
})
}
}
}
} catch (e) {