Commit f4384277 authored by Jennie Shi's avatar Jennie Shi

认证逻辑修改

parent 3185e20c
...@@ -11,5 +11,5 @@ module.exports = { ...@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://180.104.121.66:8088/r/api"', ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="', fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
appId: '"com.xcmg.app.dev"', appId: '"com.xcmg.app.dev"',
currentVersion: '"2.9.3"' currentVersion: '"2.9.4"'
} }
...@@ -229,6 +229,7 @@ export default { ...@@ -229,6 +229,7 @@ export default {
bp_type_n: '', bp_type_n: '',
approveBtn: false, approveBtn: false,
elecStatus: false, elecStatus: false,
authFlag: false,
roleSwitchFlag: false, // 选择角色模态框显示标志 roleSwitchFlag: false, // 选择角色模态框显示标志
multiRoleList: [], // 查到的多角色 multiRoleList: [], // 查到的多角色
type: [ type: [
...@@ -1034,45 +1035,50 @@ export default { ...@@ -1034,45 +1035,50 @@ export default {
// 认证入口 // 认证入口
async certification () { async certification () {
let vm = this let vm = this
if (vm.bp_id) { let authFlag = await vm.getNpCertificationUrl()
if (vm.bp_identity === 'NP_NO' || vm.bp_identity === 'ORG_L_NO' || vm.bp_identity === 'ORG_AUTH_NO') { if (authFlag === true) {
let url = process.env.basePath + 'bp_query' if (vm.bp_id) {
let param = { if (vm.bp_identity === 'NP_NO' || vm.bp_identity === 'ORG_L_NO' || vm.bp_identity === 'ORG_AUTH_NO') {
bp_id: window.localStorage.bp_id, let url = process.env.basePath + 'bp_query'
} let param = {
hlsPopup.showLoading('请稍候') bp_id: window.localStorage.bp_id,
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)
} }
}) hlsPopup.showLoading('请稍候')
} else if (vm.bp_identity === 'ORG_NO') { vm.hlsHttp.post(url, param).then((result) => {
hlsPopup.showLongCenter('APP端不支持认证企业账号,请移步PC端操作') 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 { } else {
hlsPopup.showLongCenter('您已认证通过') hlsPopup.showLongCenter('请先进行用户绑定!')
} }
} else { } else if (authFlag === false) {
hlsPopup.showLongCenter('请先进行用户绑定') hlsPopup.showLongCenter('用户已绑定!')
} }
}, },
async getNpCertificationUrl () { async getNpCertificationUrl () {
...@@ -1085,14 +1091,37 @@ export default { ...@@ -1085,14 +1091,37 @@ export default {
let res = await vm.$post(url, param) let res = await vm.$post(url, param)
hlsPopup.hideLoading() hlsPopup.hideLoading()
if (res.info.code === 0 && res.info.data.authUrl) { 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) { } 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('绑定成功!') hlsPopup.showLongCenter('绑定成功!')
vm.userQuery() vm.userQuery()
} else { } else {
hlsPopup.showLongCenter(res.info.msg) hlsPopup.showError(res.info.msg)
} }
}, },
goAbout () { goAbout () {
this.$router.push({ this.$router.push({
name: 'About', 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