对接新版自主授权

master
路明慧 1 year ago
parent e4c5129d53
commit 0f4e34100d
  1. 25
      jianshui-ui/src/api/freedom/login.js
  2. 5
      jianshui-ui/src/router/index.js
  3. 14
      jianshui-ui/src/views/digital/registered/index.vue
  4. 260
      jianshui-ui/src/views/freedom/loginNew.vue

@ -10,6 +10,16 @@ export function login(data) {
}) })
} }
export function loginNew(data) {
return request({
url: '/api/invoice_all/v1/asyncqdLogin',
method: 'post',
data: data,
timeout : 60000
})
}
export function submitNote(traceno,nsrsbh,smsCode,zjh) { export function submitNote(traceno,nsrsbh,smsCode,zjh) {
const data = { const data = {
@ -25,6 +35,21 @@ export function submitNote(traceno,nsrsbh,smsCode,zjh) {
}) })
} }
export function submitNoteNew(traceno,nsrsbh,smsCode,zjh) {
const data = {
traceno,
nsrsbh,
smsCode,
zjh
}
return request({
url: '/api/invoice_all/v1/asyncsubmitNote',
method: 'post',
data: data,
})
}
export function submitNoteResult(traceno,nsrsbh,smsCode,zjh) { export function submitNoteResult(traceno,nsrsbh,smsCode,zjh) {
const data = { const data = {

@ -49,6 +49,11 @@ export const constantRoutes = [
component: resolve => require(['@/views/freedom/login'],resolve), component: resolve => require(['@/views/freedom/login'],resolve),
hidden: true hidden: true
}, },
{
path: '/authNew',
component: resolve => require(['@/views/freedom/loginNew'],resolve),
hidden: true
},
{ {
path: '/XA', path: '/XA',
component: resolve => require(['@/views/freedom/XA'],resolve), component: resolve => require(['@/views/freedom/XA'],resolve),

@ -141,6 +141,16 @@
v-hasPermi="['invoiceall:invoiceallyhdj:routerFreedom']" v-hasPermi="['invoiceall:invoiceallyhdj:routerFreedom']"
>自主授权</el-button> >自主授权</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="#409EFF"
plain
icon="el-icon-caret-right"
size="mini"
@click="routerFreedomNew"
v-hasPermi="['invoiceall:invoiceallyhdj:routerFreedom']"
>自主授权()</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
@ -430,6 +440,10 @@ export default {
const url = this.$router.resolve({ path: "/auth" }).href; const url = this.$router.resolve({ path: "/auth" }).href;
window.open(url, '_blank'); window.open(url, '_blank');
}, },
routerFreedomNew() {
const url = this.$router.resolve({ path: "/authNew" }).href;
window.open(url, '_blank');
},
/** 等级活跃状态查询 */ /** 等级活跃状态查询 */
obtainLoginStatus(){ obtainLoginStatus(){

@ -0,0 +1,260 @@
<template>
<div id="a-login">
<h4 style="text-align: center;color: white;background: #00afff;margin: 0px;padding-top: 15px;padding-bottom: 15px; margin-bottom: 40px">自主授权登陆</h4>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="showone" v-loading="loadingone">
<el-form-item label="税号" prop="nsrsbh">
<el-input v-model="ruleForm.nsrsbh" placeholder="请输入纳税人识别号" @blur="fetchRegionData()"></el-input>
</el-form-item>
<el-form-item label="地区" prop="nsrdq">
<el-select v-model="ruleForm.nsrdq" placeholder="请选择地区" style="width: 100%">
<el-option label="北京" value="beijing"></el-option>
<el-option label="宁波" value="ningbo"></el-option>
<el-option label="深圳" value="shenzhen"></el-option>
<el-option label="青岛" value="qingdao"></el-option>
<el-option label="厦门" value="xiamen"></el-option>
<el-option label="大连" value="dalian"></el-option>
<el-option label="浙江" value="zhejiang"></el-option>
<el-option label="四川" value="sichuan"></el-option>
<el-option label="上海(新版登录)" value="shanghai"></el-option>
<el-option label="广东(新版登录)" value="guangdong"></el-option>
<el-option label="重庆" value="chongqing"></el-option>
<el-option label="天津" value="tianjin"></el-option>
<el-option label="陕西" value="shanxi"></el-option>
<el-option label="内蒙古" value="neimenggu"></el-option>
<el-option label="河南" value="henan"></el-option>
<el-option label="福建" value="fujian"></el-option>
<el-option label="云南" value="yunnan"></el-option>
<el-option label="吉林" value="jilin"></el-option>
<el-option label="江苏" value="jiangsu"></el-option>
<el-option label="湖南" value="hunan"></el-option>
<el-option label="安徽" value="anhui"></el-option>
<el-option label="贵州" value="guizhou"></el-option>
<el-option label="广西" value="guangxi"></el-option>
<el-option label="河北" value="hebei"></el-option>
<el-option label="黑龙江" value="heilongjiang"></el-option>
<el-option label="湖北" value="hubei"></el-option>
<el-option label="甘肃" value="gansu"></el-option>
<el-option label="海南" value="hainan"></el-option>
<el-option label="宁夏" value="ningxia"></el-option>
<el-option label="辽宁" value="liaoning"></el-option>
<el-option label="青海" value="qinghai"></el-option>
<el-option label="山西" value="shanxi"></el-option>
<el-option label="江西" value="jiangxi"></el-option>
<el-option label="山东" value="shandong"></el-option>
<el-option label="新疆" value="xinjiang"></el-option>
<el-option label="西藏" value="xizang"></el-option>
</el-select>
</el-form-item>
<el-form-item label="登陆方式" prop="loginType">
<el-select v-model="ruleForm.loginType" placeholder="" style="width: 100%">
<el-option label="账密" value="1"></el-option>
<el-option label="扫码登陆" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="用户名" prop="nsrInfo.bsryxz">
<el-input v-model="ruleForm.nsrInfo.bsryxz" placeholder = "居民身份证号码/手机号码/用户名"></el-input>
</el-form-item>
<!-- <el-form-item label="身份证号" prop="">-->
<!-- <el-input v-model="ruleForm.nsrInfo.sfzjhm" placeholder = "请输入身份证号"></el-input>-->
<!-- </el-form-item>-->
<el-form-item label="手机号" prop="nsrInfo.zjh">
<el-input v-model="ruleForm.nsrInfo.zjh" placeholder = "请输入手机号"></el-input>
</el-form-item>
<el-form-item label="用户密码" prop="nsrInfo.gsnsmm">
<el-input v-model="ruleForm.nsrInfo.gsnsmm" placeholder = "请输入个人用户密码" type="password"></el-input>
</el-form-item>
<el-form-item label="登陆身份" prop="nsrInfo.dlsf">
<el-select v-model="ruleForm.nsrInfo.dlsf" placeholder="请选择登陆身份" style="width: 100%">
<el-option label="财务负责人" value="1"></el-option>
<el-option label="法定代表人" value="2"></el-option>
<el-option label="办税员" value="3"></el-option>
<el-option label="开票员" value="7"></el-option>
<el-option label="办税人" value="7"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="success" @click="submitForm('ruleForm')" size="medium" style="width: 70%;height: 50px;display:block;margin:0 auto">确认提交</el-button>
</el-form-item>
<el-form-item prop="checked">
<el-checkbox v-model="ruleForm.checked" style="margin-left: 20px;margin-bottom: 10px">请阅读并同意我们的<router-link to="XA" style="color: red">用户协议</router-link></el-checkbox><br>
<span style="color: #ffb612;font-size: 10px;margin-left: 20px">为保证数据采集的完整性请优先使用法人财务负责人等身份的账号授权登录</span>
</el-form-item>
</el-form>
<!-- 第二个页面-->
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="showtwo" v-loading="loading">
<p style="text-align: center;margin-bottom: 30px">短信验证码已发送请提交短信验证码</p>
<el-form-item prop="ruleForm.smsCode" style="height: 50px">
<el-input v-model="ruleForm.smsCode" style="height: 30px;width: 60%;margin-left: 20%"></el-input>
</el-form-item>
<el-form-item>
<el-button type="success" @click="submitFormWithMsgCode()" size="medium" style="width: 70%;height: 50px;display:block;margin:0 auto">确认提交</el-button>
</el-form-item>
<span @click="changeShow()" style="color: #787be8;text-decoration-line: underline;margin-left: 50%">重新授权</span>
</el-form>
<!-- 第三个页面-->
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="showthree">
<el-row style="margin-left: 500px">
<el-col :xl="12" :lg="12" >
<el-result icon="success" title="" subTitle="">
</el-result>
</el-col>
</el-row>
<p style="text-align: center;margin-bottom: 30px">授权成功,任务可能需要5-10分钟请耐心等待...</p>
<span @click="changeShow()" style="color: #787be8;text-decoration-line: underline;margin-left: 48%">重新授权</span>
</el-form>
</div>
</template>
<script>
import {loginNew,submitNoteNew,submitNoteResult,getAddress} from "@/api/freedom/login";
export default {
name: "Login",
data() {
let checkedFn = (rule, value, callback) => {
if (!value) {
callback(new Error("请勾选同意协议"));
} else {
callback();
}
};
return {
showone : true,
showtwo : false,
showthree : false,
ruleForm: {
smsCode : "",
nsrsbh: '',
nsrdq: '',
loginType: '1',
checked : false,
traceno : "",
nsrInfo:{
dlsf :"",
dlsfmm : "",
gsnsmm : "",
sfzjhm : "",
zjh : "",
gsnsyhm : "",
bsryxz : "",
}
},
rules: {
nsrsbh: [
{ required: true, message: '请输入纳税人识别号', trigger: 'blur' }
],
nsrdq: [
{ required: true, message: '请选择地区', trigger: 'change' }
],
loginType: [
{ required: true, message: '请选择登陆方式', trigger: 'change' }
],
"nsrInfo.bsryxz": [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
"nsrInfo.sfzjhm": [
{ required: true, message: '请输入身份证号', trigger: 'blur' }
],
"nsrInfo.zjh": [
{ required: true, message: '请输入手机号', trigger: 'blur' }
],
"nsrInfo.gsnsmm": [
{ required: true, message: '请输入个人密码', trigger: 'blur' }
],
checked: [
{ validator: checkedFn, trigger: "change" }
// { type: 'array', required: true, message: '', trigger: 'change' }
]
},
loading : false,
loadingone: false
};
},
methods: {
fetchRegionData() {
const taxNumber = this.ruleForm.nsrsbh;
//
getAddress(taxNumber).then(res => {
console.log(res.msg);
const regionData = res.msg;
this.ruleForm.nsrdq = regionData;
})
.catch(error => {
console.error(error);
});
},
// /
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
// alert('submit!');
this.ruleForm.nsrInfo.dlsfmm = this.ruleForm.nsrInfo.gsnsmm;
this.ruleForm.nsrInfo.bsryxz = this.ruleForm.nsrInfo.zjh;
this.ruleForm.nsrInfo.gsnsyhm = this.ruleForm.nsrInfo.zjh;
this.loadingone = true;
loginNew(this.ruleForm).then(res=>{
if (res.code === 200){
this.ruleForm.traceno = res.traceno;
this.loadingone = false;
this.showone = false;
this.showtwo = true;
this.showthree = false;
}else {
this.loadingone = false;
this.$alert("<font color='red'>登陆失败,失败原因"+res.msg+"</font>")
}
}).catch(()=>{
this.loadingone = false;
this.showone = true;
this.showtwo = false;
this.showthree = false;
});
} else {
console.log('error submit!!');
return false;
}
});
},
submitFormWithMsgCode(){
this.loading = true;
submitNoteNew(this.ruleForm.traceno,this.ruleForm.nsrsbh,this.ruleForm.smsCode,this.ruleForm.nsrInfo.zjh)
.then(res=>{
if (res.code == "200"){
this.loading = false;
this.showone = false;
this.showtwo = false;
this.showthree = true;
}else {
this.loading = false;
this.showone = false;
this.showtwo = true;
this.showthree = false;
}
}).catch(()=>{
this.loading = false;
this.showone = false;
this.showtwo = true;
this.showthree = false;
console.log("进入catch方法")
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
changeShow(){
this.showone = true;
this.showtwo = false;
this.showthree = false;
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save