diff --git a/src/api/ebiz/common/common.js b/src/api/ebiz/common/common.js index 95c52828d..7a3037c9f 100644 --- a/src/api/ebiz/common/common.js +++ b/src/api/ebiz/common/common.js @@ -62,3 +62,21 @@ export function wxShare(data) { data }) } + +//验证代理人访问 +export function checkEnterPower(data) { + return request({ + url: getUrl('/customer/agent/checkEnterPower', 1), + method: 'post', + data + }) +} + +// 获取验证码 +export function getAuthCode(data) { + return request({ + url: getUrl('/customer/authcode/loginedSend', 1), + method: 'post', + data + }) +} diff --git a/src/assets/js/utils/request.js b/src/assets/js/utils/request.js index b46581a91..915ead64b 100644 --- a/src/assets/js/utils/request.js +++ b/src/assets/js/utils/request.js @@ -131,7 +131,7 @@ service.interceptors.request.use( /** * 请求拦截处理(待添加 判断走统一网关处理) */ - if (config.url && /api\/$/.test(config.url.split(configApp.API_VERSION)[0])) { + if (configApp.API_VERSION == 'v2' && config.url && /api\/$/.test(config.url.split(configApp.API_VERSION)[0])) { if (!config.data || config.data == null) { config.data = {} } @@ -163,6 +163,7 @@ service.interceptors.response.use( console.log('----------------') let res = response.data if ( + configApp.API_VERSION == 'v2' && response.config.url && response.headers['content-type'].match(/application\/json/) && /api\/$/.test(response.config.url.split(configApp.API_VERSION)[0]) diff --git a/src/assets/js/utils/request1.js b/src/assets/js/utils/request1.js index 8d9a1bd0f..d7af9379c 100644 --- a/src/assets/js/utils/request1.js +++ b/src/assets/js/utils/request1.js @@ -31,7 +31,7 @@ service.interceptors.request.use( /** * 请求拦截处理(待添加 判断走统一网关处理) */ - if(config.url && /api\/$/.test(config.url.split(configApp.API_VERSION)[0])){ + if(config.url && /api\/$/.test(config.url.split(configApp.API_VERSION)[0]) && configApp.API_VERSION == 'v2'){ if(!config.data || config.data == null){ config.data = {} } @@ -62,7 +62,7 @@ service.interceptors.response.use( console.log(response) console.log('----------------') let res = response.data - if(response.config.url && response.headers['content-type'].match(/application\/json/) && /api\/$/.test(response.config.url.split(configApp.API_VERSION)[0])){ + if( configApp.API_VERSION == 'v2' && response.config.url && response.headers['content-type'].match(/application\/json/) && /api\/$/.test(response.config.url.split(configApp.API_VERSION)[0])){ if(res.response){// 正常情況返回必有response 节点 console.log("[调用请求解密服务][请求地址:"+response.config.url+"][解密前报文:]",JSON.stringify(res.response)) res = JSON.parse(AESTools.AESDecrypt(res.response,configApp.REQ_PWD)) diff --git a/src/components/ebiz/manpower/UserInfoHeader.vue b/src/components/ebiz/manpower/UserInfoHeader.vue index 6e57044fc..aa88ab502 100644 --- a/src/components/ebiz/manpower/UserInfoHeader.vue +++ b/src/components/ebiz/manpower/UserInfoHeader.vue @@ -3,8 +3,8 @@
-

{{ userInfo.name }}

-
工号 | {{ userInfo.jobNo }}
+

{{ userInfo.encryptionName }}

+
工号 | {{ userInfo.encryptionJobNo }}
diff --git a/src/views/ebiz/customer/customerList.vue b/src/views/ebiz/customer/customerList.vue index 1602ac38c..41ad806d7 100644 --- a/src/views/ebiz/customer/customerList.vue +++ b/src/views/ebiz/customer/customerList.vue @@ -84,12 +84,24 @@
  • 取消
  • + + + +

    为确保是您本人操作,短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }},请您输入验证码以完成后续操作。

    + + + {{ + checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码' + }} + +
    diff --git a/src/views/ebiz/manpower/Training.vue b/src/views/ebiz/manpower/Training.vue index 7f40a13eb..e4e32392e 100644 --- a/src/views/ebiz/manpower/Training.vue +++ b/src/views/ebiz/manpower/Training.vue @@ -4,6 +4,17 @@ + + + +

    为确保是您本人操作,短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }},请您输入验证码以完成后续操作。

    + + + {{ + checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码' + }} + +
    @@ -11,19 +22,32 @@ import UserInfoHeader from '@/components/ebiz/manpower/UserInfoHeader' import NavItem from '@/components/ebiz/manpower/NavItem' import record from '@/assets/images/u73803.png' -import { CellGroup } from 'vant' - +import { CellGroup, Cell, Button, Dialog, Field } from 'vant' import { getTokenForUserModel } from '@/api/ebiz/manpower/manpower' +import { checkEnterPower, getAuthCode } from '@/api/ebiz/common/common' export default { name: 'Navigation', components: { [UserInfoHeader.name]: UserInfoHeader, [NavItem.name]: NavItem, - [CellGroup.name]: CellGroup + [CellGroup.name]: CellGroup, + [Cell.name]: Cell, + [Button.name]: Button, + [Field.name]: Field, + [Dialog.name]: Dialog }, data() { return { + checkModel: { + show: false, + authCode: '', + smsId: '', + mobile: localStorage.mobile, + timeId: null, // 计时器ID + countDown: 60, // 倒计时 + codeDisabled: false // 获取验证码按钮是否禁用 + }, active: 0, navList: [ { @@ -47,7 +71,6 @@ export default { } }, created() { - this.getInfo() setTimeout(() => { // eslint-disable-next-line no-undef EWebBridge.webCallAppInJs('webview_left_button', { @@ -55,6 +78,12 @@ export default { }) }, 100) window.appCallBack = this.appCallBack + this.checkModelEnterValidate() + }, + filters: { + encryCheckModelMobile(code) { + return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2') + } }, methods: { appCallBack(data) { @@ -64,6 +93,77 @@ export default { }) } }, + async checkModelEnterValidate() { + let checkModelResult = await checkEnterPower({ operateType: 'isEnter' }) + if (checkModelResult.result == 0) { + if (checkModelResult.enterFlag == '0') { + this.getInfo() + } else { + this.checkModel.show = true + } + } else { + this.$toast(checkModelResult.resultMessage) + } + }, + async checkModelConfirm() { + if (!this.checkModel.codeDisabled) { + this.checkModel.show = true + return this.$toast('请先获取验证码') + } + if (!this.checkModel.authCode || this.checkModel.authCode == '') { + this.checkModel.show = true + return this.$toast('请输入短信验证码') + } + if (this.checkModel.authCode.length !== 6) { + this.checkModel.show = true + return this.$toast('验证码格式错误') + } + let that = this + let checkModelResult = await checkEnterPower({ operateType: 'validateSms', smsId: that.checkModel.smsId, code: that.checkModel.authCode }) + if (checkModelResult.result == 0) { + this.checkModel.show = false + this.getInfo() + } else { + this.checkModel.show = false + this.checkModel.codeDisabled = true + window.clearInterval(this.checkModel.timeId) + this.$toast(checkModelResult.resultMessage) + } + }, + checkModelCancel() { + // 跳转首页 + this.$jump({ + flag: 'home' + }) + }, + checkModelGetCode() { + this.checkModel.codeDisabled = true + let data = { + operateType: 'agentValidateEnter', + type: 'H5', + operateCode: this.checkModel.mobile, + system: 'agentApp', + operateCodeType: '0' + } + //获取验证码 + getAuthCode(data).then(res => { + if (res.result == 0) { + this.checkModel.smsId = res.sessionId + this.checkModel.smsCode = null + //倒计时 + this.checkModel.timeId = setInterval(() => { + this.checkModel.countDown-- + if (this.checkModel.countDown <= 0) { + window.clearInterval(this.checkModel.timeId) + this.checkModel.codeDisabled = false + this.checkModel.countDown = 60 + } + }, 1000) + } else { + this.$toast(res.resultMessage) + } + }) + }, async getInfo() { const res = await getTokenForUserModel() if (res.result == 0) { diff --git a/src/views/ebiz/sale/List.vue b/src/views/ebiz/sale/List.vue index 19d554d57..01940f4b0 100644 --- a/src/views/ebiz/sale/List.vue +++ b/src/views/ebiz/sale/List.vue @@ -170,6 +170,17 @@ + + + +

    为确保是您本人操作,短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }},请您输入验证码以完成后续操作。

    + + + {{ + checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码' + }} + +
    @@ -177,8 +188,8 @@ import { Search, Tabs, Tab, List, Tag, Sticky, Toast, Dialog, Field } from 'vant' import { orderList, deleteOrderInfo, revokeOrder } from '@/api/ebiz/sale/sale' import { formatRiskList } from '@/assets/js/utils/formatRiskList.js' +import { getAuthCode, checkEnterPower } from '@/api/ebiz/common/common' import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级 -import { getAuthCode } from '@/api/ebiz/sale/sale' export default { name: 'saleList', @@ -194,6 +205,15 @@ export default { }, data() { return { + checkModel: { + show: false, + authCode: '', + smsId: '', + mobile: localStorage.mobile, + timeId: null, // 计时器ID + countDown: 60, // 倒计时 + codeDisabled: false // 获取验证码按钮是否禁用 + }, searchName: '', active: 'uncommit', //uncommit 表示未提交 commit表示已提交 saleList: [], @@ -232,7 +252,7 @@ export default { }) }, 100) window.appCallBack = this.appCallBack - this.loadMore() + this.checkModelEnterValidate() }, methods: { beforeClose(action, done) { @@ -305,6 +325,77 @@ export default { this.captchaMaped = false this.captchaReceiver = '' }, + async checkModelEnterValidate() { + let checkModelResult = await checkEnterPower({ operateType: 'isEnter' }) + if (checkModelResult.result == 0) { + if (checkModelResult.enterFlag == '0') { + this.loadMore() + } else { + this.checkModel.show = true + } + } else { + this.$toast(checkModelResult.resultMessage) + } + }, + async checkModelConfirm() { + if (!this.checkModel.codeDisabled) { + this.checkModel.show = true + return this.$toast('请先获取验证码') + } + if (!this.checkModel.authCode || this.checkModel.authCode == '') { + this.checkModel.show = true + return this.$toast('请输入短信验证码') + } + if (this.checkModel.authCode.length !== 6) { + this.checkModel.show = true + return this.$toast('验证码格式错误') + } + let that = this + let checkModelResult = await checkEnterPower({ operateType: 'validateSms', smsId: that.checkModel.smsId, code: that.checkModel.authCode }) + if (checkModelResult.result == 0) { + this.checkModel.show = false + that.loadMore() + } else { + this.checkModel.show = false + this.checkModel.codeDisabled = true + window.clearInterval(this.checkModel.timeId) + this.$toast(checkModelResult.resultMessage) + } + }, + checkModelCancel() { + // 跳转首页 + this.$jump({ + flag: 'home' + }) + }, + checkModelGetCode() { + this.checkModel.codeDisabled = true + let data = { + operateType: 'agentValidateEnter', + type: 'H5', + operateCode: this.checkModel.mobile, + system: 'agentApp', + operateCodeType: '0' + } + //获取验证码 + getAuthCode(data).then(res => { + if (res.result == 0) { + this.checkModel.smsId = res.sessionId + this.checkModel.smsCode = null + //倒计时 + this.checkModel.timeId = setInterval(() => { + this.checkModel.countDown-- + if (this.checkModel.countDown <= 0) { + window.clearInterval(this.checkModel.timeId) + this.checkModel.codeDisabled = false + this.checkModel.countDown = 60 + } + }, 1000) + } else { + this.$toast(res.resultMessage) + } + }) + }, appCallBack(data) { if (data.trigger == 'left_button_click') { this.$jump({ @@ -622,6 +713,9 @@ export default { } }, filters: { + encryCheckModelMobile(code) { + return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2') + }, phoneNumFilter(phoneNum) { let num = phoneNum.split('') num.splice(3, 4, '****')