接口加密
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import useUserStore from "../stores/useUserStore";
|
||||
import { sm4Encrypt, sm4Decrypt } from '@/utils/crypto';
|
||||
|
||||
import {
|
||||
request,
|
||||
createRequest,
|
||||
@@ -384,6 +386,14 @@ const formatTotal = (total) => {
|
||||
return `${roundedTotal}+`;
|
||||
};
|
||||
|
||||
export function sm2_Decrypt(word, key) {
|
||||
return SM.decrypt(word, key);
|
||||
}
|
||||
|
||||
export function sm2_Encrypt(word, key) {
|
||||
return SM.encrypt(word, key);
|
||||
}
|
||||
|
||||
export function formatDate(isoString) {
|
||||
const date = new Date(isoString);
|
||||
const year = date.getFullYear();
|
||||
@@ -1041,4 +1051,8 @@ export default {
|
||||
insertSortData,
|
||||
isInWechatMiniProgramWebview,
|
||||
isEmptyObject,
|
||||
sm4Decrypt,
|
||||
sm4Encrypt,
|
||||
sm2_Decrypt,
|
||||
sm2_Encrypt,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user