1. 特色方功能迭代(固定价格),固定价格目前统一使用药品id(-102),后期会考虑新增特色方的时候自动添加一个特色方药品
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
2. 退款的时候可以退回分成
This commit is contained in:
@@ -16,6 +16,12 @@ import { message } from 'ant-design-vue';
|
||||
// eslint-disable-next-line n/no-extraneous-import
|
||||
import { Base64 } from 'js-base64';
|
||||
|
||||
import {
|
||||
ENCRYPT_FIELDS,
|
||||
isSensitiveField,
|
||||
maskSensitiveField,
|
||||
TM_TEXT_SUFFIX,
|
||||
} from '#/constants/sensitive-fields';
|
||||
import { useAuthStore } from '#/store';
|
||||
|
||||
import { refreshTokenApi } from './core';
|
||||
@@ -23,33 +29,6 @@ import {downloadByData} from "#/util/tool";
|
||||
|
||||
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||
|
||||
const arr = new Set([
|
||||
'account',
|
||||
'accept_tel',
|
||||
'doctor',
|
||||
'express_mobile',
|
||||
'id_card',
|
||||
'idcard',
|
||||
'mobile',
|
||||
'password',
|
||||
'patient_mobile',
|
||||
'phone',
|
||||
]);
|
||||
|
||||
// 敏感数据
|
||||
const sensitiveData = new Set([
|
||||
'account',
|
||||
'accept_tel',
|
||||
'doctor',
|
||||
'express_mobile',
|
||||
'id_card',
|
||||
'idcard',
|
||||
'mobile',
|
||||
'password',
|
||||
'patient_mobile',
|
||||
'phone',
|
||||
]);
|
||||
|
||||
function createRequestClient(baseURL: string) {
|
||||
const client = new RequestClient({
|
||||
baseURL,
|
||||
@@ -189,61 +168,34 @@ export const baseRequestClient = new RequestClient({ baseURL: apiURL });
|
||||
*/
|
||||
function getRes(obj: any, isDecode = true) {
|
||||
try {
|
||||
if (obj == null || typeof obj !== 'object') {
|
||||
return obj;
|
||||
}
|
||||
for (const key in obj) {
|
||||
// 跳过脱敏展示字段,避免重复处理
|
||||
if (key.endsWith(TM_TEXT_SUFFIX)) {
|
||||
continue;
|
||||
}
|
||||
if (Array.isArray(obj[key])) {
|
||||
obj[key] = getRes(obj[key]);
|
||||
} else if (typeof obj[key] === 'object') {
|
||||
obj[key] = getRes(obj[key]);
|
||||
} else {
|
||||
// 判断obj[key]是否在arr中
|
||||
if (arr.has(key)) {
|
||||
let aseFile = '';
|
||||
aseFile = isDecode
|
||||
? customBase64Decode(obj[key], key)
|
||||
: customBase64Encode(obj[key]);
|
||||
const isGarbled =
|
||||
// eslint-disable-next-line no-control-regex
|
||||
/[\u0000-\u0008\v\f\u000E-\u001F\u007F-\u00FF\u{E000}-\u{F8FF}]/u.test(
|
||||
aseFile,
|
||||
);
|
||||
if (isGarbled) {
|
||||
aseFile = obj[key];
|
||||
}
|
||||
if (isDecode && sensitiveData.has(key)) {
|
||||
// 数据脱敏,自动匹配姓名、手机号、身份证
|
||||
// switch (key) {
|
||||
// case 'accept_name':
|
||||
// case 'express_name':
|
||||
// case 'express_region':
|
||||
// case 'patient': {
|
||||
// // 保留前两个字符,其余用星号代替
|
||||
// aseFile = aseFile.slice(0, 1).padEnd(aseFile.length, '*');
|
||||
// break;
|
||||
// }
|
||||
// case 'express_mobile':
|
||||
// case 'mobile':
|
||||
// case 'phone': {
|
||||
// // 保留前三位和后四位,中间用星号代替
|
||||
// aseFile =
|
||||
// aseFile.slice(0, 3).padEnd(aseFile.length - 4, '*') +
|
||||
// aseFile.slice(-4);
|
||||
// break;
|
||||
// }
|
||||
// case 'id_card':
|
||||
// case 'idcard': {
|
||||
// // 保留前六位和后四位,中间用星号代替
|
||||
// aseFile =
|
||||
// aseFile.slice(0, 6).padEnd(aseFile.length - 4, '*') +
|
||||
// aseFile.slice(-4);
|
||||
// break;
|
||||
// }
|
||||
// default: {
|
||||
// // 默认情况下,全部用星号代替
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
obj[key] = aseFile;
|
||||
obj[key] = getRes(obj[key], isDecode);
|
||||
} else if (obj[key] !== null && typeof obj[key] === 'object') {
|
||||
obj[key] = getRes(obj[key], isDecode);
|
||||
} else if (ENCRYPT_FIELDS.has(key)) {
|
||||
let plainValue = isDecode
|
||||
? customBase64Decode(obj[key], key)
|
||||
: customBase64Encode(obj[key]);
|
||||
const isGarbled =
|
||||
// eslint-disable-next-line no-control-regex
|
||||
/[\u0000-\u0008\v\f\u000E-\u001F\u007F-\u00FF\u{E000}-\u{F8FF}]/u.test(
|
||||
plainValue,
|
||||
);
|
||||
if (isGarbled) {
|
||||
plainValue = obj[key];
|
||||
}
|
||||
obj[key] = plainValue;
|
||||
// 解密后写入脱敏展示字段,明文保留在原字段
|
||||
if (isDecode && isSensitiveField(key)) {
|
||||
obj[key + TM_TEXT_SUFFIX] = maskSensitiveField(key, plainValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user