Bladeren bron

fix: 修改协议录入检测登录

wuguojie 1 jaar geleden
bovenliggende
commit
4eacebc660
2 gewijzigde bestanden met toevoegingen van 48 en 20 verwijderingen
  1. 21 5
      src/http/moudules/sys.js
  2. 27 15
      src/views/AgreementManage/CarInsurance/AgreementEntry.vue

+ 21 - 5
src/http/moudules/sys.js

@@ -510,14 +510,30 @@ export const taiShanCode1 = (data) => {
     data
   })
 }
+// 统一发送验证码
+export const sendLoginSmsCode = (data) => {
+    return axios({
+        url: '/insurance/crawler/sendLoginSmsCode',
+        method: 'post',
+        data
+    })
+}
 
 //登录
 export const crawlerlogin1 = (data) => {
-  return axios({
-    url:`/insurance/crawler/loginTs`,
-    method: 'post',
-    data
-  })
+    return axios({
+        url:`/insurance/crawler/loginTs`,
+        method: 'post',
+        data
+    })
+}
+//登录
+export const verifyLoginSmsCode = (data) => {
+    return axios({
+        url:`/insurance/crawler/verifyLoginSmsCode`,
+        method: 'post',
+        data
+    })
 }
 //登录
 export const crawlerlogin = (agreementId,smscode) => {

+ 27 - 15
src/views/AgreementManage/CarInsurance/AgreementEntry.vue

@@ -1554,7 +1554,7 @@ import agreementHistoryRecord from "./AgreementHistoryRecord.vue"
 import agreementUnderwritingRule from "./AgreementUnderwritingRule.vue"
 import agreementNonVehicleConfig from "./AgreementNonVehicleConfig.vue"
 import { updateFeeFile } from "../../../http/moudules/insCompany";
-import {crawlerlogin1} from "../../../http/moudules/sys";
+import {crawlerlogin1, sendLoginSmsCode} from "../../../http/moudules/sys";
 export default {
   components: {
     tree,
@@ -4262,7 +4262,7 @@ export default {
         attribution: this.attributionform,
         dept: this.dept,
       };
-      this.$api.sys.crawlerlogin1(params).then((res) => {
+      this.$api.sys.verifyLoginSmsCode(params).then((res) => {
         if (res.code == '200') {
           this.codedialogVisible=false;
           this.codeLoginVisible = true;
@@ -4276,17 +4276,17 @@ export default {
     },
     //提交
     submitForm() {
-      let code = this.agreement.partnerCompaniesId.substring(0,4);
-      let apiType = this.attributionform.apiType;
-      if(code == 'TSBX' && apiType == '2' && !this.codeLoginVisible){
-          this.$api.sys.taiShanCode1(this.attributionform).then((res) => {
-            if (res.code != '200') {
-              this.$message.error(res.msg);
-            }
-          })
-        this.codedialogVisible = true
-        return
-      }
+      // let code = this.agreement.partnerCompaniesId.substring(0,4);
+      // let apiType = this.attributionform.apiType;
+      // if(code == 'TSBX' && apiType == '2' && !this.codeLoginVisible){
+      //     this.$api.sys.taiShanCode1(this.attributionform).then((res) => {
+      //       if (res.code != '200') {
+      //         this.$message.error(res.msg);
+      //       }
+      //     })
+      //   this.codedialogVisible = true
+      //   return
+      // }
 
       let agreementCheckFlag = true; //协议信息校验标志
       this.$refs["addAgreementRef"].validate((valid) => {
@@ -4381,7 +4381,7 @@ export default {
           }
         }
       }
-      
+
     },
     //检测python登录
     checkLogin(){
@@ -4406,6 +4406,18 @@ export default {
           }
         });
       } else {
+        let list = ['TSBX', 'XDCX']
+        let code = this.agreement.partnerCompaniesId.substring(0,4);
+        let apiType = this.attributionform.apiType;
+        if(list.includes(code) && apiType == '2' && !this.codeLoginVisible){
+            this.$api.sys.sendLoginSmsCode(this.attributionform).then((res) => {
+                if (res.code != '200') {
+                    this.$message.error(res.msg);
+                }
+            })
+            this.codedialogVisible = true
+            return
+        }
         let upparams = {
           agreementId: this.agreementId,
           agreement: this.agreement,
@@ -4428,7 +4440,7 @@ export default {
             }
           });
       }
-    
+
     },
     //分页条数
     handleSizeChange(val) {