This commit is contained in:
冯辉
2026-05-01 04:02:50 +08:00
parent 57b18c0a65
commit 7ad59aeeab
4 changed files with 31 additions and 20 deletions

View File

@@ -23,9 +23,11 @@ const encryptPathPrefixes = [
'/app/companycontact/',
'/app/appskill/',
'/app/userworkexperiences/',
'/app/appWxphoneSmsCode',
'/app/user/',
'/app/user/resume/',
'/cms/job/recommen/',
'/app/appLoginPhone',
'/app/notice/',
];
@@ -49,7 +51,7 @@ const isEncryptNeeded = (method, url) => {
const encryptRequestData = (data) => {
const jsonData = JSON.stringify(data);
// const jsonData = JSON.stringify({a: '1'});
console.log('[请求] 加密前:', jsonData)
// console.log('[请求] 加密前:', jsonData)
return {
encrypted: true,
encryptedData: sm4Encrypt(config.sm4Config.key, jsonData),
@@ -62,7 +64,7 @@ const handleResponseData = (resData) => {
if (resData?.encrypted) {
const decrypted = sm4Decrypt(config.sm4Config.key, resData.encryptedData);
resData = JSON.parse(decrypted);
console.log('[请求] 解密后数据:', resData);
// console.log('[请求] 解密后数据:', resData);
}
} catch (e) {
console.error('[请求] 解密失败:', e.message);