提交 509bd9e0 authored 作者: 钟是志's avatar 钟是志

加解密函数修改

上级 64256470
...@@ -107,7 +107,7 @@ const encryptApiList = [ ...@@ -107,7 +107,7 @@ const encryptApiList = [
datas.allValues = JSON.stringify({}); datas.allValues = JSON.stringify({});
} else { } else {
if (item.query) { if (item.query) {
if (datas.sqlKey.length < 13) { if (datas?.sqlKey.length < 13) {
const response = await apiRequest("/SqlManageEntityApi/findParamsKey", { sqlKey: datas.sqlKey }); const response = await apiRequest("/SqlManageEntityApi/findParamsKey", { sqlKey: datas.sqlKey });
if (!response || (Array.isArray(response) && response.length === 0)) { if (!response || (Array.isArray(response) && response.length === 0)) {
datas.allValues = JSON.stringify({}); datas.allValues = JSON.stringify({});
...@@ -135,11 +135,14 @@ export async function giveBase16EnCode(datas, url) { // 全局加解密函数. ...@@ -135,11 +135,14 @@ export async function giveBase16EnCode(datas, url) { // 全局加解密函数.
if(!checkOpenBase16){ if(!checkOpenBase16){
return datas; return datas;
} }
// if(datas?.allValues){
// console.log(JSON.stringify(datas));
// }
if (url && typeof url === "string") { if (url && typeof url === "string") {
for (let item of encryptApiList) { for (let item of encryptApiList) {
if (url.indexOf(item.api) > -1) { if (url.indexOf(item.api) > -1) {
for (let g of item.key) { for (let g of item.key) {
if(g === 'allValues'){ if(g === 'allValues' && typeof datas[g] !== 'undefined'){
datas = await countAllValues(datas, item); datas = await countAllValues(datas, item);
datas = giveKey('allValues', datas); datas = giveKey('allValues', datas);
}else{ }else{
......
...@@ -131,7 +131,7 @@ export default class ZdyTable extends Component { ...@@ -131,7 +131,7 @@ export default class ZdyTable extends Component {
val.unifiedServicePatternModel.isDefaultError != null && val.unifiedServicePatternModel.isDefaultError != null &&
val.unifiedServicePatternModel.isDefaultError val.unifiedServicePatternModel.isDefaultError
) { ) {
if (this.props.get == 'web') { if (this.props.get === 'web') {
message.error('当前办理人数较多,服务繁忙,请稍后再试!'); message.error('当前办理人数较多,服务繁忙,请稍后再试!');
} else { } else {
Toast.fail('当前办理人数较多,服务繁忙,请稍后再试!'); Toast.fail('当前办理人数较多,服务繁忙,请稍后再试!');
......
...@@ -914,7 +914,7 @@ export default class tableCom extends Component { ...@@ -914,7 +914,7 @@ export default class tableCom extends Component {
} }
if (callback) { if (callback) {
if (json.optionType && json.optionType == 'func') { if (json.optionType && json.optionType === 'func') {
const res = callback(data); const res = callback(data);
if (res != null && !(typeof res === 'function')) { if (res != null && !(typeof res === 'function')) {
......
...@@ -118,7 +118,7 @@ const getUrl = url => (url.startsWith('/') ? url : '/' + url); ...@@ -118,7 +118,7 @@ const getUrl = url => (url.startsWith('/') ? url : '/' + url);
export const request = (url, data, options = {}) => { export const request = (url, data, options = {}) => {
return giveBase16EnCode(data, url).then((newData) => { return giveBase16EnCode(data, url).then((newData) => {
console.log(newData); // console.log(newData);
return requestOrigin(url, newData, options); return requestOrigin(url, newData, options);
}); });
} }
...@@ -156,7 +156,7 @@ export const requestOrigin = (url, data, options = {}) => { ...@@ -156,7 +156,7 @@ export const requestOrigin = (url, data, options = {}) => {
...options, ...options,
}) })
.then(response => { .then(response => {
console.log(response); // console.log(response);
if(response && response.errMsg){ if(response && response.errMsg){
response.errMsg = response.errMsg.slice(0,50); response.errMsg = response.errMsg.slice(0,50);
} }
...@@ -321,8 +321,6 @@ const setRequestConfig = config => { ...@@ -321,8 +321,6 @@ const setRequestConfig = config => {
}), }),
); );
} }
console.log(url, config);
return request(url, data, { ...options, ...config }); return request(url, data, { ...options, ...config });
}; };
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论