提交 48334617 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 移除sm4加密

上级 97f423c0
...@@ -2,14 +2,14 @@ import axios from 'axios' ...@@ -2,14 +2,14 @@ import axios from 'axios'
import md5 from 'js-md5' import md5 from 'js-md5'
import qs from 'qs' import qs from 'qs'
import { Modal, notification } from 'antd' import { Modal, notification } from 'antd'
import { sm4 as Sm4js } from 'evit-gm-crypt' // import { sm4 as Sm4js } from 'evit-gm-crypt'
const sm4 = new Sm4js({ // const sm4 = new Sm4js({
key: 'XDXDXU_ZIJING_01', // key: 'XDXDXU_ZIJING_01',
mode: 'cbc', // mode: 'cbc',
iv: 'IVIVIV_ZHIXUE_01', // iv: 'IVIVIV_ZHIXUE_01',
cipherType: 'base64' // cipherType: 'base64'
}) // })
function getToken() { function getToken() {
return window.localStorage.getItem('kiwi.token') ? window.localStorage.getItem('kiwi.token') : '' return window.localStorage.getItem('kiwi.token') ? window.localStorage.getItem('kiwi.token') : ''
...@@ -68,10 +68,10 @@ httpRequest.interceptors.request.use( ...@@ -68,10 +68,10 @@ httpRequest.interceptors.request.use(
} }
config.headers = { ...config.headers, ...defaultHeaders } config.headers = { ...config.headers, ...defaultHeaders }
if (config.data && config.headers['Content-Type'] !== 'multipart/form-data' && import.meta.env.PROD) { // if (config.data && config.headers['Content-Type'] !== 'multipart/form-data' && import.meta.env.PROD) {
// console.log({ ...config.data, expire: timestamp + 60 }) // // console.log({ ...config.data, expire: timestamp + 60 })
config.data = { data: sm4.encrypt(JSON.stringify({ ...config.data, expire: timestamp + 60 })) } // config.data = { data: sm4.encrypt(JSON.stringify({ ...config.data, expire: timestamp + 60 })) }
} // }
return config return config
}, },
......
...@@ -5,14 +5,14 @@ import md5 from 'js-md5' ...@@ -5,14 +5,14 @@ import md5 from 'js-md5'
import { get } from 'lodash-es' import { get } from 'lodash-es'
import { sortObjASCII } from '@/utils/common.js' import { sortObjASCII } from '@/utils/common.js'
import qs from 'qs' import qs from 'qs'
import { sm4 as Sm4js } from 'evit-gm-crypt' // import { sm4 as Sm4js } from 'evit-gm-crypt'
const sm4 = new Sm4js({ // const sm4 = new Sm4js({
key: 'XDXDXU_ZIJING_01', // key: 'XDXDXU_ZIJING_01',
mode: 'cbc', // mode: 'cbc',
iv: 'IVIVIV_ZHIXUE_01', // iv: 'IVIVIV_ZHIXUE_01',
cipherType: 'base64' // cipherType: 'base64'
}) // })
let pending = [] // 存储每个ajax请求的取消函数和ajax标识 let pending = [] // 存储每个ajax请求的取消函数和ajax标识
let CancelToken = Axios.CancelToken let CancelToken = Axios.CancelToken
...@@ -109,10 +109,10 @@ axios.interceptors.request.use( ...@@ -109,10 +109,10 @@ axios.interceptors.request.use(
pending.push({ url: config.url, cancel }) pending.push({ url: config.url, cancel })
}) })
if (config.data && config.headers['Content-Type'] !== 'multipart/form-data' && import.meta.env.PROD) { // if (config.data && config.headers['Content-Type'] !== 'multipart/form-data' && import.meta.env.PROD) {
// console.log({ ...qs.parse(config.data), expire: timeStr + 60 }) // // console.log({ ...qs.parse(config.data), expire: timeStr + 60 })
config.data = { data: sm4.encrypt(JSON.stringify({ ...qs.parse(config.data), expire: timeStr + 60 })) } // config.data = { data: sm4.encrypt(JSON.stringify({ ...qs.parse(config.data), expire: timeStr + 60 })) }
} // }
return config return config
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论