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,45 +1035,50 @@ export default {
// 认证入口
async certification () {
let vm = this
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'
let param = {
bp_id: window.localStorage.bp_id,
}
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then((result) => {
hlsPopup.hideLoading()
if (result.result === 'S') {
let data = result.lists[0]
cordova.plugins.IdCardPlugin.idCardIdentify(
{
idNum: data.id_card_no,
idName: data.bp_name,
phoneNum: window.localStorage.user_phone,
},
function (suc) {
let success = JSON.parse(suc)
if (success.code === 1) {
vm.getNpCertificationUrl()
}
},
function (reason) {
let error = JSON.parse(reason)
vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
}
)
} else {
vm.hlsPopup.showLongCenter(result.message)
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'
let param = {
bp_id: window.localStorage.bp_id,
}
})
} else if (vm.bp_identity === 'ORG_NO') {
hlsPopup.showLongCenter('APP端不支持认证企业账号,请移步PC端操作')
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then((result) => {
hlsPopup.hideLoading()
if (result.result === 'S') {
let data = result.lists[0]
cordova.plugins.IdCardPlugin.idCardIdentify(
{
idNum: data.id_card_no,
idName: data.bp_name,
phoneNum: window.localStorage.user_phone,
},
function (suc) {
let success = JSON.parse(suc)
if (success.code === 1) {
vm.userQuery()
}
},
function (reason) {
let error = JSON.parse(reason)
vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
}
)
} else {
vm.hlsPopup.showLongCenter(result.message)
}
})
} else if (vm.bp_identity === 'ORG_NO') {
hlsPopup.showLongCenter('APP端不支持认证企业账号,请移步PC端操作')
} else {
hlsPopup.showLongCenter('您已认证通过')
}
} else {
hlsPopup.showLongCenter('您已认证通过')
hlsPopup.showLongCenter('请先进行用户绑定!')
}
} else {
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