|
@@ -5,7 +5,9 @@ import { debounce } from "lodash";
|
|
|
import "./styles";
|
|
|
import magnetManager from "./modules/index";
|
|
|
$(async () => {
|
|
|
- const container = $(".y-container"),
|
|
|
+ var pathName=window.document.location.pathname;
|
|
|
+ var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
|
|
|
+ const container = $(".y-container"),
|
|
|
gbimg = $(">.gbimg", container),
|
|
|
themeSetting = $(".themeSetting", container).on("hidden", () => {
|
|
|
themeSetting.addClass("hide");
|
|
@@ -15,10 +17,10 @@ $(async () => {
|
|
|
bgColors = Array.from(
|
|
|
$(".boxcolor:eq(0) li").map((i, item) => $(item).css("backgroundColor"))
|
|
|
),
|
|
|
- save = debounce(x => post("/homeIndex/saveThemeInfo", x), 1e3);
|
|
|
+ save = debounce(x => post(projectName+"/homeIndex/saveThemeInfo", x), 1e3);
|
|
|
let {
|
|
|
data: { themeInfo, magnets }
|
|
|
- }: any = await post("/homeIndex/getThemeAndLayout");
|
|
|
+ }: any = await post(projectName+"/homeIndex/getThemeAndLayout");
|
|
|
themeInfo = themeInfo || {};
|
|
|
themeInfo.bgColorIndex = themeInfo.bgColorIndex | 0;
|
|
|
themeInfo.bgImgIndex = themeInfo.bgImgIndex | 0;
|