flat: 暂存

This commit is contained in:
Apcallover
2025-11-18 17:25:39 +08:00
parent ab3d9985c8
commit d2e77e66fc
7 changed files with 1663 additions and 30 deletions

View File

@@ -67,14 +67,14 @@ export const navTo = function(url, {
onBack = null
} = {}) {
const userStore = useUserStore();
if(isJumping) return
isJumping=true
if (isJumping) return
isJumping = true
if (needLogin && !userStore.hasLogin) {
setTimeout(() => {
uni.navigateTo({
url: '/pages/login/login'
});
isJumping=false
isJumping = false
}, 170);
return;
}
@@ -94,7 +94,7 @@ export const navTo = function(url, {
uni.navigateTo({
url: finalUrl
});
isJumping=false
isJumping = false
}, 170);
};
@@ -552,6 +552,25 @@ function isEmptyObject(obj) {
return obj && typeof obj === 'object' && !Array.isArray(obj) && Object.keys(obj).length === 0;
}
function aes_Decrypt(word, key) {
var key = CryptoJS.enc.Utf8.parse(key) //转为128bit
var srcs = CryptoJS.enc.Hex.parse(word) //转为16进制
var str = CryptoJS.enc.Base64.stringify(srcs) //变为Base64编码的字符串
var decrypt = CryptoJS.AES.decrypt(str, key, {
mode: CryptoJS.mode.ECB,
spadding: CryptoJS.pad.Pkcs7
})
return decrypt.toString(CryptoJS.enc.Utf8)
}
export function sm2_Decrypt(word, key) {
return SM.decrypt(word, key);
}
export function sm2_Encrypt(word, key) {
return SM.encrypt(word, key);
}
export const $api = {
msg,
@@ -565,7 +584,8 @@ export const $api = {
uploadFile,
formatFileSize,
sendingMiniProgramMessage,
copyText
copyText,
aes_Decrypt,
}
@@ -595,4 +615,7 @@ export default {
insertSortData,
isInWechatMiniProgramWebview,
isEmptyObject,
aes_Decrypt,
sm2_Decrypt,
sm2_Encrypt
}