| | |
| | | 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; |
| | |
| | | } else { |
| | | cityCode = { |
| | | cip: "0.0.0.0", |
| | | cname: "未知" |
| | | cname: "未知", |
| | | }; |
| | | } |
| | | const _city = cityCode.cname.substring(3); |
| | |
| | | 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); |
| | | }); |
| | | } |
| | | |
| | |
| | | try { |
| | | val = JSON.parse(val); |
| | | } catch (e) { |
| | | return e |
| | | return e; |
| | | } |
| | | return val; |
| | | } |
| | | }, |
| | | }; |
| | | |
| | | function myBrowser() { |
| | |
| | | |
| | | export function setNewView(type, id) { |
| | | if (!sessionStorage.getItem("sessionGuid")) { |
| | | setSessionGuid(type, id) |
| | | setSessionGuid(type, id); |
| | | } |
| | | |
| | | const sessionGuid = sessionStorage.getItem("sessionGuid"); |
| | |
| | | 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 => {}); |
| | | } |
| | | } |