| | |
| | | config.url = url; |
| | | } |
| | | |
| | | if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { |
| | | if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put' || config.method === 'get')) { |
| | | const requestObj = { |
| | | url: config.url, |
| | | data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, |
| | |
| | | } |
| | | } |
| | | // 当开启参数加密 |
| | | if (isEncrypt && (config.method === 'post' || config.method === 'put')) { |
| | | if (isEncrypt && (config.method === 'post' || config.method === 'put' || config.method === 'get')) { |
| | | // 生成一个 AES 密钥 |
| | | const aesKey = generateAesKey(); |
| | | config.headers['encrypt-key'] = encrypt(encryptBase64(aesKey)); |
| | |
| | | ElNotification.error({ title: msg }); |
| | | return Promise.reject('error'); |
| | | } else { |
| | | |
| | | return Promise.resolve(res.data); |
| | | } |
| | | }, |
| | | (error: any) => { |