提交 2a39de98 authored 作者: 钟是志's avatar 钟是志

泸职环境 门户修改 增加加密的接口

上级 5e6b4989
......@@ -4,7 +4,7 @@
*/
import { extend } from 'umi-request';
import { notification, message } from 'antd';
import { getToken } from './token';
import { getToken, getVersion } from './token';
import {
queryApiActionPath,
queryOauthActionPath,
......@@ -148,10 +148,7 @@ export async function requestOrigin(url, data, options = {}){
let version =
localStorage.getItem('version') && localStorage.getItem('version') !== 'undefined'
? JSON.parse(localStorage.getItem('version'))
: null;
let version = getVersion();
if (options.method === 'GET') {
......
......@@ -5,9 +5,8 @@ import { isJSON } from '@/webPublic/one_stop_public/copy';
import { getOneStopMyInfo } from '@/webPublic/one_stop_public/utils/utils';
import { delCookie, setCookie } from '@/webPublic/one_stop_public/utils/cookie';
import { getToken } from './getToken';
export { getToken } from './getToken';
export { getToken } from './getToken';
export function setToken(value, time) {
if (getToken() !== value) {
......@@ -27,8 +26,6 @@ export function setToken(value, time) {
}
}
/**
* 删除token
* */
......@@ -90,3 +87,14 @@ export function setCurrentUser(v) {
sessionStorage.setItem('currentUser', JSON.stringify(v));
}
}
export function getVersion() {
if(window.CONFIG.VERSION){
return window.CONFIG.VERSION;
}
const version =
localStorage.getItem('version') && localStorage.getItem('version') !== 'undefined'
? JSON.parse(localStorage.getItem('version'))
: '';
return version;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论