提交 d02c9365 authored 作者: xuli's avatar xuli

添加请求

上级 1bb62ce7
......@@ -20,6 +20,11 @@ export const querySysCode = () => queryConfig("SYSCODE");
export const queryWsPath = () => queryConfig("WS_PATH");
/**
* @description 获取场景设计器定制后台地址
* */
export const queryDynamicActionPath = () => queryConfig("DYNAMIC_ACTION_PATH");
/**
* @description 获取服务端请求路径前戳
* */
......
......@@ -5,7 +5,7 @@
import { extend } from 'umi-request';
import { notification } from 'antd';
import { getToken } from './token';
import { queryApiActionPath, queryOauthActionPath, queryPermActionPath } from './queryConfig';
import { queryApiActionPath, queryOauthActionPath, queryPermActionPath, queryDynamicActionPath } from './queryConfig';
import { openToast } from '../location/Notification';
import { showToast } from '../location/Toast';
import { offline } from '../location/Toast';
......@@ -33,7 +33,7 @@ const codeMessage = {
*
* return URL参数字符串
*/
const objectToQuery = function(param, key, encode) {
const objectToQuery = function (param, key, encode) {
if (param == null) return '';
var paramStr = '';
var t = typeof param;
......@@ -134,8 +134,8 @@ export const request = (url, data, options = {}) => {
window.location.href = x.mobileAdress
? mobileAdress + '?timeVersion=' + time
: ul.indexOf('?') > -1
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
} else {
sessionStorage.removeItem('cacheMobile');
openToast('error', '版本更新', '检查到最新版本,即将自动更新,更新完成后请重新操作');
......@@ -143,8 +143,8 @@ export const request = (url, data, options = {}) => {
window.location.href = x.webAdress
? x.webAdress + '?timeVersion=' + time
: ul.indexOf('?') > -1
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
}
setTimeout(() => location.reload(), 3000);
}
......@@ -209,8 +209,8 @@ export const request = (url, data, options = {}) => {
window.location.href = x.mobileAdress
? mobileAdress + '?timeVersion=' + time
: ul.indexOf('?') > -1
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
} else {
sessionStorage.removeItem('cacheMobile');
openToast('error', '版本更新', '检查到最新版本,即将自动更新,更新完成后请重新操作');
......@@ -218,8 +218,8 @@ export const request = (url, data, options = {}) => {
window.location.href = x.webAdress
? x.webAdress + '?timeVersion=' + time
: ul.indexOf('?') > -1
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
? ul + '&timeVersion=' + time
: ul + '?timeVersion=' + time;
}
setTimeout(() => location.reload(), 3000);
}
......@@ -271,6 +271,8 @@ const createServerRequest = (config = {}) => {
return setRequestConfig(config);
};
export const dynamicRequest = createServerRequest({ method: 'POST', prefix: queryDynamicActionPath() });
export const uaaRequest = createServerRequest({ method: 'POST', prefix: queryOauthActionPath() });
export const permRequest = createServerRequest({ method: 'POST', prefix: queryPermActionPath() });
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论