|
@@ -3,7 +3,8 @@ import drag from "./drag";
|
|
|
import grid from "./grid";
|
|
|
import { debounce } from "lodash";
|
|
|
import { post } from "../utils/request";
|
|
|
-
|
|
|
+var pathName=window.document.location.pathname;
|
|
|
+var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
|
|
|
class MagnetManager {
|
|
|
private dragWrapper: JQuery<HTMLElement> | null = null;
|
|
|
private dragContainer: JQuery<HTMLElement> | null = null;
|
|
@@ -145,7 +146,7 @@ class MagnetManager {
|
|
|
}
|
|
|
private createMagnet(magnet: Magnet) {
|
|
|
if (magnet.appType === 1) {
|
|
|
- magnet.url = `/appIndex?menuId=${magnet.menuId}`;
|
|
|
+ magnet.url = projectName+`/appIndex?menuId=${magnet.menuId}`;
|
|
|
}
|
|
|
const iframe = $("<iframe>").appendTo(this.box!);
|
|
|
const div = $("<div>")
|
|
@@ -223,7 +224,7 @@ class MagnetManager {
|
|
|
},
|
|
|
save: async () => {
|
|
|
// 目前还无法根据返回data中的信息判断是否操作成功
|
|
|
- await post("/homeIndex/saveModelLayout", magnet);
|
|
|
+ await post(projectName+"/homeIndex/saveModelLayout", magnet);
|
|
|
// const { status } = ;
|
|
|
// status || alert('保存失败');
|
|
|
}
|