fix 电子税局登录功能调整

jianshui-ui
zhaoxingchang.sd 1 year ago
parent f6e77745e1
commit 138287b1d4
  1. 2
      jianshui-ui/src/permission.js
  2. 385
      jianshui-ui/src/views/digital/taxBureauLogin/index.vue
  3. 56
      jianshui-ui/src/views/freedom/taxBureauLogin/index.vue
  4. 6
      jianshui-ui/vue.config.js

@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth'
NProgress.configure({ showSpinner: false }) NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/auth-redirect', '/bind', '/taxBureauLogin' const whiteList = ['/login', '/auth-redirect', '/bind', '/taxBureauLogin','/authNew'
, '/register', '/auth', '/XA', '/sdFile/*'] , '/register', '/auth', '/XA', '/sdFile/*']
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {

@ -1,30 +1,30 @@
<template> <template>
<div> <div>
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"> <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="1">账号登录</el-menu-item> <el-menu-item index="1">账号登录</el-menu-item>
<el-menu-item index="2">身份认证</el-menu-item> <el-menu-item index="2">身份认证</el-menu-item>
</el-menu> </el-menu>
<div class="menu_body"> <div class="menu_body">
<div v-show="isShow"> <div v-show="isShow">
<div id="accountLogin"> <div id="accountLogin">
<div class="menu_body_text">电子税局登录</div> <div class="menu_body_text">电子税局登录</div>
<el-form ref="form" :model="form" label-width="140px" label-position="left" class="form"> <el-form ref="form" :model="form" label-width="140px" label-position="left" class="form">
<el-row> <el-row>
<el-col :span="34"> <el-col :span="34">
<el-form-item label="电子税务局用户名"> <el-form-item label="电子税务局用户名">
<el-select v-model="form.name" placeholder="请选择电子税局用户名"> <el-select v-model="form.name" placeholder="请选择电子税局用户名">
<el-option v-for="item in dzsjList" :key="item.id" :label="item.yhm" :value="item"></el-option> <el-option v-for="item in dzsjList" :key="item.id" :label="item.yhm" :value="item"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"></el-col> <el-col :span="12"></el-col>
</el-row> </el-row>
</el-form> </el-form>
<div class="button"><el-button :loading="anewLoginBtnLoading" @click="anewLoginBtn()" type="primary">重新登录</el-button></div> <div class="button"><el-button :loading="anewLoginBtnLoading" @click="anewLoginBtn()" type="primary">重新登录</el-button></div>
</div> </div>
</div> </div>
<div v-show="!isShow"> <div v-show="!isShow">
<div id="authentication"> <div id="authentication">
<div class="at_title">请使用税务APP扫描下方二维码进行身份验证</div> <div class="at_title">请使用税务APP扫描下方二维码进行身份验证</div>
<div class="at_input"> <div class="at_input">
<div class="at_labe">电子税局用户名</div> <div class="at_labe">电子税局用户名</div>
@ -33,60 +33,63 @@
<el-option v-for="item in dzsjList" :key="item.id" :label="item.yhm" :value="item"></el-option> <el-option v-for="item in dzsjList" :key="item.id" :label="item.yhm" :value="item"></el-option>
</el-select> </el-select>
</div> </div>
<div class="button"><el-button :loading="getQrCodeBtnloading" @click="getQrCodeBtn()" type="primary">获取认证二维码</el-button></div> <div class="button"><el-button :disabled="isCountingDown" @click="getQrCodeBtn()" type="primary">
<span v-if="isCountingDown">获取认证二维码</span>
<span v-else>{{ countdown }}<span>s</span></span>
</el-button></div>
</div> </div>
<div class="qrcode" ref="qrCodeUrl"></div> <div class="qrcode" ref="qrCodeUrl"></div>
<div class="qrcodetext" v-show="qrcodeShow">可将二维码图片发给认证人员进行身份认证手机端完成认证后自动同步认证结果开展后续数电业务操作</div> <div class="qrcodetext" v-show="qrcodeShow">可将二维码图片发给认证人员进行身份认证手机端完成认证后自动同步认证结果开展后续数电业务操作</div>
</div>
</div> </div>
</div>
</div>
<el-dialog
class="dialog"
title="短信登录"
:visible.sync="dialogVisible"
width="550px"
>
<div class="dialog_title">
<div class="dialog_img"><img src="@/assets/images/tishi.png" height="20px" width="20px"></div>
<div class="dialog_text">为了您的账号安全和信用安全请进行安全验证验证码将以短信形式发送至电子税务局绑定的手机号</div>
</div> </div>
<div class="dialog_body"> <el-dialog
class="dialog"
title="短信登录"
:visible.sync="dialogVisible"
width="550px"
>
<div class="dialog_title">
<div class="dialog_img"><img src="@/assets/images/tishi.png" height="20px" width="20px"></div>
<div class="dialog_text">为了您的账号安全和信用安全请进行安全验证验证码将以短信形式发送至电子税务局绑定的手机号</div>
</div>
<div class="dialog_body">
<div class="dialog_body_zh"><div class="label">数电账号:</div><div class="zh">{{this.smsFrom.zh}}</div></div> <div class="dialog_body_zh"><div class="label">数电账号:</div><div class="zh">{{this.smsFrom.zh}}</div></div>
<div class="dialog_body_yzm"> <div class="dialog_body_yzm">
<div class="label">验证码:</div> <div class="label">验证码:</div>
<div class="input"><el-input v-model="dxyzm" placeholder="请输入验证码"></el-input></div> <div class="input"><el-input v-model="dxyzm" placeholder="请输入验证码"></el-input></div>
<div><el-button :loading="getyzmBtnloading" @click="getyzmBtn()" type="primary">获取验证码</el-button></div> <div><el-button :loading="getyzmBtnloading" @click="getyzmBtn()" type="primary">获取验证码</el-button></div>
</div>
</div> </div>
</div> <span slot="footer" class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="yzmloginBtn()"> </el-button> <el-button type="primary" @click="yzmloginBtn()"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="责任人" title="责任人"
:visible.sync="zzrdialogVisible" :visible.sync="zzrdialogVisible"
width="550px" width="550px"
> >
<el-form ref="form" :model="form" label-width="60px" label-position="left" align="center" class="form"> <el-form ref="form" :model="form" label-width="60px" label-position="left" align="center" class="form">
<el-row class="zzr"> <el-row class="zzr">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任人"> <el-form-item label="责任人">
<el-select v-model="zzrlx" placeholder="请选择责任人"> <el-select v-model="zzrlx" placeholder="请选择责任人">
<el-option v-for="item in zrrList" :key="item.val" :label="item.label" :value="item.val"></el-option> <el-option v-for="item in zrrList" :key="item.val" :label="item.label" :value="item.val"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="zzrdialogVisible = false"> </el-button> <el-button @click="zzrdialogVisible = false"> </el-button>
<el-button type="primary" @click="zzrloginBtn()"> </el-button> <el-button type="primary" @click="zzrloginBtn()"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import QRCode from 'qrcodejs2' import QRCode from 'qrcodejs2'
@ -116,6 +119,7 @@ export default {
yzm:'' yzm:''
}, },
zrrList:[], zrrList:[],
countdown:0,
zzrdialogVisible:false, zzrdialogVisible:false,
dxyzm:'', dxyzm:'',
zzrlx:'', zzrlx:'',
@ -124,7 +128,7 @@ export default {
rzid:'', rzid:'',
anewLoginBtnLoading:false, anewLoginBtnLoading:false,
getyzmBtnloading:false, getyzmBtnloading:false,
getQrCodeBtnloading:false isCountingDown:false
}; };
}, },
methods: { methods: {
@ -133,8 +137,8 @@ export default {
}, },
getRpaAuthStatus(){ getRpaAuthStatus(){
queryRpaTaxAccountApi().then(res => { queryRpaTaxAccountApi().then(res => {
this.dzsjList = res.data this.dzsjList = res.data
this.form.name = this.dzsjList[length] this.form.name = this.dzsjList[length]
}); });
}, },
anewLoginBtn(){ anewLoginBtn(){
@ -166,11 +170,13 @@ export default {
}); });
} }
if(data.hxff === "1"){ if(data.hxff === "1"){
this.postLogin() this.dxyzm = data.dxyzm
this.smsFrom.zh = this.form.name.yhm;
this.dialogVisible = true;
} }
if(data.hxff === "2"){ if(data.hxff === "2"){
let list = []; let list = [];
for (let Key in data.personList) { for (let Key in data.personList) {
arr.push({ arr.push({
val:Key, val:Key,
label:this.zrrList[Key] label:this.zrrList[Key]
@ -180,12 +186,13 @@ export default {
this.zzrdialogVisible = true; this.zzrdialogVisible = true;
} }
if(data.hxff === "3"){ if(data.hxff === "3"){
this.dxyzm = data.dxyzm this.$message({
this.smsFrom.zh = this.form.name.yhm; message: '验证码发送成功',
this.dialogVisible = true; type: 'success'
});
} }
}).finally(()=>{ }).finally(()=>{
this.anewLoginBtnLoading = false; this.anewLoginBtnLoading = false;
}) })
}, },
// //
@ -222,67 +229,82 @@ export default {
}, },
// //
getQrCodeBtn(){ getQrCodeBtn(){
this.getQrCodeBtnloading = true; if (this.isCountingDown) {
getRpaQrCodeApi({yhm: this.formQr.name.yhm}).then(({data})=>{ return; //
this.$refs.qrCodeUrl.innerHTML = ''; }
let qrcode = new QRCode(this.$refs.qrCodeUrl, { //
text: data.ewm, //
width: 150, this.isCountingDown = true;
height: 150, this.timer = setInterval(() => {
colorDark: '#000000', if (this.countdown > 0) {
colorLight: '#ffffff', this.countdown--;
correctLevel: QRCode.CorrectLevel.H } else {
}) //
this.qrcodeShow = true this.isCountingDown = false;
this.rzid = data.rzid this.countdown = 120;
this.polling() clearInterval(this.timer); //
}).finally(()=>{ getRpaQrCodeApi({yhm: this.formQr.name.yhm}).then(({data})=>{
this.getQrCodeBtnloading = false; this.$refs.qrCodeUrl.innerHTML = '';
}) let qrcode = new QRCode(this.$refs.qrCodeUrl, {
text: data.ewm,
width: 150,
height: 150,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
})
this.qrcodeShow = true
this.rzid = data.rzid
this.polling()
}).finally(()=>{
this.getQrCodeBtnloading = false;
})
}
}, 1000);
}, },
polling(){ polling(){
postRpaAuthStatusApi({rzid:this.rzid,yhm:this.formQr.name.yhm}).then(({data})=>{ postRpaAuthStatusApi({rzid:this.rzid,yhm:this.formQr.name.yhm}).then(({data})=>{
window.clearInterval(this.timer);
this.timer = null
if(data.slzt === '1' ){
this.timer = window.setInterval( ()=>{ this.polling() },3000)
}
if(data.slzt === '2' ) {
window.clearInterval(this.timer); window.clearInterval(this.timer);
this.timer = null this.timer = null
if(data.slzt === '1' ){ this.$message({
message: '当前账号已认证通过',
this.timer = window.setInterval( ()=>{ this.polling() },3000) type: 'success'
} });
if(data.slzt === '2' ){ this.$nextTick(() => {
window.clearInterval(this.timer);
this.timer = null
this.$message({
message: '当前账号已认证通过',
type: 'success'
});
this.$nextTick(()=>{
this.$refs.qrCodeUrl.innerHTML = ''; this.$refs.qrCodeUrl.innerHTML = '';
this.qrcodeShow = false; this.qrcodeShow = false;
}) })
} }
if(data.slzt === '3' ){ if (data.slzt === '3') {
this.$message({ this.$message({
message: '扫码失败', message: '扫码失败',
type: 'success' type: 'success'
}); });
window.clearInterval(this.timer); window.clearInterval(this.timer);
this.timer = null this.timer = null
} }
}) })
} }
}, },
created() { created() {
let searchParams = new URLSearchParams(window.location.search); let searchParams = new URLSearchParams(window.location.search);
this.loginKey.id = searchParams.get('id') this.loginKey.id = searchParams.get('id')
this.loginKey.key = searchParams.get('key') this.loginKey.key = searchParams.get('key')
this.$store.commit('SET_AUTH_STATUS',this.loginKey) this.$store.commit('SET_AUTH_STATUS', this.loginKey)
}, },
mounted() { mounted() {
if(this.loginKey.id !== '' && this.loginKey.key !== ''){ if (this.loginKey.id !== '' && this.loginKey.key !== '') {
this.getRpaAuthStatus() this.getRpaAuthStatus()
} }
}, },
beforeDestroy(){ beforeDestroy() {
window.clearInterval(this.timer); window.clearInterval(this.timer);
this.timer = null this.timer = null
} }
@ -290,64 +312,76 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.menu_body{ .menu_body {
::v-deep.el-input--suffix .el-input__inner { ::v-deep.el-input--suffix .el-input__inner {
//height: 30px; //height: 30px;
width: 100%; width: 100%;
} }
width: 100%; width: 100%;
height: calc(75vh); height: calc(75vh);
margin-top: 150px; margin-top: 150px;
display: flex; display: flex;
justify-content: center; justify-content: center;
#accountLogin{
#accountLogin {
width: 400px; width: 400px;
height: 400px; height: 400px;
//background-color: #6c5656; //background-color: #6c5656;
.menu_body_text{ .menu_body_text {
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
} }
.form{
.form {
margin: 12% 0; margin: 12% 0;
} }
.button{
display: flex; .button {
justify-content: center; display: flex;
justify-content: center;
} }
} }
#authentication{
#authentication {
margin-top: -100px; margin-top: -100px;
width: 500px; width: 500px;
height: 400px; height: 400px;
.at_title{
.at_title {
text-align: center; text-align: center;
} }
.qrcode{
.qrcode {
width: 100px; width: 100px;
height: 100px; height: 100px;
margin: auto; margin: auto;
margin-top: 40px; margin-top: 40px;
} }
.qrcodetext{
.qrcodetext {
padding-top: 70px; padding-top: 70px;
font-size: 12px; font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #666; color: #666;
} }
.at_input{
.at_input {
margin-top: 40px; margin-top: 40px;
.at_labe{
.at_labe {
line-height: 30px; line-height: 30px;
width: 120px; width: 120px;
} }
display: flex; display: flex;
height: 40px; height: 40px;
justify-items: center; justify-items: center;
.select{
.select {
margin: 0 10px; margin: 0 10px;
} }
} }
@ -355,55 +389,64 @@ export default {
} }
.dialog{
.dialog_title{ .dialog {
.dialog_title {
padding: 10px 10px 0 10px; padding: 10px 10px 0 10px;
width: 460px; width: 460px;
display: flex; display: flex;
margin: auto; margin: auto;
background: #fff4e3; background: #fff4e3;
border: 1px solid #e6a23c; border: 1px solid #e6a23c;
.dialog_text{
.dialog_text {
margin-left: 10px; margin-left: 10px;
width: 450px; width: 450px;
height: 70px; height: 70px;
} }
} }
.dialog_body{
.dialog_body {
.dialog_body_zh{
height: 40px; .dialog_body_zh {
display: flex; height: 40px;
align-items: center; display: flex;
margin: 20px 0 0 25px; align-items: center;
height: 40px; margin: 20px 0 0 25px;
.label{ height: 40px;
width: 90px;
} .label {
.zh{ width: 90px;
padding-top: 3px; }
}
} .zh {
.dialog_body_yzm{ padding-top: 3px;
height: 40px; }
margin: 20px 0 0 25px; }
display: flex;
align-items: center; .dialog_body_yzm {
height: 40px; height: 40px;
.label{ margin: 20px 0 0 25px;
width: 90px; display: flex;
} align-items: center;
.input{ height: 40px;
margin-right: 20px;
} .label {
width: 90px;
}
.input {
margin-right: 20px;
}
} }
} }
.zzr{
margin-left: 40px; .zzr {
} margin-left: 40px;
}
} }
</style> </style>

@ -56,7 +56,10 @@
<div class="dialog_body_yzm"> <div class="dialog_body_yzm">
<div class="label">验证码:</div> <div class="label">验证码:</div>
<div class="input"><el-input v-model="dxyzm" placeholder="请输入验证码"></el-input></div> <div class="input"><el-input v-model="dxyzm" placeholder="请输入验证码"></el-input></div>
<div><el-button :loading="getyzmBtnloading" @click="getyzmBtn()" type="primary">获取验证码</el-button></div> <div><el-button :disabled="getyzmBtnloading" @click="getyzmBtn()" type="primary">
<span v-if="!getyzmBtnloading">获取验证码</span>
<span v-else>{{countdown}} <span> s</span></span>
</el-button></div>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -124,7 +127,9 @@ export default {
rzid:'', rzid:'',
anewLoginBtnLoading:false, anewLoginBtnLoading:false,
getyzmBtnloading:false, getyzmBtnloading:false,
getQrCodeBtnloading:false getQrCodeBtnloading:false,
countdown:60,
timec: null, //
}; };
}, },
methods: { methods: {
@ -164,9 +169,13 @@ export default {
message: '登录成功', message: '登录成功',
type: 'success' type: 'success'
}); });
this.dialogVisible = false;
} }
if(data.hxff === "1"){ if(data.hxff === "1"){
this.postLogin() this.dxyzm = data.dxyzm
this.ffm = '3'
this.smsFrom.zh = this.form.name.yhm;
this.dialogVisible = true;
} }
if(data.hxff === "2"){ if(data.hxff === "2"){
let list = []; let list = [];
@ -179,22 +188,40 @@ export default {
} }
this.zzrdialogVisible = true; this.zzrdialogVisible = true;
} }
if(data.hxff === "3"){
this.dxyzm = data.dxyzm
this.smsFrom.zh = this.form.name.yhm;
this.dialogVisible = true;
}
}).finally(()=>{ }).finally(()=>{
this.anewLoginBtnLoading = false; this.anewLoginBtnLoading = false;
}) })
}, },
// //
getyzmBtn(){ async getyzmBtn(){
this.getyzmBtnloading = true; if (this.getyzmBtnloading) {
return; //
}
//
this.ffm = '1' this.ffm = '1'
rpaLoginApi({yhm:this.form.name.yhm,mm:this.form.name.mm,ffm:this.ffm}).finally(()=>{ await rpaLoginApi({yhm:this.form.name.yhm,mm:this.form.name.mm,ffm:this.ffm}).then(({data})=>{
this.getyzmBtnloading = false; if(data.hxff === "3"){
}) this.ffm = data.hxff
this.$message({
message: '验证码发送成功',
type: 'success'
});
}
})
//
this.getyzmBtnloading = true;
this.timec = setInterval(() => {
if (this.countdown > 0) {
this.countdown--;
} else {
//
this.getyzmBtnloading = false;
this.countdown = 60;
clearInterval(this.timec); //
}
}, 1000);
}, },
yzmloginBtn(){ yzmloginBtn(){
if(!this.dxyzm){ if(!this.dxyzm){
@ -204,7 +231,6 @@ export default {
}); });
}else { }else {
this.postLogin() this.postLogin()
this.dialogVisible = false;
} }
}, },

@ -10,8 +10,10 @@ const name = process.env.VUE_APP_TITLE || '简税平台管理系统' // 网页
const port = process.env.port || process.env.npm_config_port || 8088 // 端口 const port = process.env.port || process.env.npm_config_port || 8088 // 端口
// 'http://dev.goldentaxcloud.com:8081' // 'http://dev.goldentaxcloud.com:8081'
// www.goldentaxcloud.com:8080
const url = process.env.NODE_ENV === 'development' ? 'http://dev.goldentaxcloud.com:8081' : 'http://dev.goldentaxcloud.com:8081' // let development = 'http://dev.goldentaxcloud.com:8081'
let development = 'www.goldentaxcloud.com:8080'
const url = process.env.NODE_ENV === 'development' ? development : development
// vue.config.js 配置说明 // vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions

Loading…
Cancel
Save