提交 94c3beb3 authored 作者: 钟是志's avatar 钟是志

云上贵州 招生门户修改

上级 21a786cd
/**
* request 网络请求工具 使用公共资源包中的 request方法
*/
import requestJson from '@/webPublic/zyd_public/requestJson/requestJson.js';
function request(url, body, method = 'POST') {
return requestJson(url, {
body,
method,
})
.then((x) => {
if (!x && x !== 0 && x !== false) {
console.error('接口报错', url, '\n', body);
return false;
}
return x;
});
}
const prefix = `${window.wisdomSchoolConfig.systemList.uia.service}`;
export { prefix };
export function getUiaInfo(data, url) {
return request(prefix + url, data);
}
...@@ -98,3 +98,10 @@ export function getVersion() { ...@@ -98,3 +98,10 @@ export function getVersion() {
: ''; : '';
return version; return version;
} }
export function getSassSysCode(){
return localStorage.getItem('sassSysCode');
}
export function setSassSysCode(v){
localStorage.setItem('sassSysCode', v);
}
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
import { Modal, Popconfirm, message } from 'antd'; import { Modal, Popconfirm, message } from 'antd';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request'; import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import { getTime } from '@/webPublic/zyd_public/utils/queryCurrent'; import { getTime } from '@/webPublic/zyd_public/utils/queryCurrent';
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { getUiaInfo } from '@/webPublic/one_stop_public/2023yunshangguizhou/request2.0';
const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
...@@ -58,14 +60,26 @@ export const getMessage = () => { ...@@ -58,14 +60,26 @@ export const getMessage = () => {
}; };
export const getOneStopMyInfo = (params = {}) => { export const getOneStopMyInfo = (params = {}) => {
return uaaRequest('/UserApi/getMy', params).then((res) => { let urlInfo = getUrlInfo();
if (res) { if(urlInfo.tenantCode){ // 如果是sass 系统 存在租户 则调用2.0的接口获取
if (!res.groupsId) { getUiaInfo({}, '/userApi/getMyInfo').then((res) => {
res.groupsId = 'pub'; if(res){
} localStorage.setItem('user', JSON.stringify(res));
res.differenceBetweenServerAndClientTime = -50; }
localStorage.setItem('user', JSON.stringify(res)); })
return res; }else{
} return uaaRequest('/UserApi/getMy', params).then((res) => {
}); if (res) {
if (!res.groupsId) {
res.groupsId = 'pub';
}
res.differenceBetweenServerAndClientTime = -50;
localStorage.setItem('user', JSON.stringify(res));
return res;
}
});
}
}; };
require('es6-promise').polyfill(); // require('es6-promise').polyfill();
require('isomorphic-fetch'); // require('isomorphic-fetch');
import { getToken, setToken } from '@/webPublic/one_stop_public/utils/token'; import { getToken, setToken } from '@/webPublic/one_stop_public/utils/token';
import { controlNotification, isJSON } from '@/webPublic/zyd_public/utils/utils'; import { controlNotification, isJSON } from '@/webPublic/zyd_public/utils/utils';
......
...@@ -82,11 +82,13 @@ export function getFileInfo(fileJsonStr) { ...@@ -82,11 +82,13 @@ export function getFileInfo(fileJsonStr) {
// console.log('一站式图片地址拼接'); // console.log('一站式图片地址拼接');
prefix = window.specialImportantSystemConfig && window.specialImportantSystemConfig.sqlFormsServer; prefix = window.specialImportantSystemConfig && window.specialImportantSystemConfig.sqlFormsServer;
} }
return { let r = {
downloadUrl: '', downloadUrl: '',
url: prefix + fileJsonStr, url: prefix + fileJsonStr,
fileName: '', fileName: '',
}; }
r.url = r.url ? r.url.replace('/dsf/dsf/', '/dsf/') : '';
return r;
} else { } else {
if (fileJsonStr && typeof fileJsonStr === 'string' && fileJsonStr.indexOf('http') > -1 && fileJsonStr.length > 10) { if (fileJsonStr && typeof fileJsonStr === 'string' && fileJsonStr.indexOf('http') > -1 && fileJsonStr.length > 10) {
return { return {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论