This commit is contained in:
2025-12-24 15:59:42 +08:00
parent 5461dc276c
commit 3f0f349adf
7 changed files with 22 additions and 454 deletions

View File

@@ -1,12 +1,4 @@
// #ifdef H5
import '@/lib/encryption/sm4.min.js'
// #endif
// #ifndef H5
import { sm4 } from 'sm-crypto';
// #endif
import useUserStore from "../stores/useUserStore";
import {
createRequestWithCache,
@@ -609,6 +601,7 @@ export function sm4Decrypt(key, value, mode = "hex") {
cipherType: mode === 'hex' ? 'hex' : 'base64',
padding: 'pkcs#5'
});
return decrypted
} catch (e) {
@@ -643,32 +636,20 @@ export function reloadBrowser() {
// 一体机环境判断
export function isY9MachineType() {
try {
const ua = navigator.userAgent;
const isY9Machine = /Y9-ZYYH/i.test(ua); // 匹配机器型号
return isY9Machine;
} catch (error) {
return false
}
const ua = navigator.userAgent;
const isY9Machine = /Y9-ZYYH/i.test(ua); // 匹配机器型号
return isY9Machine;
}
// 一体机环境判断
// 爱山东环境判断
export function isAsdMachineType() {
return typeof lightAppJssdk !== 'undefined'
// const ua = navigator.userAgent;
// const isY9Machine = /asd_hanweb/i.test(ua); // 匹配机器型号
// return isY9Machine;
try {
return !!lightAppJssdk.user
} catch (error) {
false
}
}
export const $api = {
msg,
prePage,