1
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
14b0a45817
commit
8300cbaccf
|
@ -21,7 +21,7 @@ export const Encrypt = {
|
|||
} else {
|
||||
let res = await getPublicKey();
|
||||
if (res.IsSuccess) {
|
||||
PublicKey = res.Result
|
||||
PublicKey = decodeURI(res.Result)
|
||||
sessionStorage.setItem('PublicKey', res.Result)
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -6,8 +6,9 @@ export const encryptConfig = async (config) => {
|
|||
config.headers['X-Encrypted-Key'] = encryptSecretKey;
|
||||
}
|
||||
if (config.data && Object.prototype.toString.call(config.data) === '[object Object]') {
|
||||
Object.keys(config.data).forEach(key => {
|
||||
config.data[key] = Crypto.AES.encrypt(config.data[key], secretKey)
|
||||
Object.keys(config.data).forEach(async key => {
|
||||
// config.data[key] = Crypto.AES.encrypt(config.data[key], secretKey)
|
||||
config.data[key] = await Encrypt.encrypt(config.data[key])
|
||||
})
|
||||
}
|
||||
return config;
|
||||
|
|
|
@ -22,9 +22,13 @@ service.interceptors.request.use(
|
|||
var language = zzSessionStorage.getItem('lang')
|
||||
config.headers['Accept-Language'] = language === 'en' ? 'en-US,en;q=0.5' : 'zh-CN,zh;q=0.9'
|
||||
config.headers['TimeZoneId'] = moment.tz.guess()
|
||||
if (config.ENCRYPT) {
|
||||
config = await encryptConfig(config)
|
||||
}
|
||||
// if (config.ENCRYPT) {
|
||||
// try{
|
||||
// config = await encryptConfig(config)
|
||||
// }catch(err){
|
||||
// console.log(err)
|
||||
// }
|
||||
// }
|
||||
if (store.getters.token && !config.clearToken) {
|
||||
config.headers.Authorization = `Bearer ${store.getters.token}`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue