mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-13 11:56:44 +08:00
feat: 优化工具函数
取消加密的选项,跟随之前的逻辑走
This commit is contained in:
@@ -2,7 +2,7 @@ import cacheUtils from '@/assets/js/utils/cacheUtils'
|
|||||||
|
|
||||||
const { setLocItem /*getLocItem*/ } = 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') {
|
if (name === '' && (typeof name).toLowerCase() !== 'string') {
|
||||||
console.error(`[syncLocalstorage] ${name} is not a string.`)
|
console.error(`[syncLocalstorage] ${name} is not a string.`)
|
||||||
return
|
return
|
||||||
@@ -17,10 +17,7 @@ export function syncLocalstorageData(data, { name = '', release = false, encrypt
|
|||||||
{
|
{
|
||||||
set(target, p, newValue, receiver) {
|
set(target, p, newValue, receiver) {
|
||||||
const res = Reflect.set(target, p, newValue, receiver)
|
const res = Reflect.set(target, p, newValue, receiver)
|
||||||
if (res) {
|
if (res) setLocItem(name, JSON.stringify(target))
|
||||||
if (encrypt) setLocItem(name, JSON.stringify(target))
|
|
||||||
else localStorage.setItem(name, JSON.stringify(target))
|
|
||||||
}
|
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
get(target, property, receiver) {
|
get(target, property, receiver) {
|
||||||
|
|||||||
@@ -515,7 +515,7 @@ export default {
|
|||||||
sex: '0',
|
sex: '0',
|
||||||
birthday: ""
|
birthday: ""
|
||||||
}, //投保人信息,
|
}, //投保人信息,
|
||||||
{ name: 'saleInsuredPersonInfo', encrypt: true}
|
{ name: 'saleInsuredPersonInfo'}
|
||||||
),
|
),
|
||||||
trialList: [],
|
trialList: [],
|
||||||
popupShow: false,
|
popupShow: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user