Merge branch 'feature/GFRS-1989【待确定】客户核验流程优化' into dev

# Conflicts:
#	package.json
#	src/assets/js/utils/cacheUtils.js
#	src/assets/js/utils/cryptoJsUtil.js
#	src/assets/js/utils/needCacheKey.js
#	src/config/index.js
#	src/main.js
This commit is contained in:
yang.huaxiang
2020-10-28 10:37:01 +08:00
5 changed files with 128 additions and 51 deletions

View File

@@ -1,6 +1,6 @@
import AESTools from '@/assets/js/utils/cryptoJsUtil'
import configApp from '@/config'
import cacheKeys from './needCacheKey'
import cacheKeys from '@/assets/js/utils/needCacheKey'
export default {
setLocItem: function(key, value) {
const exist = cacheKeys.encodeKeys.find(item => {

View File

@@ -1,47 +1,47 @@
import CryptoJS from 'crypto-js'
export default {
AESEncrypt: function (data, keys) {//加密
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF');//偏移量
var encrypted = CryptoJS.AES.encrypt(data, key,
{
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return encrypted.toString();
},
AESDecrypt: function (encrypted, keys) {//解密
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF');
var decrypted = CryptoJS.AES.decrypt( encrypted, key,
{
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return CryptoJS.enc.Utf8.stringify(decrypted)
},
AESCacheEncrypt: function (data, keys) {//加密 緩存
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF');//偏移量
var encrypted = CryptoJS.AES.encrypt(data, key,
{
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return encrypted.toString();
},
AESCacheDecrypt: function (encrypted, keys) {//解密 緩存
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF');
var decrypted = CryptoJS.AES.decrypt( encrypted, key,
{
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return CryptoJS.enc.Utf8.stringify(decrypted)
}
AESEncrypt: function(data, keys) {
//加密
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF') //偏移量
var encrypted = CryptoJS.AES.encrypt(data, key, {
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString()
},
AESDecrypt: function(encrypted, keys) {
//解密
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF')
var decrypted = CryptoJS.AES.decrypt(encrypted, key, {
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return CryptoJS.enc.Utf8.stringify(decrypted)
},
AESCacheEncrypt: function(data, keys) {
//加密 緩存
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF') //偏移量
var encrypted = CryptoJS.AES.encrypt(data, key, {
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString()
},
AESCacheDecrypt: function(encrypted, keys) {
//解密 緩存
var key = CryptoJS.enc.Hex.parse(keys)
var iv = CryptoJS.enc.Utf8.parse('0123456789ABCDEF')
var decrypted = CryptoJS.AES.decrypt(encrypted, key, {
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return CryptoJS.enc.Utf8.stringify(decrypted)
}
}

View File

@@ -5,7 +5,7 @@
*
*/
let apiDomain, imgDomain, assetsUrl, mainUrl, payUrl, zssqUrl ,REQ_PWD, CACHE_ENCRYP, API_VERSION// 保融支付的收银台服务地址
let apiDomain, imgDomain, assetsUrl, mainUrl, payUrl, zssqUrl, REQ_PWD, CACHE_ENCRYP, API_VERSION // 保融支付的收银台服务地址
// 可以多个接口域名,按需添加
console.log('环境:', process.env.VUE_APP_FLAG)
@@ -18,7 +18,7 @@ switch (process.env.VUE_APP_FLAG) {
mainUrl = 'http://139.199.50.151'
payUrl = 'https://funduat.e-guofu.com/s3-modules-gateway/embed/gateway.action'
zssqUrl = 'http://139.199.50.151/html/test/index.html#/'
REQ_PWD = '41424344454631323334353637383930'
REQ_PWD = '41424344454631323334353637383930'
CACHE_ENCRYP = '41424344454631323334353637383930'
API_VERSION = 'v2'
break

View File

@@ -11,11 +11,10 @@ import config from '@/config'
import noMoreClick from '@/directive/noMoreClick'
import vueHashCalendar from 'vue-hash-calendar'
import 'vue-hash-calendar/lib/vue-hash-calendar.css'
import md5 from 'js-md5';
import md5 from 'js-md5'
import cryptoJs from 'crypto-js'
import cacheUtils from '@/assets/js/utils/cacheUtils'
import { Cell, CellGroup, DatetimePicker, Popup, Picker, Col, Row, Tab, Tabs, NavBar, Toast, Button, Dialog, Icon, Lazyload } from 'vant'
Vue.use(Cell)
Vue.use(CellGroup)

View File

@@ -332,7 +332,11 @@ export default {
changeCard: localStorage.changeCard,
salePageFlag: '-10',
recognizeResult: '', //微信端-人脸识别结果
recognizeMessage: '' //微信端-人脸识别失败原因
recognizeMessage: '', //微信端-人脸识别失败原因
realPeopleRidInfo: {
appntRidFlag: null,
insureRidFlag: null
}
}
},
methods: {
@@ -501,6 +505,37 @@ export default {
})
})
},
// 手机号鉴权
async realPeopleCheckMobile(type) {
this.$toast.loading({
// 持续展示 toast
duration: 0,
// 禁用背景点击s
forbidClick: true,
loadingType: 'spinner',
message: '加载中……'
})
let data = {}
if ('appnt' == type) {
let appntData = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
data = {
name: appntData.name,
idType: appntData.idType,
idNo: appntData.idNo,
mobile: appntData.mobile
}
} else if ('insured' == type) {
let insuredData = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
data = {
name: insuredData.name,
idType: insuredData.idType,
idNo: insuredData.idNo,
mobile: insuredData.mobile
}
}
let res = await checkPhone(data)
return res
},
// 验证码确认事件
async authConfirm() {
//清理计时器
@@ -581,6 +616,16 @@ export default {
if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '1') {
that.goUrl()
} else {
//RID 状态--有效
if (this.realPeopleRidInfo.appntRidFlag && this.realPeopleRidInfo.appntRidFlag == '0') {
// 手机号鉴权 --通过
let res = this.realPeopleCheckMobile('appnt')
if (res && res.result == '0') {
that.goUrl()
return
}
}
// 人脸识别
if (this.faceAuthCount.appnt < this.smsAuthNum) {
// this.idcardData.typeface = !this.idcardData.typeface
// this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name
@@ -600,6 +645,16 @@ export default {
// if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1') {
that.insuredUrl()
} else {
//RID 状态--有效
if (this.realPeopleRidInfo.insureRidFlag && this.realPeopleRidInfo.insureRidFlag == '0') {
// 手机号鉴权 --通过
let res = this.realPeopleCheckMobile('insured')
if (res && res.result == '0') {
that.insuredUrl()
return
}
}
// 人脸识别
if (this.faceAuthCount.insured < this.smsAuthNum) {
// this.idcardData.typeface = !this.idcardData.typeface
// this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredPersonInfo).name
@@ -621,6 +676,15 @@ export default {
// if (this.saleInsuredInfo.idType != '1' || this.saleInsuredInfo.age < '18') {
that.goUrl()
} else {
//RID 状态--有效
if (this.realPeopleRidInfo.appntRidFlag && this.realPeopleRidInfo.appntRidFlag == '0') {
// 手机号鉴权 --通过
let res = this.realPeopleCheckMobile('appnt')
if (res && res.result == '0') {
that.goUrl()
return
}
}
if (this.faceAuthCount.appnt < this.smsAuthNum) {
// 原人脸识别
// EWebBridge.webCallAppInJs('face_auth', {
@@ -654,6 +718,16 @@ export default {
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '18') {
that.insuredUrl()
} else {
//RID 状态--有效
if (this.realPeopleRidInfo.insureRidFlag && this.realPeopleRidInfo.insureRidFlag == '0') {
// 手机号鉴权 --通过
let res = this.realPeopleCheckMobile('insured')
if (res && res.result == '0') {
that.insuredUrl()
return
}
}
// 人脸识别
if (this.faceAuthCount.insured < this.smsAuthNum) {
// 调原生人脸识别
// EWebBridge.webCallAppInJs('face_auth', {
@@ -965,7 +1039,8 @@ export default {
message: '加载中……'
})
let data = {
orderNo: window.localStorage.getItem('orderNo')
orderNo: window.localStorage.getItem('orderNo'),
getOtherType: 'RID'
}
localStorage.setItem('riskName', '')
return new Promise(resolve => {
@@ -1058,6 +1133,9 @@ export default {
that.recmd = res.orderDTO.recmdDTO
that.orderInfo = res.orderDTO.orderInfoDTO
that.insured = res.orderDTO.insuredDTOs
// 初始化RID状态
this.realPeopleRidInfo.appntRidFlag = this.appnt.ridStatus
this.realPeopleRidInfo.insureRidFlag = this.insured[0].ridStatus
//存code区分万能型产品
let productCode, riskName
console.log('isDoubleMailRisk', that.orderInfo.isDoubleMailRisk)