【GFRS-3645】生成电子合同接口对接 接口封装的token拦截方法修改

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-08-09 17:44:08 +08:00
parent d49fd76db9
commit 38a051fae4
5 changed files with 42 additions and 9 deletions

View File

@@ -17,3 +17,12 @@ export function putContractInfo(data) {
data
})
}
// 生成电子合同pdf
export function generateAgreementYB(data) {
return request({
url: getUrl('/agent/enterYB/generateAgreementYB', 1),
method: 'post',
data
})
}

View File

@@ -220,7 +220,7 @@ service.interceptors.request.use(
let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //判断是否是 android终端
if (isAndroid) {
// setTimeout(() => {
if (window.location.hash !== '#/my/privacyPolicy') {
if (window.location.hash !== '#/my/privacyPolicy' && window.location.hash !== '#/YB_agentSign/step1' && window.location.hash !== '#/YB_agentSign/step2') {
console.log(window.Android.getToken(), 'Android获取token')
CacheUtils.setLocItem('token', window.Android.getToken())
}

View File

@@ -30,6 +30,7 @@ export default new Vuex.Store({
answerType: false,//风险测评tab是否显示
YBidNo: '', //银保代理人电子化合同签署证件号码
YBname: '', //银保代理人电子化合同签署姓名
YBuuid: '', //银保代理人电子化合同签署代理人uuid
},
mutations: {
setOrderDetail (state, data) {
@@ -88,6 +89,10 @@ export default new Vuex.Store({
updateYBname (state, val) {
state.YBname = val
},
//更新 银保代理人电子化合同签署代理人uuid
updateYBuuid (state, val) {
state.YBuuid = val
},
},
getters: {
getPageFlag (state) {
@@ -120,6 +125,9 @@ export default new Vuex.Store({
getYBname (state) {
return state.YBname
},
getYBuuid (state) {
return state.YBuuid
},
}
})

View File

@@ -139,7 +139,8 @@ export default {
this.isCaptchaModalShow = false
this.$store.commit('updateYBidNo', this.idNo)
this.$store.commit('updateYBname', this.name)
this.$router.push({ path: '/YB_agentSign/step2',query:{uuid:this.uuid} })
this.$store.commit('updateYBuuid', this.uuid)
this.$router.push({ path: '/YB_agentSign/step2'})
} else {
this.$toast(res.resultMessage)
}

View File

@@ -3,7 +3,7 @@
<van-notice-bar :scrollable='false' v-if='!Time' class='notice'>
{{ `提示:阅读时长需在${this.Time ? this.time : this.number}秒以上` }}
</van-notice-bar>
<iframe :src='src + pdfUrl' class='iframe'></iframe>
<iframe :src="pdfUrl" class="iframe" id="iframepage"></iframe>
<van-radio-group v-model='radio' class='pb10 pt20 pl30 fs14'>
<van-radio name='1' @click='click'>
本人确认已阅读<span>电子化合同签署</span>
@@ -24,6 +24,7 @@
<script>
import { RadioGroup, Radio, Dialog, NoticeBar } from 'vant'
import config from '@/config'
import { generateAgreementYB } from '@/api/ebiz/YB_agentSign/YB_agentSign'
export default {
data() {
let isWeixin = this.$utils.device().isWeixin //判断环境
@@ -51,16 +52,30 @@
},
created(){
this.timeOut()
},
mounted() {
let thispolicyUrl = "Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoMO3QJwd%2BpYNd%2BhiCehCCFibahgDp%2FtP6UD%0A6vy8eKAAs4hhrh0dSyUouHrBpcu%2FGM6VGLphInLPv0HGtHpZ3OhD"
document.body.style.backgroundColor = '#fff'
// this.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${thispolicyUrl}`)
let dataParams = {
idType:'0',
idNo:this.$store.getters.getYBidNo,
name:this.$store.getters.getYBname
}
generateAgreementYB(dataParams).then(res=>{
if(res.result == 0){
this.pdfUrl = encodeURIComponent('https://iagentsales-test2.e-guofu.com:5443/updown' + `/returnDirectStream?imgPath=${res.content.rgssUrl}`)
// this.pdfUrl = res.content.rgssUrl
let signInfo = JSON.parse(localStorage.getItem('signInfo'))
if (signInfo && signInfo.status == '0') {
this.base64 = sessionStorage.getItem('twoimgBase64Data')
this.$set(this.signInfo, 'status', '1')
}
},
mounted() {
let thispolicyUrl = "Ra4LpmZv2h6FrwZPS48QIETiI2AcWWLx6RavVjoAkoMO3QJwd%2BpYNd%2BhiCehCCFibahgDp%2FtP6UD%0A6vy8eKAAs4hhrh0dSyUouHrBpcu%2FGM6VGLphInLPv0HGtHpZ3OhD"
document.body.style.backgroundColor = '#fff'
this.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${thispolicyUrl}`)
}else{
this.$toast(res.resultMessage)
}
})
},
methods: {
// 点击阅读时