Commit f4384277 authored by Jennie Shi's avatar Jennie Shi

认证逻辑修改

parent 3185e20c
......@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
appId: '"com.xcmg.app.dev"',
currentVersion: '"2.9.3"'
currentVersion: '"2.9.4"'
}
......@@ -229,6 +229,7 @@ export default {
bp_type_n: '',
approveBtn: false,
elecStatus: false,
authFlag: false,
roleSwitchFlag: false, // 选择角色模态框显示标志
multiRoleList: [], // 查到的多角色
type: [
......@@ -1034,6 +1035,8 @@ export default {
// 认证入口
async certification () {
let vm = this
let authFlag = await vm.getNpCertificationUrl()
if (authFlag === true) {
if (vm.bp_id) {
if (vm.bp_identity === 'NP_NO' || vm.bp_identity === 'ORG_L_NO' || vm.bp_identity === 'ORG_AUTH_NO') {
let url = process.env.basePath + 'bp_query'
......@@ -1054,7 +1057,7 @@ export default {
function (suc) {
let success = JSON.parse(suc)
if (success.code === 1) {
vm.getNpCertificationUrl()
vm.userQuery()
}
},
function (reason) {
......@@ -1072,7 +1075,10 @@ export default {
hlsPopup.showLongCenter('您已认证通过')
}
} else {
hlsPopup.showLongCenter('请先进行用户绑定')
hlsPopup.showLongCenter('请先进行用户绑定!')
}
} else if (authFlag === false) {
hlsPopup.showLongCenter('用户已绑定!')
}
},
async getNpCertificationUrl () {
......@@ -1085,14 +1091,37 @@ export default {
let res = await vm.$post(url, param)
hlsPopup.hideLoading()
if (res.info.code === 0 && res.info.data.authUrl) {
hlsPopup.showLongCenter('绑定失败!')
// hlsPopup.showLongCenter('绑定失败!')
return true
} else if (res.info.code === 0 && res.info.data.openId) {
// hlsPopup.showLongCenter('绑定成功!')
// vm.userQuery()
return false
} else {
hlsPopup.showLongCenter(res.info.msg)
return ''
}
},
// 获取企业认证url
async getOrgCertificationUrl () {
let vm = this
let url = $config.basePath + 'auth_company_sign'
let param = {
phone: vm.user_phone,
}
hlsPopup.showLoading('请稍候')
let res = await vm.$post(url, param)
hlsPopup.hideLoading()
if ((res.info.code === 0) && (res.info.data.authUrl)) {
hlsPopup.showLongCenter('绑定失败!')
} else if ((res.info.code === 0) && (res.info.data.openId)) {
hlsPopup.showLongCenter('绑定成功!')
vm.userQuery()
} else {
hlsPopup.showLongCenter(res.info.msg)
hlsPopup.showError(res.info.msg)
}
},
goAbout () {
this.$router.push({
name: 'About',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment