接口加密

This commit is contained in:
冯辉
2026-04-30 13:28:49 +08:00
parent 5007c3ca4e
commit e40f0ebab8
4 changed files with 128 additions and 7 deletions

View File

@@ -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,
}