mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-07 10:06:44 +08:00
Compare commits
2 Commits
release/【2
...
hotfix/【20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd0017a216 | ||
|
|
308f273b57 |
@@ -343,4 +343,22 @@ export function getUniversalCodeLst(data) {
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// redis存数据
|
||||
export function getCacheRedis(data) {
|
||||
return request({
|
||||
url: getUrl('/app/cacheConfig/getCacheRedis', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// redis取数据
|
||||
export function setCacheRedis(data) {
|
||||
return request({
|
||||
url: getUrl('/app/cacheConfig/setCacheRedis', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,30 +1,52 @@
|
||||
import {AESCacheEncrypt,AESCacheDecrypt} from '@/assets/js/utils/cryptoJsUtil'
|
||||
import configApp from '@/config'
|
||||
import cacheKeys from '@/assets/js/utils/needCacheKey'
|
||||
import { getCacheRedis, setCacheRedis } from '@/api/ebiz/sale/sale'
|
||||
export default {
|
||||
setLocItem: function(key, value) {
|
||||
const exist = cacheKeys.encodeKeys.find(item => {
|
||||
return item === key
|
||||
})
|
||||
//设置localStorage 值
|
||||
if (cacheKeys.isAll || exist) {
|
||||
window.localStorage.setItem(key, AESCacheEncrypt(value, configApp.CACHE_ENCRYP))
|
||||
} else {
|
||||
window.localStorage.setItem(key, value)
|
||||
}
|
||||
async setCacheRedis(params){
|
||||
await setCacheRedis(params)
|
||||
},
|
||||
getLocItem: function(key) {
|
||||
// 获取localStorage 中值
|
||||
let value = window.localStorage.getItem(key)
|
||||
if (value && value != '') {
|
||||
setLocItem: function(key, value) {
|
||||
if(key != 'token'){
|
||||
const exist = cacheKeys.encodeKeys.find(item => {
|
||||
return item === key
|
||||
})
|
||||
if (cacheKeys.isAll || exist) {
|
||||
return AESCacheDecrypt(value, configApp.CACHE_ENCRYP)
|
||||
let params = {
|
||||
key: key,
|
||||
value: AESCacheEncrypt(value, configApp.CACHE_ENCRYP)
|
||||
}
|
||||
this.setCacheRedis(params)
|
||||
} else {
|
||||
let params = {
|
||||
key: key,
|
||||
value: AESCacheEncrypt(value, configApp.CACHE_ENCRYP)
|
||||
}
|
||||
this.setCacheRedis(params)
|
||||
}
|
||||
}else{
|
||||
window.localStorage.setItem(key, value)
|
||||
}
|
||||
},
|
||||
getLocItem: function(key,type) {
|
||||
if(key != 'token') {
|
||||
return new Promise((resolve,reject)=>{
|
||||
let params = {
|
||||
key: key
|
||||
}
|
||||
getCacheRedis(params,type).then(res=>{
|
||||
const exist = cacheKeys.encodeKeys.find(item => {
|
||||
return item === key
|
||||
})
|
||||
if (cacheKeys.isAll || exist) {
|
||||
resolve(AESCacheDecrypt(res, configApp.CACHE_ENCRYP))
|
||||
// return AESCacheDecrypt(res, configApp.CACHE_ENCRYP)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
return window.localStorage.getItem(key)
|
||||
}
|
||||
return value
|
||||
},
|
||||
removeLocItem: function(key) {
|
||||
// 获取localStorage 中值
|
||||
|
||||
@@ -405,7 +405,9 @@ export default {
|
||||
//校验该代理人是否有该产品的售卖权限
|
||||
return this.$toast(flagPermission.resultMessage)
|
||||
}
|
||||
let flagCompany = await riskRules.checkCompany(resultData.productCode, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).workcompany, JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).isAsync,this)
|
||||
|
||||
let dataResp = await this.$CacheUtils.getLocItem('saleInsuredInfo')
|
||||
let flagCompany = await riskRules.checkCompany(resultData.productCode, JSON.parse(dataResp).workcompany, JSON.parse(dataResp).isAsync,this)
|
||||
if (flagCompany && localStorage.isFrom != 'proposal') {
|
||||
//校验该投保人的工作单位是否能够投保该产品
|
||||
return this.$toast('该投保人工作单位不能投保该产品')
|
||||
@@ -472,6 +474,16 @@ export default {
|
||||
this.jumpTo()
|
||||
}
|
||||
},
|
||||
async getResp(){
|
||||
let res = ''
|
||||
res = await this.$CacheUtils.getData('saleInsuredInfo',123)
|
||||
console.log('res');
|
||||
console.log(res);
|
||||
if (res){
|
||||
return res
|
||||
}
|
||||
|
||||
},
|
||||
//构建险种因子列表
|
||||
getFactorList(resultData) {
|
||||
let productTrialInfoDTO = resultData.productTrialInfoDTO
|
||||
|
||||
Reference in New Issue
Block a user