提交 6a970a2e authored 作者: 钟是志's avatar 钟是志

Merge remote-tracking branch 'origin/master'

...@@ -9,11 +9,15 @@ export const setCookie = function(name, value, day) { ...@@ -9,11 +9,15 @@ export const setCookie = function(name, value, day) {
//当设置的时间等于0时,不设置expires属性,cookie在浏览器关闭后删除 //当设置的时间等于0时,不设置expires属性,cookie在浏览器关闭后删除
const expires = day * 24 * 60 * 60 * 1000; const expires = day * 24 * 60 * 60 * 1000;
const date = new Date(+new Date() + expires); const date = new Date(+new Date() + expires);
let c = name + '=' + escape(value) + ';expires=' + date.toUTCString() + ';path=/'; let v = value;
if (name !== 'token') {
v = escape(v);
}
let c = name + '=' + v + ';expires=' + date.toUTCString() + ';path=/';
// console.log(c); // console.log(c);
document.cookie = c; document.cookie = c;
} else { } else {
document.cookie = name + '=' + escape(value) + ';path=/'; document.cookie = name + '=' + v + ';path=/';
} }
}; };
...@@ -26,8 +30,13 @@ export const getCookie = function(name) { ...@@ -26,8 +30,13 @@ export const getCookie = function(name) {
let arr; let arr;
const reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); const reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');
arr = document.cookie.match(reg); arr = document.cookie.match(reg);
if (!!arr) return unescape(arr[2]); if (!!arr) {
else return null; if (name === 'token') {
return arr[2];
}else{
return unescape(arr[2]);
}
} else return null;
}; };
/** /**
......
export function getIsA_Ba() { // 判断当前环境是不是阿坝学校 然后做定制需求. 主要用于定制开发
return window.specialImportantSystemConfig?.schoolName && window.specialImportantSystemConfig?.schoolName.indexOf('阿坝') > -1;
}
export function getIsBei_Dian() { // 判断当前环境是不是北电科学校 然后做定制需求. 主要用于定制开发
return window.specialImportantSystemConfig?.schoolName && window.specialImportantSystemConfig?.schoolName.indexOf('北京电子科技') > -1;
}
export function getIsGui_Jian() { // 判断当前环境是不是贵建 然后做定制需求. 主要用于定制开发
return window.specialImportantSystemConfig?.schoolName && window.specialImportantSystemConfig?.schoolName.indexOf('贵州建设职业') > -1;
}
...@@ -4,8 +4,7 @@ import { getInfo, transformApi } from '@/highOrderComponent/Service'; ...@@ -4,8 +4,7 @@ import { getInfo, transformApi } from '@/highOrderComponent/Service';
import urlTransform from '@/webPublic/zyd_public/request/urlTransform'; import urlTransform from '@/webPublic/zyd_public/request/urlTransform';
export function hrefWithToken(url, arg = { export function hrefWithToken(url, arg = {}) {
}) {
const { const {
justOpenUrl = false, justOpenUrl = false,
} = arg; } = arg;
...@@ -19,7 +18,7 @@ export function hrefWithToken(url, arg = { ...@@ -19,7 +18,7 @@ export function hrefWithToken(url, arg = {
const hrefUrl = transformApi(url); const hrefUrl = transformApi(url);
let u = `${hrefUrl}${url}`; let u = `${hrefUrl}${url}`;
u = urlTransform(u); u = urlTransform(u);
if(justOpenUrl){ if (justOpenUrl) {
window.open(u); window.open(u);
} }
console.log('hrefWithToken', u); console.log('hrefWithToken', u);
...@@ -39,6 +38,6 @@ export function hrefWithToken(url, arg = { ...@@ -39,6 +38,6 @@ export function hrefWithToken(url, arg = {
}); });
} }
export function hrefWithTokenSg(url = '', arg = {}){ export function hrefWithTokenSg(url = '', arg = {}) {
return hrefWithToken(url, arg); return hrefWithToken(url, arg);
} }
...@@ -334,17 +334,7 @@ export function checkInputType(data, type) { ...@@ -334,17 +334,7 @@ export function checkInputType(data, type) {
export { getHeaders } from './getHeaders'; export { getHeaders } from './getHeaders';
export function getIsA_Ba() { // 判断当前环境是不是阿坝学校 然后做定制需求. 主要用于定制开发 export { getIsGui_Jian, getIsBei_Dian, getIsA_Ba } from './getSchoolType';
return window.specialImportantSystemConfig?.schoolName && window.specialImportantSystemConfig?.schoolName.indexOf('阿坝') > -1;
}
export function getIsBei_Dian() { // 判断当前环境是不是北电科学校 然后做定制需求. 主要用于定制开发
return window.specialImportantSystemConfig?.schoolName && window.specialImportantSystemConfig?.schoolName.indexOf('北京电子科技') > -1;
}
export function getIsGui_Jian() { // 判断当前环境是不是贵建 然后做定制需求. 主要用于定制开发
return window.specialImportantSystemConfig?.schoolName && window.specialImportantSystemConfig?.schoolName.indexOf('贵州建设职业') > -1;
}
// (function (_0x49c6e2, _0x5afabe) { // (function (_0x49c6e2, _0x5afabe) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论