杨磊
3 天以前 87d2fac9c381de99f75ce6c6c39b7d638b980d7e
src/assets/js/userAction.js
@@ -1,11 +1,6 @@
import config from "@/assets/js/config.js";
import toolClass from "@/assets/js/toolClass";
import jobApi
// newSession,
// newJobWithNewView
from "./middleGround/api/job"
import jobApi from "./middleGround/api/job"; // newJobWithNewView // newSession,
export function setSessionGuid(type, id) {
  var cityCode = null;
@@ -22,7 +17,7 @@
  } else {
    cityCode = {
      cip: "0.0.0.0",
      cname: "未知"
      cname: "未知",
    };
  }
  const _city = cityCode.cname.substring(3);
@@ -38,9 +33,9 @@
    city: _city ? _city : _province,
  };
  jobApi.newSession(params).then((res) => {
  jobApi.newSession(params).then(res => {
    storage.set("sessionGuid", res, 30);
    setNewView(type, id)
    setNewView(type, id);
  });
}
@@ -81,10 +76,10 @@
    try {
      val = JSON.parse(val);
    } catch (e) {
      return e
      return e;
    }
    return val;
  }
  },
};
function myBrowser() {
@@ -118,7 +113,7 @@
export function setNewView(type, id) {
  if (!sessionStorage.getItem("sessionGuid")) {
    setSessionGuid(type, id)
    setSessionGuid(type, id);
  }
  const sessionGuid = sessionStorage.getItem("sessionGuid");
@@ -130,11 +125,11 @@
      appRefCode: config.appRefCode,
      type: "View",
      url: toPath == null ? "/" : toPath,
      ref: fromPath == null ? "/" : fromPath
      ref: fromPath == null ? "/" : fromPath,
    };
    if (id) {
      params[type] = id;
    }
    jobApi.newJobWithNewView(params).then((res) => {});
    jobApi.newJobWithNewView(params).then(res => {});
  }
}