提交 48e2a4bb authored 作者: 钟是志's avatar 钟是志

Merge remote-tracking branch 'origin/master'

...@@ -837,7 +837,7 @@ export default class ZdyTable extends Component { ...@@ -837,7 +837,7 @@ export default class ZdyTable extends Component {
<table <table
style={{ style={{
overflow: 'auto', overflow: 'auto',
margin: max * width > 550 ? 'auto' : '', margin: max * width > 550 ? '1px auto' : '', // 禅道 27868
marginBottom: isWebPrint ? (isWebPrintEnd ? '5px' : 0) : '1px', marginBottom: isWebPrint ? (isWebPrintEnd ? '5px' : 0) : '1px',
...style, ...style,
}} }}
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
* @param day cookie的过期时间 * @param day cookie的过期时间
*/ */
export const setCookie = function(name, value, day) { export const setCookie = function(name, value, day) {
if (day !== 0) { if (day !== 0) {
//当设置的时间等于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);
document.cookie = name + '=' + escape(value) + ';expires=' + date.toUTCString(); document.cookie = name + '=' + escape(value) + ';expires=' + date.toUTCString() + ';path=/';
} else { } else {
document.cookie = name + '=' + escape(value); document.cookie = name + '=' + escape(value) + ';path=/';
} }
}; };
/** /**
...@@ -21,11 +21,11 @@ export const setCookie = function(name, value, day) { ...@@ -21,11 +21,11 @@ export const setCookie = function(name, value, day) {
* @returns {null} 不存在时,返回null * @returns {null} 不存在时,返回null
*/ */
export const getCookie = function(name) { 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) return unescape(arr[2]);
else return null; else return null;
}; };
/** /**
...@@ -33,5 +33,5 @@ export const getCookie = function(name) { ...@@ -33,5 +33,5 @@ export const getCookie = function(name) {
* @param name cookie的名称 * @param name cookie的名称
*/ */
export const delCookie = function(name) { export const delCookie = function(name) {
setCookie(name, ' ', -1); setCookie(name, ' ', -1);
}; };
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
* */ * */
import { isJSON } from '@/webPublic/one_stop_public/copy'; import { isJSON } from '@/webPublic/one_stop_public/copy';
import { getOneStopMyInfo } from '@/webPublic/one_stop_public/utils/utils'; import { getOneStopMyInfo } from '@/webPublic/one_stop_public/utils/utils';
import { setCookie } from '@/webPublic/one_stop_public/utils/cookie';
export function setToken(value, time) { export function setToken(value, time) {
if (getToken() !== value) { if (getToken() !== value) {
setCookie('token', value);
localStorage.setItem('antd-pro-token-onestop', value); localStorage.setItem('antd-pro-token-onestop', value);
localStorage.setItem('antd-pro-token', value); localStorage.setItem('antd-pro-token', value);
localStorage.setItem('wisdom-school-token', value); localStorage.setItem('wisdom-school-token', value);
......
...@@ -148,8 +148,8 @@ export default function request( ...@@ -148,8 +148,8 @@ export default function request(
} }
const defaultOptions = { const defaultOptions = {
credentials: 'omit', // credentials: 'omit',
// credentials: 'include', credentials: 'include',
mode: 'cors', mode: 'cors',
}; };
let newOptions = { ...defaultOptions, ...options }; let newOptions = { ...defaultOptions, ...options };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论