Procházet zdrojové kódy

完成B证书接口联通

littlegreen před 2 roky
rodič
revize
cfdd2eae04

+ 4 - 1
ruoyi-system/other.http

@@ -3,5 +3,8 @@ POST http://127.0.0.1:8080/system/contract/getInfoByCode
 Content-Type: application/json
 
 {
-
+  "certNumber": "1111",
+  "code": "3",
+  "userName": "刘昊然",
+  "uuid": "1584eb9ca764495790d55cb988698b88"
 }

+ 0 - 9
ruoyi-ui/src/api/cert.js

@@ -1,9 +0,0 @@
-import request from '@/utils/request'
-
-export function getCert(data) {
-    return request({
-      url: '/system/grad/list',
-      method: 'post',
-      data: data
-    })
-}

+ 12 - 0
ruoyi-ui/src/api/login.js

@@ -56,4 +56,16 @@ export function getCodeImg() {
     method: 'get',
     timeout: 20000
   })
+}
+
+export function checkCode(data) {
+  return request({
+    url: '/captchaCheck',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    timeout: 20000,
+    data:data
+  })
 }

+ 23 - 0
ruoyi-ui/src/api/system/contract.js

@@ -42,3 +42,26 @@ export function delContract(id) {
     method: 'delete'
   })
 }
+
+//获取B类证书 
+export function getCert(data) {
+  return request({
+    url: '/system/contract/getInfoByCode',
+    method: 'post',
+    headers : {
+      isToken : false
+    },
+    data: data
+  })
+}
+
+export function checkCode(data){
+  return request({
+    url: '/system/contract/captchaCheck',
+    method: 'post',
+    headers : {
+      isToken : false
+    },
+    data: data
+  })
+}

+ 7 - 3
ruoyi-ui/src/permission.js

@@ -15,9 +15,13 @@ router.beforeEach((to, from, next) => {
   if (getToken()) {
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
     /* has token*/
-    if (to.path === '/login') {
-      next({ path: '/' })
-      NProgress.done()
+    if (whiteList.indexOf(to.path) !== -1) {
+      if (to.path === '/login'){
+        next({ path: '/' })
+        NProgress.done()
+      }else{
+        next()
+      }
     } else {
       if (store.getters.roles.length === 0) {
         isRelogin.show = true

+ 36 - 9
ruoyi-ui/src/views/certInquire/member/index.vue

@@ -35,8 +35,8 @@
 </template>
   
 <script>
-import { getCodeImg } from "@/api/login";
-import { getCert } from "@/api/cert"
+import { getCodeImg,checkCode } from "@/api/login";
+import { getCert } from "@/api/system/contract";
 export default {
   data() {
     return {
@@ -59,19 +59,46 @@ export default {
         }
       });
     },
-    handleSearch(){
+    async handleSearch(){
+        if( this.isBlock(this.userName)){
+          this.$message.error("请输入持证人姓名或单位名称!")
+          return;
+        }
+        if( this.isBlock(this.certNumber)){
+          this.$message.error("请输入证书编码!")
+          return;
+        }
+        if( this.isBlock(this.code)){
+          this.$message.error("请输入验证码!")
+          return;
+        }
         const form = {
-            userName: this.userName,
-            certNumber: this.certNumber,
-            code: this.code,
-            uuid: this.uuid
+          userName: this.userName,
+          certNumber: this.certNumber,
+        }
+        const codeForm = {
+          code: this.code,
+          uuid: this.uuid
         }
-        console.log(form)
+        let codeRes = await checkCode(codeForm)
+        if(codeRes.code===200 && codeRes.msg==="success"){
+          getCert(form).then(res=>{
+            console.log(res)
+          })
+        }
+        // console.log(codeRes)
+    },
+    isBlock(str){
+      if(str===""){
+        return true
+      }else {
+        return false
+      }
     }
-
   },
   mounted(){
     this.getCode()
+
   }
 };
 </script>

+ 1 - 0
ruoyi-ui/vue.config.js

@@ -36,6 +36,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         target: `http://localhost:8080`,
+        // target: `http://192.168.0.100:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''