Merge branch 'feature/GFRS-1991【待确定】APP检测结果优化-整理' into dev

# Conflicts:
#	src/assets/js/utils/request.js
#	src/views/ebiz/manpower/Training.vue
#	src/views/ebiz/sale/List.vue
This commit is contained in:
yang.huaxiang
2020-11-14 15:39:49 +08:00
8 changed files with 429 additions and 17 deletions

View File

@@ -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
})
}

View File

@@ -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])

View File

@@ -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))

View File

@@ -3,8 +3,8 @@
<div class="user-info flex p15 bg-head align-items-e">
<img class="w40" src="../../../assets/images/bnf_avatar.png" />
<div class="add-list flex1 ml10">
<p class="fs16 font-bold">{{ userInfo.name }}</p>
<div class="">工号 | {{ userInfo.jobNo }}</div>
<p class="fs16 font-bold">{{ userInfo.encryptionName }}</p>
<div class="">工号 | {{ userInfo.encryptionJobNo }}</div>
</div>
</div>
</template>

View File

@@ -84,12 +84,24 @@
<li @click="close">取消</li>
</ul>
</van-popup>
<!-- 短信验证 -->
<van-dialog v-model="checkModel.show" title="提示" show-cancel-button @confirm="checkModelConfirm" @cancel="checkModelCancel">
<p class="p10 fs14">为确保是您本人操作短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }}请您输入验证码以完成后续操作</p>
<van-cell-group class="flex align-items-c pr5 mb15">
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="checkModel.authCode" clearable label-width="0" />
<van-button type="danger" plain size="small" class="w160 p0" @click="checkModelGetCode" :disabled="checkModel.codeDisabled" v-no-more-click="2000">{{
checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码'
}}</van-button>
</van-cell-group>
</van-dialog>
</div>
</template>
<script>
import { Search, Cell, IndexBar, IndexAnchor, Popup, Button, Tag } from 'vant'
import { Search, Cell, IndexBar, IndexAnchor, Popup, Button, Tag, Dialog, Field } from 'vant'
import { getCustomersList } from '@/api/ebiz/customer/customer'
import { checkEnterPower, getAuthCode } from '@/api/ebiz/common/common'
export default {
name: 'login',
components: {
@@ -99,10 +111,21 @@ export default {
[IndexAnchor.name]: IndexAnchor,
[Popup.name]: Popup,
[Button.name]: Button,
[Field.name]: Field,
[Dialog.name]: Dialog,
[Tag.name]: Tag
},
data() {
return {
checkModel: {
show: false,
authCode: '',
smsId: '',
mobile: localStorage.mobile,
timeId: null, // 计时器ID
countDown: 60, // 倒计时
codeDisabled: false // 获取验证码按钮是否禁用
},
searchVal: '',
show1: false,
show2: false,
@@ -150,13 +173,16 @@ export default {
}
},
mounted() {
this.getCustomerList() //客户列表查询
setTimeout(() => {
this.filterBtn() // 初始化显示按钮
window.appCallBack = this.appCallBack //app回调
}, 1000)
this.checkModelEnterValidate()
},
filters: {
encryCheckModelMobile(code) {
return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
},
toCustomer(value) {
if (value == 0) {
return (value = '准客户')
@@ -166,6 +192,77 @@ export default {
}
},
methods: {
async checkModelEnterValidate() {
let checkModelResult = await checkEnterPower({ operateType: 'isEnter' })
if (checkModelResult.result == 0) {
if (checkModelResult.enterFlag == '0') {
this.getCustomerList() //客户列表查询
} 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.getCustomerList() //客户列表查询
} 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)
}
})
},
filterBtn() {
// 筛选按钮的显示
EWebBridge.webCallAppInJs('webview_right_button', {

View File

@@ -4,23 +4,46 @@
<van-cell-group>
<NavItem v-for="(item, index) of navList" :key="index" :config="item" />
</van-cell-group>
<!-- 短信验证 -->
<van-dialog v-model="checkModel.show" title="提示" show-cancel-button @confirm="checkModelConfirm" @cancel="checkModelCancel">
<p class="p10 fs14">为确保是您本人操作短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }}请您输入验证码以完成后续操作</p>
<van-cell-group class="flex align-items-c pr5 mb15">
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="checkModel.authCode" clearable label-width="0" />
<van-button type="danger" plain size="small" class="w160 p0" @click="checkModelGetCode" :disabled="checkModel.codeDisabled" v-no-more-click="2000">{{
checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码'
}}</van-button>
</van-cell-group>
</van-dialog>
</div>
</template>
<script>
import UserInfoHeader from '@/components/ebiz/manpower/UserInfoHeader'
import NavItem from '@/components/ebiz/manpower/NavItem'
import { CellGroup } from 'vant'
import { CellGroup, Cell, Button, Dialog, Field } from 'vant'
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: [
{
@@ -46,7 +69,86 @@ export default {
]
}
},
methods: {}
mounted() {
this.checkModelEnterValidate()
},
filters: {
encryCheckModelMobile(code) {
return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
}
},
methods: {
async checkModelEnterValidate() {
let checkModelResult = await checkEnterPower({ operateType: 'isEnter' })
if (checkModelResult.result == 0) {
if (checkModelResult.enterFlag == '0') {
this.checkModel.show = false
} 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
} 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)
}
})
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@@ -4,6 +4,17 @@
<van-cell-group>
<NavItem v-for="(item, index) of navList" :key="index" :config="item" />
</van-cell-group>
<!-- 短信验证 -->
<van-dialog v-model="checkModel.show" title="提示" show-cancel-button @confirm="checkModelConfirm" @cancel="checkModelCancel">
<p class="p10 fs14">为确保是您本人操作短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }}请您输入验证码以完成后续操作</p>
<van-cell-group class="flex align-items-c pr5 mb15">
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="checkModel.authCode" clearable label-width="0" />
<van-button type="danger" plain size="small" class="w160 p0" @click="checkModelGetCode" :disabled="checkModel.codeDisabled" v-no-more-click="2000">{{
checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码'
}}</van-button>
</van-cell-group>
</van-dialog>
</div>
</template>
@@ -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) {

View File

@@ -170,6 +170,17 @@
</template>
</van-field>
</van-dialog>
<!-- 短信验证 -->
<van-dialog v-model="checkModel.show" title="提示" show-cancel-button @confirm="checkModelConfirm" @cancel="checkModelCancel">
<p class="p10 fs14">为确保是您本人操作短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }}请您输入验证码以完成后续操作</p>
<van-cell-group class="flex align-items-c pr5 mb15">
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="checkModel.authCode" clearable label-width="0" />
<van-button type="danger" plain size="small" class="w160 p0" @click="checkModelGetCode" :disabled="checkModel.codeDisabled" v-no-more-click="2000">{{
checkModel.codeDisabled ? `${checkModel.countDown}s后重新获取` : '获取验证码'
}}</van-button>
</van-cell-group>
</van-dialog>
</div>
</template>
@@ -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, '****')