用户信息加密方法待更新

This commit is contained in:
2026-02-24 10:13:06 +08:00
parent c1a77cfd9b
commit 6fcf6e8a70
7 changed files with 107 additions and 57 deletions

View File

@@ -162,6 +162,7 @@
} from "@/utils/tabbarManager";
import WxAuthLogin from "@/components/WxAuthLogin/WxAuthLogin.vue";
import config from "@/config.js";
import CryptoJS from 'crypto-js'
const {
longitudeVal,
latitudeVal
@@ -270,6 +271,12 @@
contactperson: "",
contactphone: "",
}
//用户信息加密方法待更新
// let key = '9zS+DFKrzxvosO82mTcPJQ=='
// let secretKey = CryptoJS.enc.Utf8.parse(key);//key 为你的秘钥
// let srcs = CryptoJS.enc.Utf8.parse(form.idno);
// let encrypted = CryptoJS.AES.encrypt(srcs, secretKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}).toString()
// form.idno=encrypted
}else if (uni.getStorageSync('userInfo') && uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={
usertype: "2",
@@ -309,7 +316,7 @@
// wxAuthLoginRef.value?.open();
// });
// });
watch(() => userInfo.value.userType, (newVal) => {
watch(() => userInfo.value.userType, (newVal) => {
if(newVal=='ent'){
showTabar.value = true
}else{
@@ -408,18 +415,18 @@
};
async function getHeart() {
const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : "";
var isLogins = await thirdLogin();
const headers = token ? {
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
} : {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (isLogins) {
isLogin.value = true;