提交 93c4167d authored 作者: 姚鑫国's avatar 姚鑫国
...@@ -32,24 +32,6 @@ export default class AffairPage extends React.Component { ...@@ -32,24 +32,6 @@ export default class AffairPage extends React.Component {
message.error('您的数据未同步,请联系管理员!'); message.error('您的数据未同步,请联系管理员!');
return false; return false;
} }
// window.addEventListener(
// 'message',
// (event) => {
// // 和Iframe页进行通迅
// if (event.data === 'returnList') {
// this.returnList(true);
// }
// if (event && event.data && event.data.indexOf && event.data.indexOf('iframeHeight') > -1) {
// let height = Number(event.data.split('-')[1]);
// const iframe = document.getElementById('applyIframeId');
// if (iframe) {
// iframe.height = height;
// }
// }
// },
// false,
// );
return true; return true;
} }
...@@ -89,26 +71,8 @@ export default class AffairPage extends React.Component { ...@@ -89,26 +71,8 @@ export default class AffairPage extends React.Component {
{...this.props} {...this.props}
id={workId} id={workId}
returnList={this.returnList} returnList={this.returnList}
init={encodeURIComponent(JSON.stringify(init))} init={init}
/> />
{/* <iframe
src={iframeUrl}
frameBorder={0}
id="applyIframeId"
name="applyIframe"
marginWidth="0"
marginHeight="0"
allowtransparency="yes"
seamless
scrolling={'auto'}
style={{
width: '100%',
minHeight: '800px',
overflowY: 'hidden',
backgroundColor: '#fff',
}}
/>*/}
: null
</div> </div>
</PageHeaderWrapper> </PageHeaderWrapper>
); );
......
...@@ -241,9 +241,9 @@ export default class ImportUtil extends React.PureComponent { ...@@ -241,9 +241,9 @@ export default class ImportUtil extends React.PureComponent {
fetch(transformApi, { fetch(transformApi, {
method: 'POST', method: 'POST',
body: FormdataWrapper(newParams.datas), body: FormdataWrapper(newParams.datas),
headers: { // headers: {
apis: headersApi, // apis: headersApi,
}, // },
}) })
.then((res) => { .then((res) => {
console.log(res.status); console.log(res.status);
......
...@@ -35,10 +35,11 @@ function giveKey(key, datas) { ...@@ -35,10 +35,11 @@ function giveKey(key, datas) {
} }
export async function countAllValues(datas, item) { export async function countAllValues(datas, item) {
// console.log(datas);
if (item.setNull) { if (item.setNull) {
datas.allValues = JSON.stringify({}); datas.allValues = JSON.stringify({});
} else { } else {
if (item.query) { if (item.query && !datas.isMeta) {
if (datas?.sqlKey.length < 13) { if (datas?.sqlKey.length < 13) {
const response = await apiRequest('/SqlManageEntityApi/findParamsKey', { const response = await apiRequest('/SqlManageEntityApi/findParamsKey', {
sqlKey: datas.sqlKey, sqlKey: datas.sqlKey,
......
...@@ -8,7 +8,8 @@ import { countAllValues } from '@/webPublic/one_stop_public/Base16/SplitBase16In ...@@ -8,7 +8,8 @@ import { countAllValues } from '@/webPublic/one_stop_public/Base16/SplitBase16In
import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform'; import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
import { strToBinary } from './strToBinary'; // 字符串转二进制 混淆代码 import { strToBinary } from './strToBinary'; // 字符串转二进制 混淆代码
import { binaryToStr } from './binaryToStr'; // 二进制字符串转JSON字符串 混淆代码 import { binaryToStr } from './binaryToStr';
import { getVisitorToken } from '@/webPublic/zyd_public/utils/getHeaders'; // 二进制字符串转JSON字符串 混淆代码
const test = !!(getUrlInfo().test); const test = !!(getUrlInfo().test);
...@@ -93,8 +94,8 @@ export async function requestFileInfo(url, datas) { ...@@ -93,8 +94,8 @@ export async function requestFileInfo(url, datas) {
// datas = await testPromise(datas); // datas = await testPromise(datas);
// } // }
const formData = new FormData(); const formData = new FormData();
if (getToken()) { if (getVisitorToken()) {
datas.token = getToken(); datas.token = getVisitorToken();
} }
for (let key in datas) { for (let key in datas) {
formData.append(key, datas[key]); formData.append(key, datas[key]);
...@@ -115,7 +116,7 @@ export async function requestFileInfo(url, datas) { ...@@ -115,7 +116,7 @@ export async function requestFileInfo(url, datas) {
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
...getHeaders(transformApi).headers, ...getHeaders(transformApi).headers,
apis: headersApi, // apis: headersApi,
// axxx: `select * from user123 where id = 1`, // axxx: `select * from user123 where id = 1`,
}, },
method: 'POST', method: 'POST',
......
...@@ -49,7 +49,8 @@ export default class IframeForApply extends React.Component { ...@@ -49,7 +49,8 @@ export default class IframeForApply extends React.Component {
} = props; } = props;
this.state = { this.state = {
id, // 传入id id, // 传入id
init: init && isJSON(init) ? JSON.parse(decodeURIComponent(init)) : undefined, init: init || undefined,
// 2022年8月9日 发起页面的默认值可以通过这个init 传进来
value: '', // 紧急度选择 value: '', // 紧急度选择
btnList: [], // 紧急度按钮返回数据 btnList: [], // 紧急度按钮返回数据
noNeedApply, noNeedApply,
......
...@@ -19,6 +19,7 @@ import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson'; ...@@ -19,6 +19,7 @@ import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson';
export default class ZdyTable extends Component { export default class ZdyTable extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
console.log(props);
this.state = { this.state = {
objRealTime: {}, objRealTime: {},
isChange: false, isChange: false,
......
...@@ -796,9 +796,9 @@ export async function downloadFile(url, params, fileName = '导出文件', ext = ...@@ -796,9 +796,9 @@ export async function downloadFile(url, params, fileName = '导出文件', ext =
let headers = { let headers = {
Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`, Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`,
}; };
if(headersApi){ // if(headersApi){
headers.apis = headersApi; // headers.apis = headersApi;
} // }
fetch(transformApi, { fetch(transformApi, {
method: 'POST', method: 'POST',
body: FormdataWrapper(params), body: FormdataWrapper(params),
...@@ -840,9 +840,9 @@ export async function downloadFileAndShowModal(url, params, fileName = '导出 ...@@ -840,9 +840,9 @@ export async function downloadFileAndShowModal(url, params, fileName = '导出
let headers = { let headers = {
Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`, Authorization: `bearer ${localStorage.getItem('antd-pro-token-onestop')}`,
}; };
if(headersApi){ // if(headersApi){
headers.apis = headersApi; // headers.apis = headersApi;
} // }
fetch(transformApi, { fetch(transformApi, {
method: 'POST', method: 'POST',
body: FormdataWrapper(params), body: FormdataWrapper(params),
......
...@@ -248,18 +248,7 @@ class TreeList extends React.Component { ...@@ -248,18 +248,7 @@ class TreeList extends React.Component {
}); });
}, },
}); });
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
// state: {
// id: this.state.objId,
// recordId: record[this.state.primaryKey],
// recordKey: this.state.primaryKey,
// isAdd: false,
// isView:false
// },
// });
// }
}; };
view = (record) => { view = (record) => {
...@@ -271,18 +260,7 @@ class TreeList extends React.Component { ...@@ -271,18 +260,7 @@ class TreeList extends React.Component {
isAdd: false, isAdd: false,
isView: true, isView: true,
}); });
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
// state: {
// id: this.state.objId,
// recordId: record[this.state.primaryKey],
// recordKey: this.state.primaryKey,
// isAdd: false,
// isView:true
// },
// });
// }
}; };
isJSON = (str) => { isJSON = (str) => {
......
...@@ -18,6 +18,9 @@ export default function giveVarcharRules({ ...@@ -18,6 +18,9 @@ export default function giveVarcharRules({
res.push({ res.push({
max: dataColumn.length, max: dataColumn.length,
message: `不能超过${dataColumn.length}个字符`, message: `不能超过${dataColumn.length}个字符`,
transform: function(value){
return value + '';
},
}); });
} }
return res; return res;
......
...@@ -20,6 +20,7 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; ...@@ -20,6 +20,7 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
import { getHeaders, getIsBei_Dian } from '@/webPublic/zyd_public/utils/utils'; import { getHeaders, getIsBei_Dian } from '@/webPublic/zyd_public/utils/utils';
import { proxyChangeUrl } from '@/webPublic/zyd_public/request/proxyChangeUrl'; import { proxyChangeUrl } from '@/webPublic/zyd_public/request/proxyChangeUrl';
import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform'; import { getTransformApi } from '@/webPublic/one_stop_public/2022beidianke/localstorageTransform';
import { getVisitorToken } from '@/webPublic/zyd_public/utils/getHeaders';
const codeMessage = { const codeMessage = {
200: '服务器成功返回请求的数据。', 200: '服务器成功返回请求的数据。',
...@@ -245,7 +246,7 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -245,7 +246,7 @@ export async function requestOrigin(url, data, options = {}){
}); });
} else { } else {
const pp = { const pp = {
token: getToken(), // 部分接口 只需要传入假token 所以这里优先级是 data中的token > getToken; token: getVisitorToken(), // 部分接口 只需要传入假token 所以这里优先级是 data中的token > getToken;
...data, ...data,
version_: version, version_: version,
}; };
...@@ -260,10 +261,7 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -260,10 +261,7 @@ export async function requestOrigin(url, data, options = {}){
// 由于自动添加前缀 这里暂时修改getUrl(url) // 由于自动添加前缀 这里暂时修改getUrl(url)
let fetchRequest = url.indexOf('UserApi/login') > -1 ? loginUmiRequest : umiRequest; let fetchRequest = url.indexOf('UserApi/login') > -1 ? loginUmiRequest : umiRequest;
if (process.env.NODE_ENV !== 'production' && url.indexOf('UserApi/login') > -1) {
url = '/UserApi/login'; // 通过 proxy代理 解决登录接口本地跨域问题
options.prefix = '';
}
if (getToken()) { if (getToken()) {
options.headers = getHeaders(url).headers; options.headers = getHeaders(url).headers;
} }
...@@ -273,11 +271,11 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -273,11 +271,11 @@ export async function requestOrigin(url, data, options = {}){
if(options.headers){ if(options.headers){
options.headers = { options.headers = {
...options.headers, ...options.headers,
apis: headersApi, // apis: headersApi,
}; };
}else{ }else{
options.headers = { options.headers = {
apis: headersApi, // apis: headersApi,
}; };
} }
} }
......
...@@ -5,8 +5,18 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils'; ...@@ -5,8 +5,18 @@ import { getUrlInfo } from '@/webPublic/one_stop_public/DetailForAudit/utils';
const isTest = getUrlInfo().test; const isTest = getUrlInfo().test;
export function getVisitorToken(){
let token = getToken();
const visitor_client = sessionStorage.getItem('visitor_client') === 'true' || !!getUrlInfo().visitor;
if(visitor_client && (token === 'null' || !token)){ // 访客token 欢哥喊加的
token = '704d693b-cc68-49a7-8888-4acc73b5ca73';
}
return token;
}
export function getHeaders(url = '', headersApi = undefined) { export function getHeaders(url = '', headersApi = undefined) {
const token = getToken(); let token = getVisitorToken();
const currentInfo = getCurrentUser() || {}; const currentInfo = getCurrentUser() || {};
const user = getUserInfo() || {}; const user = getUserInfo() || {};
const userId = user.id || currentInfo.xgUserId; const userId = user.id || currentInfo.xgUserId;
...@@ -16,6 +26,9 @@ export function getHeaders(url = '', headersApi = undefined) { ...@@ -16,6 +26,9 @@ export function getHeaders(url = '', headersApi = undefined) {
headers: {}, headers: {},
}; };
if(url && typeof url === 'string' && url.indexOf('oauthPub=true') > -1){ // 公共接口不需要token
return res;
}
if (!token || token === 'null') { if (!token || token === 'null') {
return res; return res;
} else { } else {
...@@ -26,9 +39,9 @@ export function getHeaders(url = '', headersApi = undefined) { ...@@ -26,9 +39,9 @@ export function getHeaders(url = '', headersApi = undefined) {
res.headers.Authorization = `bearer ${token}`; res.headers.Authorization = `bearer ${token}`;
res.headers.auth = gg5xxxxx(secretString); res.headers.auth = gg5xxxxx(secretString);
res.headers.timestamp = timestamp; res.headers.timestamp = timestamp;
if (headersApi) { // if (headersApi) {
res.headers.apis = headersApi; // res.headers.apis = headersApi;
} // }
} }
return res; return res;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论