加解密配置

This commit is contained in:
bb_pan 2025-02-24 15:40:42 +08:00
parent 22348c07fb
commit b5225e199a
1 changed files with 5 additions and 2 deletions

View File

@ -44,8 +44,11 @@ service.interceptors.request.use(
}
if (config.data) {
let data = typeof config.data === 'object' ? JSON.stringify(config.data) : config.data
config.data = encryptWithSM4(data + '|' + hashWithSM3AndSalt(data))
// config.data = data
if (config.headers['encryptRequest'] == 'true') {
config.data = encryptWithSM4(data + '|' + hashWithSM3AndSalt(data))
} else {
config.data = data
}
}
return config
},