qirong
2023-12-07 5c48422b1117f6b466bc288b7ac5ace7d3f24516
登录
1个文件已修改
1个文件已添加
6 ■■■■ 已修改文件
dist.zip 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dist.zip
Binary files differ
src/utils/request.ts
@@ -53,7 +53,7 @@
      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,
@@ -77,7 +77,7 @@
      }
    }
    // 当开启参数加密
    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));
@@ -126,7 +126,7 @@
      ElNotification.error({ title: msg });
      return Promise.reject('error');
    } else {
      return Promise.resolve(res.data);
    }
  },
  (error: any) => {