提交 32139dfc authored 作者: 钟是志's avatar 钟是志

增加部分需要加密的接口

上级 3c578f4d
...@@ -18,6 +18,12 @@ const encryptApiList = [ ...@@ -18,6 +18,12 @@ const encryptApiList = [
{ {
api: 'UnifiedAppApi/getDetail', api: 'UnifiedAppApi/getDetail',
}, },
{
api: 'UnifiedServiceApi/getDetail',
},
{
api: 'UnifiedAppFormApi/getFormDetail',
},
{ {
api: '/CmsApi/', api: '/CmsApi/',
}, },
......
...@@ -4,7 +4,7 @@ import { isJSON } from '@/webPublic/zyd_public/utils/utils'; ...@@ -4,7 +4,7 @@ import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import { import {
queryApiActionPath, queryApiActionPath,
queryIsBinary, queryIsBinary,
queryIsSafe queryIsSafe,
} from '@/webPublic/one_stop_public/utils/queryConfig'; } from '@/webPublic/one_stop_public/utils/queryConfig';
import { getToken, getUserInfo } from '@/webPublic/one_stop_public/utils/token'; import { getToken, getUserInfo } from '@/webPublic/one_stop_public/utils/token';
import encryptApiList from './encryptApiList'; import encryptApiList from './encryptApiList';
...@@ -112,7 +112,6 @@ export function requestFileInfo(url, datas) { ...@@ -112,7 +112,6 @@ export function requestFileInfo(url, datas) {
return res.json(); return res.json();
}) })
.then(res => { .then(res => {
// console.log(res);
if (res && res.errCode) { if (res && res.errCode) {
qqCw({ qqCw({
msg: res.errMsg || res.message, msg: res.errMsg || res.message,
...@@ -120,6 +119,13 @@ export function requestFileInfo(url, datas) { ...@@ -120,6 +119,13 @@ export function requestFileInfo(url, datas) {
}); });
return false; return false;
} }
if (datas && datas.bin) {
res = binaryToStr(res.result);
if (isJSON(res)) {
res = JSON.parse(res);
}
console.log(res);
}
return res; return res;
}); });
} }
...@@ -137,7 +143,7 @@ function formatDatas(datas) { ...@@ -137,7 +143,7 @@ function formatDatas(datas) {
let datasTrue = { let datasTrue = {
fileParams: file, fileParams: file,
}; };
if(openIsBinary){ if (openIsBinary) {
datasTrue.bin = true; datasTrue.bin = true;
} }
return datasTrue; return datasTrue;
...@@ -180,12 +186,25 @@ function strToBinary(str) { // 字符串转二进制 ...@@ -180,12 +186,25 @@ function strToBinary(str) { // 字符串转二进制
result.push(' '); result.push(' ');
} }
let item = list[i]; let item = list[i];
let binaryStr = item.charCodeAt().toString(2); let binaryStr = item.charCodeAt()
.toString(2);
result.push(binaryStr); result.push(binaryStr);
} }
return result.join(''); return result.join('');
} }
function binaryToStr(binaryStr = '') {
let res = '';
if (binaryStr) {
let strListArr = binaryStr.split(' ');
for (let i = 0; i < strListArr.length; i++) {
let item = strListArr[i];
res += String.fromCharCode(parseInt(item, 2));
}
}
return res;
}
function giveFilePostData(datas, url) { function giveFilePostData(datas, url) {
for (let i in datas) { for (let i in datas) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论