自主授权

beta-enc
yishiqihuasheng 2 years ago
parent d4768db0d0
commit ce6c0a3aa8
  1. 2
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoiceall/v1/InvoiceAllController.java
  2. 19
      jianshui-ui/src/api/freedom/login.js
  3. 64
      jianshui-ui/src/views/freedom/login.vue

@ -28,6 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* @Description 全电接口-金财数科

@ -21,6 +21,23 @@ export function submitNote(traceno,nsrsbh,smsCode,zjh) {
return request({
url: '/api/invoice_all/v1/submitNote',
method: 'post',
data: data
data: data,
})
}
export function submitNoteResult(traceno,nsrsbh,smsCode,zjh) {
const data = {
traceno,
nsrsbh,
smsCode,
zjh
}
return request({
url: '/api/invoice_all/v1/submitNoteResult',
method: 'post',
data: data,
})
}

@ -82,7 +82,7 @@
</el-form-item>
</el-form>
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="ruleForm.showtwo">
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm" size="medium" v-if="ruleForm.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>
@ -90,7 +90,7 @@
<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>
<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="ruleForm.showthree">
@ -101,13 +101,13 @@
</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: 50%">返回授权</span>
<span @click="changeShow()" style="color: #787be8;text-decoration-line: underline;margin-left: 50%">重新授权</span>
</el-form>
</div>
</template>
<script>
import {login,submitNote} from "@/api/freedom/login";
import {login,submitNote,submitNoteResult} from "@/api/freedom/login";
export default {
name: "Login",
data() {
@ -121,8 +121,8 @@ export default {
return {
ruleForm: {
smsCode : "",
showone : true,
showtwo : false,
showone : false,
showtwo : true,
showthree : false,
nsrsbh: '',
nsrdq: '',
@ -165,7 +165,8 @@ export default {
{ validator: checkedFn, trigger: "change" }
// { type: 'array', required: true, message: '', trigger: 'change' }
]
}
},
loading : false
};
},
methods: {
@ -194,17 +195,56 @@ export default {
});
},
submitFormWithMsgCode(){
this.loading = true;
submitNote(this.ruleForm.traceno,this.ruleForm.nsrsbh,this.ruleForm.smsCode,this.ruleForm.nsrInfo.zjh)
.then(res=>{
if (res.code == "200"){
this.ruleForm.showone = false;
this.ruleForm.showtwo = false;
this.ruleForm.showthree = true;
let timer = setInterval(() => {
this.fun(timer)
}, 5000)
}else {
alter("请求失败请重试")
this.loading = false;
this.ruleForm.showone = false;
this.ruleForm.showtwo = true;
this.ruleForm.showthree = false;
console.log("进入方法")
console.log(this.loading)
}
}).catch(()=>{
this.loading = false;
this.ruleForm.showone = false;
this.ruleForm.showtwo = true;
this.ruleForm.showthree = false;
console.log("进入catch方法")
});
},
fun (timer) {
setTimeout(()=>{
// ajax
submitNoteResult(this.ruleForm.traceno,this.ruleForm.nsrsbh,this.ruleForm.smsCode,this.ruleForm.nsrInfo.zjh)
.then(res=>{
if (res.msg == "10011"){
this.ruleForm.showone = false;
this.ruleForm.showtwo = false;
this.ruleForm.showthree = true;
this.loading = false;
clearInterval(timer)
}else if(res.msg == "10012"){
this.ruleForm.showone = false;
this.ruleForm.showtwo = true;
this.ruleForm.showthree = false;
this.loading = false;
clearInterval(timer)
}
}).catch(()=>{
this.ruleForm.showone = false;
this.ruleForm.showtwo = true;
this.ruleForm.showthree = false;
this.loading = false;
clearInterval(timer)
});
}, 0)
},
resetForm(formName) {
this.$refs[formName].resetFields();

Loading…
Cancel
Save