hotfix-从路由获取token存储到LocalStorage时新增token是否为空判断

This commit is contained in:
zhang.weiwei
2025-04-30 23:00:01 +08:00
parent a1895b540c
commit d13ce27e3c
11 changed files with 858 additions and 831 deletions

View File

@@ -204,7 +204,9 @@ export default {
//初始化信息 //初始化信息
async init() { async init() {
if (this.isWeixin) { if (this.isWeixin) {
if (this.$route.query.token) {
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token)
}
if (this.$route.query.signInvalid) { if (this.$route.query.signInvalid) {
sessionStorage.setItem('signInvalid', this.$route.query.signInvalid) sessionStorage.setItem('signInvalid', this.$route.query.signInvalid)
} }

View File

@@ -151,7 +151,9 @@ export default {
// 初始化 // 初始化
async init() { async init() {
if (this.isWeixin) { if (this.isWeixin) {
if (this.$route.query.token) {
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token)
}
// let signInvalid = sessionStorage.getItem('signInvalid') // let signInvalid = sessionStorage.getItem('signInvalid')
// let rs = await this.checkSignInvalid(signInvalid) // 微信分享验证校验值 // let rs = await this.checkSignInvalid(signInvalid) // 微信分享验证校验值
// if (rs == '1') { // if (rs == '1') {
@@ -163,7 +165,11 @@ export default {
//获取腾讯人脸识别URL后重新跳回页面验证腾讯人脸识别结果成功的话调签字面板 //获取腾讯人脸识别URL后重新跳回页面验证腾讯人脸识别结果成功的话调签字面板
if (localStorage['faceAuthWeXin-requestId'] && localStorage['faceAuthWeXin-bizToken'] && this.$route.query.faceAuthCountWeixin != undefined) { if (localStorage['faceAuthWeXin-requestId'] && localStorage['faceAuthWeXin-bizToken'] && this.$route.query.faceAuthCountWeixin != undefined) {
this.getRecognitionResult(JSON.parse(localStorage['faceAuthWeXin-requestId']), JSON.parse(localStorage['faceAuthWeXin-bizToken']), JSON.parse(localStorage['orderNo'])) this.getRecognitionResult(
JSON.parse(localStorage['faceAuthWeXin-requestId']),
JSON.parse(localStorage['faceAuthWeXin-bizToken']),
JSON.parse(localStorage['orderNo'])
)
} }
this.faceAuthCount.enjoy = this.$route.query.faceAuthCountAppnt == undefined ? 0 : Number(this.$route.query.faceAuthCountAppnt) this.faceAuthCount.enjoy = this.$route.query.faceAuthCountAppnt == undefined ? 0 : Number(this.$route.query.faceAuthCountAppnt)
this.faceAuthCount.weixin = this.$route.query.faceAuthCountWeixin == undefined ? 0 : Number(this.$route.query.faceAuthCountWeixin) this.faceAuthCount.weixin = this.$route.query.faceAuthCountWeixin == undefined ? 0 : Number(this.$route.query.faceAuthCountWeixin)

View File

@@ -213,7 +213,9 @@ export default {
//从签名页调过来的标识 //从签名页调过来的标识
sessionStorage.setItem('airSign', this.$route.query.airSign) sessionStorage.setItem('airSign', this.$route.query.airSign)
} }
if (this.$route.query.token) {
localStorage.setItem('token', this.$route.query.token) localStorage.setItem('token', this.$route.query.token)
}
if (this.$route.query.signInvalid) { if (this.$route.query.signInvalid) {
sessionStorage.setItem('signInvalid', this.$route.query.signInvalid) sessionStorage.setItem('signInvalid', this.$route.query.signInvalid)
} }

View File

@@ -396,7 +396,9 @@ export default {
} }
// this.$CacheUtils.setLocItem('saleInsuredInfo', this.$route.query.saleInsuredInfo) // this.$CacheUtils.setLocItem('saleInsuredInfo', this.$route.query.saleInsuredInfo)
// window.localStorage.setItem('saleInsuredPersonInfo', this.$route.query.saleInsuredPersonInfo) // window.localStorage.setItem('saleInsuredPersonInfo', this.$route.query.saleInsuredPersonInfo)
if (this.$route.query.token) {
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token)
}
window.localStorage.setItem('orderNo', this.$route.query.orderNo) window.localStorage.setItem('orderNo', this.$route.query.orderNo)
// window.localStorage.setItem('relationToAppnt', this.$route.query.relationToAppnt) // window.localStorage.setItem('relationToAppnt', this.$route.query.relationToAppnt)
// window.localStorage.setItem('productCode', this.$route.query.productCode) // window.localStorage.setItem('productCode', this.$route.query.productCode)

View File

@@ -75,7 +75,9 @@ export default {
this.redisKey = this.$route.query.redisKey this.redisKey = this.$route.query.redisKey
if (this.redisKey) { if (this.redisKey) {
this.saveShareRecord('1') this.saveShareRecord('1')
if (this.$route.query.token) {
localStorage.setItem('token', this.$route.query.token) localStorage.setItem('token', this.$route.query.token)
}
} else { } else {
this.getShareKey() this.getShareKey()
} }
@@ -117,7 +119,7 @@ export default {
url: `${location.origin}/#/manpower/increaseStaffTools/CompanyIntroduction` url: `${location.origin}/#/manpower/increaseStaffTools/CompanyIntroduction`
} }
getShareKey(data) getShareKey(data)
.then(res => { .then((res) => {
console.log(res) console.log(res)
if (res.result == 0) { if (res.result == 0) {
this.redisKey = res.content this.redisKey = res.content
@@ -125,7 +127,7 @@ export default {
this.$toast(res.resultMessage) this.$toast(res.resultMessage)
} }
}) })
.catch(err => { .catch((err) => {
console.log(err) console.log(err)
}) })
}, },

View File

@@ -38,7 +38,9 @@ export default {
this.redisKey = this.$route.query.redisKey this.redisKey = this.$route.query.redisKey
if (this.redisKey) { if (this.redisKey) {
this.saveShareRecord('1') this.saveShareRecord('1')
if (this.$route.query.token) {
localStorage.setItem('token', this.$route.query.token) localStorage.setItem('token', this.$route.query.token)
}
} else { } else {
this.getShareKey() this.getShareKey()
} }
@@ -83,7 +85,7 @@ export default {
url: `${location.origin}/pdfjs/web/viewer.html?file=${this.pdfUrl}` url: `${location.origin}/pdfjs/web/viewer.html?file=${this.pdfUrl}`
} }
getShareKey(data) getShareKey(data)
.then(res => { .then((res) => {
console.log(res) console.log(res)
if (res.result == 0) { if (res.result == 0) {
this.redisKey = res.content this.redisKey = res.content
@@ -91,7 +93,7 @@ export default {
this.$toast(res.resultMessage) this.$toast(res.resultMessage)
} }
}) })
.catch(err => { .catch((err) => {
console.log(err) console.log(err)
}) })
}, },

View File

@@ -48,7 +48,7 @@
</div> </div>
<div v-else> <div v-else>
<template v-if="redirectUrl"> <template v-if="redirectUrl">
<iframe v-show="thirdUrlReady" style="width: 100vw; min-height: 100vh;" :src="redirectUrl" frameborder="0"></iframe> <iframe v-show="thirdUrlReady" style="width: 100vw; min-height: 100vh" :src="redirectUrl" frameborder="0"></iframe>
</template> </template>
<template v-if="detailImg"> <template v-if="detailImg">
<img id="detailImg" v-if="detailImg" :src="$assetsUrl + detailImg" /> <img id="detailImg" v-if="detailImg" :src="$assetsUrl + detailImg" />
@@ -151,7 +151,9 @@ export default {
}, },
async mounted() { async mounted() {
if (this.isWeixin) { if (this.isWeixin) {
if (this.$route.query.token) {
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token)
}
this.loginInfo.aname = decodeURI(this.$route.query.aname) this.loginInfo.aname = decodeURI(this.$route.query.aname)
this.loginInfo.password = decodeURI(this.$route.query.password) this.loginInfo.password = decodeURI(this.$route.query.password)
this.shareId = this.$route.query.shareId this.shareId = this.$route.query.shareId
@@ -162,7 +164,7 @@ export default {
}, },
methods: { methods: {
prevImg(i) { prevImg(i) {
let imgs = this.imgList.map(img => { let imgs = this.imgList.map((img) => {
return this.$assetsUrl + img return this.$assetsUrl + img
}) })
ImagePreview(imgs, i) ImagePreview(imgs, i)
@@ -259,7 +261,7 @@ export default {
//分享轨迹保存 //分享轨迹保存
saveShareTrack(data) { saveShareTrack(data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
saveShareTrack(data).then(res => { saveShareTrack(data).then((res) => {
if (res.result == '0') { if (res.result == '0') {
resolve() resolve()
} else { } else {

View File

@@ -102,12 +102,8 @@
</div> </div>
<!-- 转账不成功问题件提示框 --> <!-- 转账不成功问题件提示框 -->
<van-dialog v-model="showConfirm" title="标题" :show-confirm-button="false"> <van-dialog v-model="showConfirm" title="标题" :show-confirm-button="false">
<p style="margin: 1em;" v-if="transfer.mode === 2"> <p style="margin: 1em" v-if="transfer.mode === 2">如您选择终止转账我公司将按照承保前撤单处 请您谨慎选择</p>
如您选择终止转账我公司将按照承保前撤单处 请您谨慎选择 <p style="margin: 1em" v-if="transfer.mode === 3">变更银行账号后续期保险费如有默认使用新账 号信息进行转账支付</p>
</p>
<p style="margin: 1em;" v-if="transfer.mode === 3">
变更银行账号后续期保险费如有默认使用新账 号信息进行转账支付
</p>
<van-button type="danger" block @click="showConfirm = false">确定</van-button> <van-button type="danger" block @click="showConfirm = false">确定</van-button>
</van-dialog> </van-dialog>
</div> </div>
@@ -207,7 +203,7 @@
} }
}, },
deleteSupplementImg(file) { deleteSupplementImg(file) {
this.imageResultList = this.imageResultList.filter(result => { this.imageResultList = this.imageResultList.filter((result) => {
return result.index !== file.index return result.index !== file.index
}) })
if (this.isWeixin) { if (this.isWeixin) {
@@ -629,7 +625,9 @@
document.title = '补充资料通知书' document.title = '补充资料通知书'
} }
if (this.isWeixin) { if (this.isWeixin) {
if (this.$route.query.token) {
localStorage.setItem('token', this.$route.query.token) localStorage.setItem('token', this.$route.query.token)
}
let imgBase64Data = sessionStorage.getItem('twoimgBase64Data') let imgBase64Data = sessionStorage.getItem('twoimgBase64Data')
let signInfo = JSON.parse(localStorage.getItem('signInfo')) let signInfo = JSON.parse(localStorage.getItem('signInfo'))

View File

@@ -696,7 +696,9 @@ export default {
if (this.$route.query.airSign) { if (this.$route.query.airSign) {
sessionStorage.setItem('airSign', this.$route.query.airSign) sessionStorage.setItem('airSign', this.$route.query.airSign)
} }
if (this.$route.query.token) {
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token)
}
window.localStorage.setItem('orderNo', this.$route.query.orderNo) window.localStorage.setItem('orderNo', this.$route.query.orderNo)
if (this.$route.query.changeCard == '0') { if (this.$route.query.changeCard == '0') {
localStorage.setItem('changeCard', true) localStorage.setItem('changeCard', true)

View File

@@ -315,7 +315,9 @@ export default {
this.$CacheUtils.setLocItem('saleInsuredInfo', this.$route.query.saleInsuredInfo) this.$CacheUtils.setLocItem('saleInsuredInfo', this.$route.query.saleInsuredInfo)
this.$CacheUtils.setLocItem('saleInsuredPersonInfo', this.$route.query.saleInsuredPersonInfo) this.$CacheUtils.setLocItem('saleInsuredPersonInfo', this.$route.query.saleInsuredPersonInfo)
if (this.$route.query.token) {
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token)
}
window.localStorage.setItem('orderNo', this.$route.query.orderNo) window.localStorage.setItem('orderNo', this.$route.query.orderNo)
window.localStorage.setItem('relationToAppnt', this.$route.query.relationToAppnt) window.localStorage.setItem('relationToAppnt', this.$route.query.relationToAppnt)
if (this.$route.query.signInvalid) { if (this.$route.query.signInvalid) {

View File

@@ -18,7 +18,12 @@
}}</van-button> }}</van-button>
</van-cell-group> </van-cell-group>
</van-dialog> </van-dialog>
<UploadImageFile :typeface="idcardData.typeface && (faceAuthCount.weixin < smsAuthNum)" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage"> <UploadImageFile
:typeface="idcardData.typeface && faceAuthCount.weixin < smsAuthNum"
:realName="idcardData.idcardName"
:idno="idcardData.idcardNumber"
@sendimage="sendimage"
>
</UploadImageFile> </UploadImageFile>
<div class="p60"> <div class="p60">
<van-button type="danger" @click="uploadComparison" size="large">上传照片与证件照对比</van-button> <van-button type="danger" @click="uploadComparison" size="large">上传照片与证件照对比</van-button>
@@ -82,7 +87,9 @@ export default {
created() { created() {
if (this.isWeixin) { if (this.isWeixin) {
this.$CacheUtils.setLocItem('saleInsuredInfo', this.$route.query.saleInsuredInfo) this.$CacheUtils.setLocItem('saleInsuredInfo', this.$route.query.saleInsuredInfo)
if (this.$route.query.token) {
window.localStorage.setItem('token', this.$route.query.token) window.localStorage.setItem('token', this.$route.query.token)
}
window.localStorage.setItem('policyNo', this.$route.query.policyNo) window.localStorage.setItem('policyNo', this.$route.query.policyNo)
this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name
this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredInfo).idNo this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredInfo).idNo
@@ -120,7 +127,7 @@ export default {
operateCode: this.customerMobile, operateCode: this.customerMobile,
system: 'agentApp', system: 'agentApp',
operateCodeType: '0' operateCodeType: '0'
}).then(res => { }).then((res) => {
console.log(res) console.log(res)
if (res.result == 0) { if (res.result == 0) {
this.sid = res.sessionId this.sid = res.sessionId
@@ -178,7 +185,7 @@ export default {
this.authCode = null this.authCode = null
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
checkPhone(data).then(res => { checkPhone(data).then((res) => {
if (res.result == '0') { if (res.result == '0') {
console.log(res) console.log(res)
this.show = true this.show = true
@@ -203,7 +210,7 @@ export default {
if (e) { if (e) {
that.disabled = false that.disabled = false
} else { } else {
this.faceAuthCount.weixin++; this.faceAuthCount.weixin++
if (this.faceAuthCount.weixin >= this.smsAuthNum) { if (this.faceAuthCount.weixin >= this.smsAuthNum) {
this.realPeopelCheck() this.realPeopelCheck()
} }
@@ -219,7 +226,7 @@ export default {
}, },
//根据数据字典 将后端返回的数据渲染到页面中 //根据数据字典 将后端返回的数据渲染到页面中
filterData(dictionary, key, pageData) { filterData(dictionary, key, pageData) {
dictionary.forEach(item => { dictionary.forEach((item) => {
if (pageData[key] == item.id) { if (pageData[key] == item.id) {
pageData[key + 'Text'] = item.text //渲染页面使用的字段 pageData[key + 'Text'] = item.text //渲染页面使用的字段
} }
@@ -231,7 +238,7 @@ export default {
let data = { let data = {
policyNo: this.$route.query.policyNo policyNo: this.$route.query.policyNo
} }
getPolicyDetail(data).then(res => { getPolicyDetail(data).then((res) => {
if (res.result == '0') { if (res.result == '0') {
let appntDTO = res.content.appntDTO let appntDTO = res.content.appntDTO
let orderInfoDTO = res.content.orderInfoDTO let orderInfoDTO = res.content.orderInfoDTO
@@ -249,8 +256,8 @@ export default {
this.filterData(dataDictionary.idType, 'idType', appntDTO) this.filterData(dataDictionary.idType, 'idType', appntDTO)
that.appntDTO = appntDTO that.appntDTO = appntDTO
// 被保险人信息 // 被保险人信息
res.content.insuredDTOs.map(insured => { res.content.insuredDTOs.map((insured) => {
insured.riskDTOLst.map(risk => { insured.riskDTOLst.map((risk) => {
Number(risk.payIntv) Number(risk.payIntv)
switch (risk.payIntv) { switch (risk.payIntv) {
case -1: case -1:
@@ -287,7 +294,7 @@ export default {
this.filterData(dataDictionary.sex, 'sex', insured) this.filterData(dataDictionary.sex, 'sex', insured)
this.filterData(dataDictionary.idType, 'idType', insured) this.filterData(dataDictionary.idType, 'idType', insured)
this.filterData(dataDictionary.relationToAppnt, 'relation', insured) this.filterData(dataDictionary.relationToAppnt, 'relation', insured)
insured.bnfDTOs.map(bnf => { insured.bnfDTOs.map((bnf) => {
this.filterData(dataDictionary.bnfType, 'bnfType', bnf) this.filterData(dataDictionary.bnfType, 'bnfType', bnf)
this.filterData(dataDictionary.sex, 'sex', bnf) this.filterData(dataDictionary.sex, 'sex', bnf)
this.filterData(dataDictionary.idType, 'idType', bnf) this.filterData(dataDictionary.idType, 'idType', bnf)
@@ -307,7 +314,7 @@ export default {
let params = { let params = {
contNo: this.$route.query.policyNo contNo: this.$route.query.policyNo
} }
getReceiptSign(params).then(res => { getReceiptSign(params).then((res) => {
if (res.result == '0') { if (res.result == '0') {
console.log('res', res) console.log('res', res)
this.$toast.clear() this.$toast.clear()