111
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user