feat: 优化工具函数

取消加密的选项,跟随之前的逻辑走
This commit is contained in:
hz
2025-10-28 11:41:11 +08:00
parent 7f6eb84f95
commit e660bb1de8
2 changed files with 3 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ import cacheUtils from '@/assets/js/utils/cacheUtils'
const { setLocItem /*getLocItem*/ } = cacheUtils
export function syncLocalstorageData(data, { name = '', release = false, encrypt = false } = {}) {
export function syncLocalstorageData(data, { name = '', release = false } = {}) {
if (name === '' && (typeof name).toLowerCase() !== 'string') {
console.error(`[syncLocalstorage] ${name} is not a string.`)
return
@@ -17,10 +17,7 @@ export function syncLocalstorageData(data, { name = '', release = false, encrypt
{
set(target, p, newValue, receiver) {
const res = Reflect.set(target, p, newValue, receiver)
if (res) {
if (encrypt) setLocItem(name, JSON.stringify(target))
else localStorage.setItem(name, JSON.stringify(target))
}
if (res) setLocItem(name, JSON.stringify(target))
return res
},
get(target, property, receiver) {

View File

@@ -515,7 +515,7 @@ export default {
sex: '0',
birthday: ""
}, //投保人信息,
{ name: 'saleInsuredPersonInfo', encrypt: true}
{ name: 'saleInsuredPersonInfo'}
),
trialList: [],
popupShow: false,