|
@@ -4,7 +4,8 @@ import {
|
|
|
} from '../utils/aes.js'
|
|
|
|
|
|
//解密脱敏字段集合 type(姓名 1、手机号 2、身份证 3)
|
|
|
-const tmList = [{
|
|
|
+const tmList = [
|
|
|
+ {
|
|
|
prop: 'card',
|
|
|
type: 3
|
|
|
},
|
|
@@ -116,7 +117,9 @@ const tmList = [{
|
|
|
// 不做脱敏处理的api集合(页面上需要编辑单独处理的)
|
|
|
const apiList = [
|
|
|
'/api/commonPerson/list',
|
|
|
- '/scenic/api/order/scanCode'
|
|
|
+ '/scenic/api/order/scanCode',
|
|
|
+ '/merchant/hotel/order/getOrderDetail',
|
|
|
+ '/merchant/hotel/repast/getRepastOrderInfo'
|
|
|
]
|
|
|
//解密脱敏处理
|
|
|
function dealJmTmData(data, isTm) {
|
|
@@ -141,6 +144,25 @@ function dealJmTmData(data, isTm) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//将null和undefined转为空字符串
|
|
|
+function nullToKongStr(data){
|
|
|
+ if (!data) return;
|
|
|
+ let keys = Object.keys(data);
|
|
|
+ keys.forEach(k => {
|
|
|
+ if(data[k]===null||data[k]===undefined) data[k] = "";
|
|
|
+
|
|
|
+ if (typeof data[k] === 'object') {
|
|
|
+ nullToKongStr(data[k]);
|
|
|
+ } else if (Array.isArray(data[k])) {
|
|
|
+ data[k].forEach(dk => {
|
|
|
+ if (typeof dk === 'object') {
|
|
|
+ nullToKongStr(dk);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// 脱敏规则
|
|
|
function tmRules(value, type) {
|
|
|
if (!value) return;
|
|
@@ -188,9 +210,9 @@ export const $http = (url, method, data, json, isAuth, isBuffer) => {
|
|
|
uni.hideLoading()
|
|
|
//数据解密脱敏处理
|
|
|
if (response.data && response.data.data) {
|
|
|
+ nullToKongStr(response.data.data);
|
|
|
if (url.indexOf('/merchant/hotel/order/getOrderDetail/') > -1) {
|
|
|
//房态入住人不脱敏不加密数据备份
|
|
|
- console.log(response.data.data)
|
|
|
let checkInPersonList = response.data.data.detailFormList[0].checkInPersonList;
|
|
|
if (checkInPersonList.length != 0) {
|
|
|
checkInPersonList.forEach((ele, i) => {
|