|
@@ -152,23 +152,23 @@ module.exports = {
|
|
|
}
|
|
|
// 开启模型服务后,需要复制模型
|
|
|
if (ENABLE_MODEL_SERVICE) {
|
|
|
+ let res = null;
|
|
|
// 获取项目模型列表
|
|
|
- const res = await request
|
|
|
- .post(
|
|
|
- `${MODEL_BASE_URL}/api/model/copy`,
|
|
|
- JSON.stringify({
|
|
|
- oldProjectId: String(page.projectId),
|
|
|
- newProjectId: String(projectId),
|
|
|
- }),
|
|
|
- {
|
|
|
- headers: {
|
|
|
- authorization: ctx.request.headers?.authorization,
|
|
|
- },
|
|
|
+ res = await request.post(
|
|
|
+ `${MODEL_BASE_URL}/api/model/copy`,
|
|
|
+ JSON.stringify({
|
|
|
+ oldProjectId: String(page.projectId),
|
|
|
+ newProjectId: String(projectId),
|
|
|
+ }),
|
|
|
+ {
|
|
|
+ headers: {
|
|
|
+ authorization: ctx.request.headers?.authorization,
|
|
|
},
|
|
|
- )
|
|
|
- .catch((error) => {
|
|
|
- ctx.throw(400, '模型创建失败:' + error);
|
|
|
- });
|
|
|
+ },
|
|
|
+ );
|
|
|
+ if (res.status !== 200) {
|
|
|
+ return ctx.throw(400, '模型创建失败');
|
|
|
+ }
|
|
|
const result = JSON.parse(res.data);
|
|
|
const dictMap = result.oldNewDataDictionaryIdMap;
|
|
|
page.pageData &&
|