mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-22 19:56:43 +08:00
安全性问题处理:添加页面访问校验组件抽出 --提交人:阳华祥
This commit is contained in:
200
src/components/common/CheckAgent.vue
Normal file
200
src/components/common/CheckAgent.vue
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 短信验证 -->
|
||||||
|
<van-dialog
|
||||||
|
v-model="checkModel.show"
|
||||||
|
title="提示"
|
||||||
|
show-cancel-button
|
||||||
|
@confirm="checkModelConfirm"
|
||||||
|
@cancel="checkModelCancel"
|
||||||
|
:before-close="checkModelBeforeClose"
|
||||||
|
>
|
||||||
|
<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>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { Search, Cell, IndexBar, IndexAnchor, Popup, Button, Tag, Dialog, Field } from 'vant'
|
||||||
|
import { checkEnterPower, getAuthCode, getCheckModelAgentInfo } from '@/api/ebiz/common/common'
|
||||||
|
export default {
|
||||||
|
name: 'CheckAgent',
|
||||||
|
props: {},
|
||||||
|
components: {
|
||||||
|
[Search.name]: Search,
|
||||||
|
[Cell.name]: Cell,
|
||||||
|
[IndexBar.name]: IndexBar,
|
||||||
|
[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: '',
|
||||||
|
timeId: null, // 计时器ID
|
||||||
|
countDown: 60, // 倒计时
|
||||||
|
codeDisabled: false // 获取验证码按钮是否禁用
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
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') {
|
||||||
|
// 已校验过 触发成功事件
|
||||||
|
let that = this
|
||||||
|
this.$emit('checModelSuccessMethod', that.checkModel.show)
|
||||||
|
} else {
|
||||||
|
this.checkModelFilter()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$toast(checkModelResult.resultMessage)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//弹窗关闭提示
|
||||||
|
checkModelBeforeClose(action, done) {
|
||||||
|
if (action === 'confirm' && !this.checkModel.show) {
|
||||||
|
setTimeout(done, 1000)
|
||||||
|
} else {
|
||||||
|
done(false)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 内外勤处理
|
||||||
|
async checkModelFilter() {
|
||||||
|
const agentInfoRes = await getCheckModelAgentInfo({})
|
||||||
|
if (agentInfoRes.result == 0) {
|
||||||
|
if (!/^N{1}/.test(agentInfoRes.branchType)) {
|
||||||
|
this.checkModel.mobile = agentInfoRes.phoneNo
|
||||||
|
this.checkModel.show = true
|
||||||
|
} else {
|
||||||
|
// 已校验过 触发成功事件
|
||||||
|
this.checkModel.show = false
|
||||||
|
let that = this
|
||||||
|
this.$emit('checModelSuccessMethod', that.checkModel.show)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$toast(agentInfoRes.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
|
||||||
|
let that = this
|
||||||
|
this.$emit('checModelSuccessMethod', that.checkModel.show)
|
||||||
|
} else {
|
||||||
|
this.checkModel.show = true
|
||||||
|
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>
|
||||||
|
.index-bar {
|
||||||
|
display: flex;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 15px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index-bar li {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index-bar::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.index-bar span,
|
||||||
|
.index-bar van-icon {
|
||||||
|
align-items: flex-center;
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
color: #e9332e;
|
||||||
|
}
|
||||||
|
.activeline {
|
||||||
|
background: #e9332e;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -84,34 +84,19 @@
|
|||||||
<li @click="close">取消</li>
|
<li @click="close">取消</li>
|
||||||
</ul>
|
</ul>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
<check-agent @checModelSuccessMethod="initThisPage" />
|
||||||
<!-- 短信验证 -->
|
|
||||||
<van-dialog
|
|
||||||
v-model="checkModel.show"
|
|
||||||
title="提示"
|
|
||||||
show-cancel-button
|
|
||||||
@confirm="checkModelConfirm"
|
|
||||||
@cancel="checkModelCancel"
|
|
||||||
:before-close="checkModelBeforeClose"
|
|
||||||
>
|
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Search, Cell, IndexBar, IndexAnchor, Popup, Button, Tag, Dialog, Field } from 'vant'
|
import { Search, Cell, IndexBar, IndexAnchor, Popup, Button, Tag, Dialog, Field } from 'vant'
|
||||||
import { getCustomersList } from '@/api/ebiz/customer/customer'
|
import { getCustomersList } from '@/api/ebiz/customer/customer'
|
||||||
import { checkEnterPower, getAuthCode, getCheckModelAgentInfo} from '@/api/ebiz/common/common'
|
import CheckAgent from '@/components/common/CheckAgent'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'login',
|
name: 'login',
|
||||||
components: {
|
components: {
|
||||||
|
[CheckAgent.name]: CheckAgent,
|
||||||
[Search.name]: Search,
|
[Search.name]: Search,
|
||||||
[Cell.name]: Cell,
|
[Cell.name]: Cell,
|
||||||
[IndexBar.name]: IndexBar,
|
[IndexBar.name]: IndexBar,
|
||||||
@@ -124,15 +109,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checkModel: {
|
|
||||||
show: false,
|
|
||||||
authCode: '',
|
|
||||||
smsId: '',
|
|
||||||
mobile: '',
|
|
||||||
timeId: null, // 计时器ID
|
|
||||||
countDown: 60, // 倒计时
|
|
||||||
codeDisabled: false // 获取验证码按钮是否禁用
|
|
||||||
},
|
|
||||||
searchVal: '',
|
searchVal: '',
|
||||||
show1: false,
|
show1: false,
|
||||||
show2: false,
|
show2: false,
|
||||||
@@ -179,13 +155,8 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {},
|
||||||
this.checkModelEnterValidate()
|
|
||||||
},
|
|
||||||
filters: {
|
filters: {
|
||||||
encryCheckModelMobile(code) {
|
|
||||||
return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
|
||||||
},
|
|
||||||
toCustomer(value) {
|
toCustomer(value) {
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
return (value = '准客户')
|
return (value = '准客户')
|
||||||
@@ -195,108 +166,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async checkModelEnterValidate() {
|
initThisPage(showFlag) {
|
||||||
let checkModelResult = await checkEnterPower({ operateType: 'isEnter' })
|
console.log(showFlag)
|
||||||
if (checkModelResult.result == 0) {
|
|
||||||
if (checkModelResult.enterFlag == '0') {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.filterBtn() // 初始化显示按钮
|
this.filterBtn() // 初始化显示按钮
|
||||||
window.appCallBack = this.appCallBack //app回调
|
window.appCallBack = this.appCallBack //app回调
|
||||||
}, 1000)
|
}, 1000)
|
||||||
this.getCustomerList() //客户列表查询
|
this.getCustomerList() //客户列表查询
|
||||||
} else {
|
|
||||||
this.checkModelFilter()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(checkModelResult.resultMessage)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
checkModelBeforeClose(action, done) {
|
|
||||||
if (action === 'confirm' && !this.checkModel.show) {
|
|
||||||
setTimeout(done, 1000)
|
|
||||||
} else {
|
|
||||||
done(false)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async checkModelFilter() {
|
|
||||||
const agentInfoRes = await getCheckModelAgentInfo({})
|
|
||||||
if (agentInfoRes.result == 0) {
|
|
||||||
if (!/^N{1}/.test(agentInfoRes.branchType)) {
|
|
||||||
this.checkModel.mobile = agentInfoRes.phoneNo
|
|
||||||
this.checkModel.show = true
|
|
||||||
} else {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.filterBtn() // 初始化显示按钮
|
|
||||||
window.appCallBack = this.appCallBack //app回调
|
|
||||||
}, 1000)
|
|
||||||
this.getCustomerList() //客户列表查询
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(agentInfoRes.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) {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.filterBtn() // 初始化显示按钮
|
|
||||||
window.appCallBack = this.appCallBack //app回调
|
|
||||||
}, 1000)
|
|
||||||
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() {
|
filterBtn() {
|
||||||
// 筛选按钮的显示
|
// 筛选按钮的显示
|
||||||
|
|||||||
@@ -4,23 +4,7 @@
|
|||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<NavItem v-for="(item, index) of navList" :key="index" :config="item" />
|
<NavItem v-for="(item, index) of navList" :key="index" :config="item" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
<!-- 短信验证 -->
|
<check-agent @checModelSuccessMethod="initThisPage" />
|
||||||
<van-dialog
|
|
||||||
v-model="checkModel.show"
|
|
||||||
title="提示"
|
|
||||||
show-cancel-button
|
|
||||||
@confirm="checkModelConfirm"
|
|
||||||
@cancel="checkModelCancel"
|
|
||||||
:before-close="checkModelBeforeClose"
|
|
||||||
>
|
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -28,10 +12,11 @@
|
|||||||
import UserInfoHeader from '@/components/ebiz/manpower/UserInfoHeader'
|
import UserInfoHeader from '@/components/ebiz/manpower/UserInfoHeader'
|
||||||
import NavItem from '@/components/ebiz/manpower/NavItem'
|
import NavItem from '@/components/ebiz/manpower/NavItem'
|
||||||
import { CellGroup, Cell, Button, Dialog, Field } from 'vant'
|
import { CellGroup, Cell, Button, Dialog, Field } from 'vant'
|
||||||
import { checkEnterPower, getAuthCode, getCheckModelAgentInfo } from '@/api/ebiz/common/common'
|
import CheckAgent from '@/components/common/CheckAgent'
|
||||||
export default {
|
export default {
|
||||||
name: 'Navigation',
|
name: 'Navigation',
|
||||||
components: {
|
components: {
|
||||||
|
[CheckAgent.name]: CheckAgent,
|
||||||
[UserInfoHeader.name]: UserInfoHeader,
|
[UserInfoHeader.name]: UserInfoHeader,
|
||||||
[NavItem.name]: NavItem,
|
[NavItem.name]: NavItem,
|
||||||
[CellGroup.name]: CellGroup,
|
[CellGroup.name]: CellGroup,
|
||||||
@@ -42,15 +27,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checkModel: {
|
|
||||||
show: false,
|
|
||||||
authCode: '',
|
|
||||||
smsId: '',
|
|
||||||
mobile: '',
|
|
||||||
timeId: null, // 计时器ID
|
|
||||||
countDown: 60, // 倒计时
|
|
||||||
codeDisabled: false // 获取验证码按钮是否禁用
|
|
||||||
},
|
|
||||||
active: 0,
|
active: 0,
|
||||||
navList: [
|
navList: [
|
||||||
{
|
{
|
||||||
@@ -76,104 +52,10 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {},
|
||||||
this.checkModelEnterValidate()
|
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
encryCheckModelMobile(code) {
|
|
||||||
return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
async checkModelEnterValidate() {
|
initThisPage(showFlag) {
|
||||||
let checkModelResult = await checkEnterPower({ operateType: 'isEnter' })
|
console.log(showFlag)
|
||||||
if (checkModelResult.result == 0) {
|
|
||||||
if (checkModelResult.enterFlag == '0') {
|
|
||||||
this.checkModel.show = false
|
|
||||||
} else {
|
|
||||||
this.checkModelFilter()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(checkModelResult.resultMessage)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
checkModelBeforeClose(action, done) {
|
|
||||||
if (action === 'confirm' && !this.checkModel.show) {
|
|
||||||
setTimeout(done, 1000)
|
|
||||||
} else {
|
|
||||||
done(false)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async checkModelFilter() {
|
|
||||||
const agentInfoRes = await getCheckModelAgentInfo({})
|
|
||||||
if (agentInfoRes.result == 0) {
|
|
||||||
if (!/^N{1}/.test(agentInfoRes.branchType)) {
|
|
||||||
this.checkModel.mobile = agentInfoRes.phoneNo
|
|
||||||
this.checkModel.show = true
|
|
||||||
} else {
|
|
||||||
this.checkModel.show = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(agentInfoRes.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)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,24 +4,7 @@
|
|||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<NavItem v-for="(item, index) of navList" :key="index" :config="item" />
|
<NavItem v-for="(item, index) of navList" :key="index" :config="item" />
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
<check-agent @checModelSuccessMethod="initThisPage" />
|
||||||
<!-- 短信验证 -->
|
|
||||||
<van-dialog
|
|
||||||
v-model="checkModel.show"
|
|
||||||
title="提示"
|
|
||||||
show-cancel-button
|
|
||||||
@confirm="checkModelConfirm"
|
|
||||||
@cancel="checkModelCancel"
|
|
||||||
:before-close="checkModelBeforeClose"
|
|
||||||
>
|
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -31,11 +14,12 @@ import NavItem from '@/components/ebiz/manpower/NavItem'
|
|||||||
import record from '@/assets/images/u73803.png'
|
import record from '@/assets/images/u73803.png'
|
||||||
import { CellGroup, Cell, Button, Dialog, Field } from 'vant'
|
import { CellGroup, Cell, Button, Dialog, Field } from 'vant'
|
||||||
import { getTokenForUserModel } from '@/api/ebiz/manpower/manpower'
|
import { getTokenForUserModel } from '@/api/ebiz/manpower/manpower'
|
||||||
import { checkEnterPower, getAuthCode, getCheckModelAgentInfo } from '@/api/ebiz/common/common'
|
import CheckAgent from '@/components/common/CheckAgent'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Navigation',
|
name: 'Navigation',
|
||||||
components: {
|
components: {
|
||||||
|
[CheckAgent.name]: CheckAgent,
|
||||||
[UserInfoHeader.name]: UserInfoHeader,
|
[UserInfoHeader.name]: UserInfoHeader,
|
||||||
[NavItem.name]: NavItem,
|
[NavItem.name]: NavItem,
|
||||||
[CellGroup.name]: CellGroup,
|
[CellGroup.name]: CellGroup,
|
||||||
@@ -46,15 +30,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checkModel: {
|
|
||||||
show: false,
|
|
||||||
authCode: '',
|
|
||||||
smsId: '',
|
|
||||||
mobile: '',
|
|
||||||
timeId: null, // 计时器ID
|
|
||||||
countDown: 60, // 倒计时
|
|
||||||
codeDisabled: false // 获取验证码按钮是否禁用
|
|
||||||
},
|
|
||||||
active: 0,
|
active: 0,
|
||||||
navList: [
|
navList: [
|
||||||
{
|
{
|
||||||
@@ -77,105 +52,11 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {},
|
||||||
this.checkModelEnterValidate()
|
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
encryCheckModelMobile(code) {
|
|
||||||
return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
async checkModelEnterValidate() {
|
initThisPage(showFlag) {
|
||||||
let checkModelResult = await checkEnterPower({ operateType: 'isEnter' })
|
console.log(showFlag)
|
||||||
if (checkModelResult.result == 0) {
|
|
||||||
if (checkModelResult.enterFlag == '0') {
|
|
||||||
this.getInfo()
|
this.getInfo()
|
||||||
} else {
|
|
||||||
this.checkModelFilter()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(checkModelResult.resultMessage)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
checkModelBeforeClose(action, done) {
|
|
||||||
if (action === 'confirm' && !this.checkModel.show) {
|
|
||||||
setTimeout(done, 1000)
|
|
||||||
} else {
|
|
||||||
done(false)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async checkModelFilter() {
|
|
||||||
const agentInfoRes = await getCheckModelAgentInfo({})
|
|
||||||
if (agentInfoRes.result == 0) {
|
|
||||||
if (!/^N{1}/.test(agentInfoRes.branchType)) {
|
|
||||||
this.checkModel.mobile = agentInfoRes.phoneNo
|
|
||||||
this.checkModel.show = true
|
|
||||||
} else {
|
|
||||||
this.getInfo()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(agentInfoRes.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() {
|
async getInfo() {
|
||||||
const res = await getTokenForUserModel()
|
const res = await getTokenForUserModel()
|
||||||
|
|||||||
@@ -144,22 +144,7 @@
|
|||||||
<van-button type="danger" class="bottom-btn" @click="add" v-no-more-click="1000">点我新增</van-button>
|
<van-button type="danger" class="bottom-btn" @click="add" v-no-more-click="1000">点我新增</van-button>
|
||||||
|
|
||||||
<!-- 短信验证 -->
|
<!-- 短信验证 -->
|
||||||
<van-dialog
|
<check-agent @checModelSuccessMethod="initThisPage" />
|
||||||
v-model="checkModel.show"
|
|
||||||
title="提示"
|
|
||||||
show-cancel-button
|
|
||||||
@confirm="checkModelConfirm"
|
|
||||||
@cancel="checkModelCancel"
|
|
||||||
:before-close="checkModelBeforeClose"
|
|
||||||
>
|
|
||||||
<p class="p10 fs14">为确保是您本人操作,短信验证码已发送至您手机号{{ checkModel.mobile | encryCheckModelMobile }},请您输入验证码以完成后续操作。</p>
|
|
||||||
<van-cell-group class="flex align-items-c pr5 mb15">
|
|
||||||
<van-field class="pl10" maxlength="6" placeholder="请输入短信验证码" v-model="checkModel.authCode" clearable label-width="0" style="line-height:8vw" />
|
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -167,12 +152,13 @@
|
|||||||
import { Search, Tabs, Tab, List, Tag, Sticky, Toast, Dialog, Field } from 'vant'
|
import { Search, Tabs, Tab, List, Tag, Sticky, Toast, Dialog, Field } from 'vant'
|
||||||
import { orderList, deleteOrderInfo, revokeOrder } from '@/api/ebiz/sale/sale'
|
import { orderList, deleteOrderInfo, revokeOrder } from '@/api/ebiz/sale/sale'
|
||||||
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
|
import { formatRiskList } from '@/assets/js/utils/formatRiskList.js'
|
||||||
import { getAuthCode, checkEnterPower, getCheckModelAgentInfo} from '@/api/ebiz/common/common'
|
|
||||||
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级
|
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到用户等级
|
||||||
|
import CheckAgent from '@/components/common/CheckAgent'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'saleList',
|
name: 'saleList',
|
||||||
components: {
|
components: {
|
||||||
|
[CheckAgent.name]: CheckAgent,
|
||||||
[Field.name]: Field,
|
[Field.name]: Field,
|
||||||
[Search.name]: Search,
|
[Search.name]: Search,
|
||||||
[Tabs.name]: Tabs,
|
[Tabs.name]: Tabs,
|
||||||
@@ -184,15 +170,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checkModel: {
|
|
||||||
show: false,
|
|
||||||
authCode: '',
|
|
||||||
smsId: '',
|
|
||||||
mobile: '',
|
|
||||||
timeId: null, // 计时器ID
|
|
||||||
countDown: 60, // 倒计时
|
|
||||||
codeDisabled: false // 获取验证码按钮是否禁用
|
|
||||||
},
|
|
||||||
searchName: '',
|
searchName: '',
|
||||||
active: 'uncommit', //uncommit 表示未提交 commit表示已提交
|
active: 'uncommit', //uncommit 表示未提交 commit表示已提交
|
||||||
saleList: [],
|
saleList: [],
|
||||||
@@ -214,11 +191,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
|
||||||
encryCheckModelMobile(code) {
|
|
||||||
return code.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||||
@@ -226,99 +198,13 @@ export default {
|
|||||||
})
|
})
|
||||||
}, 100)
|
}, 100)
|
||||||
window.appCallBack = this.appCallBack
|
window.appCallBack = this.appCallBack
|
||||||
this.checkModelEnterValidate()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async checkModelEnterValidate() {
|
initThisPage(showFlag) {
|
||||||
let checkModelResult = await checkEnterPower({ operateType: 'isEnter' })
|
if (showFlag) {
|
||||||
if (checkModelResult.result == 0) {
|
return
|
||||||
if (checkModelResult.enterFlag == '0') {
|
}
|
||||||
this.loadMore()
|
this.loadMore()
|
||||||
} else {
|
|
||||||
this.checkModelFilter()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(checkModelResult.resultMessage)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
checkModelBeforeClose(action, done) {
|
|
||||||
if (action === 'confirm' && !this.checkModel.show) {
|
|
||||||
setTimeout(done, 1000)
|
|
||||||
} else {
|
|
||||||
done(false)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async checkModelFilter() {
|
|
||||||
const agentInfoRes = await getCheckModelAgentInfo({})
|
|
||||||
if (agentInfoRes.result == 0) {
|
|
||||||
if (!/^N{1}/.test(agentInfoRes.branchType)) {
|
|
||||||
this.checkModel.mobile = agentInfoRes.phoneNo
|
|
||||||
this.checkModel.show = true
|
|
||||||
} else {
|
|
||||||
this.loadMore()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$toast(agentInfoRes.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) {
|
appCallBack(data) {
|
||||||
if (data.trigger == 'left_button_click') {
|
if (data.trigger == 'left_button_click') {
|
||||||
@@ -329,9 +215,6 @@ export default {
|
|||||||
},
|
},
|
||||||
//分页用
|
//分页用
|
||||||
loadMore() {
|
loadMore() {
|
||||||
if (this.checkModel.show) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let pageInfo = {
|
let pageInfo = {
|
||||||
pageNum: this.currentPage,
|
pageNum: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
|
|||||||
Reference in New Issue
Block a user