Browse Source

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

liujiayin 2 years ago
parent
commit
b7b148afd8
2 changed files with 37 additions and 40 deletions
  1. 36 39
      src/api/platform/form/seal.js
  2. 1 1
      src/plugins/ibps/index.js

+ 36 - 39
src/api/platform/form/seal.js

@@ -1,6 +1,9 @@
 import request from '@/utils/request'
 import request from '@/utils/request'
 import { FORM_URL } from '@/api/baseUrl'
 import { FORM_URL } from '@/api/baseUrl'
 import axios from 'axios'
 import axios from 'axios'
+
+const BASE_URL = process.env.VUE_APP_BASE_URL
+
 /**
 /**
  * ca电子签章接口
  * ca电子签章接口
  * @param {*} params
  * @param {*} params
@@ -62,64 +65,58 @@ export const onlyOfficeToPdf = params => {
 }
 }
 
 
 /* 自动微签:脚本对文件盖章 */
 /* 自动微签:脚本对文件盖章 */
-export function seal(url, fileType, type) {
-    let Base64 = require('js-base64').Base64
-    let data = {
-        "signKey": "V1FTMjAyMTEyMjFkOTVjNWM=",
-        "signSecret": "YWQwMmY3ZjQ4ZDJmMmYwNDA=",
-        "sealUser": "YWRtaW4=",
-        "password": "MTIzNA==",
-        //"ruleName": "6aqR57yd56ug6KeE5YiZLOmmlumhteeblueroA==",
-        "ruleName": type,
-        "provideSigFile": Base64.encode(url),
-        "fileKey": Base64.encode(generateUUID() + '.' + fileType)
+export function seal (url, fileType, type) {
+    const Base64 = require('js-base64').Base64
+    const data = {
+        'signKey': 'V1FTMjAyMTEyMjFkOTVjNWM=',
+        'signSecret': 'YWQwMmY3ZjQ4ZDJmMmYwNDA=',
+        'sealUser': 'YWRtaW4=',
+        'password': 'MTIzNA==',
+        // "ruleName": "6aqR57yd56ug6KeE5YiZLOmmlumhteeblueroA==",
+        'ruleName': type,
+        'provideSigFile': Base64.encode(url),
+        'fileKey': Base64.encode(generateUUID() + '.' + fileType)
     }
     }
     return axios({
     return axios({
-        url: 'https://www.szjyxt.com/doSeal/',
+        url: `${BASE_URL}doSeal/`,
         method: 'post',
         method: 'post',
         data: data
         data: data
     })
     })
 }
 }
 
 
 /* 手动微签:脚本对文件进行手动盖章-预处理 */
 /* 手动微签:脚本对文件进行手动盖章-预处理 */
-export function sealPre(url, fileKey) {
-    let Base64 = require('js-base64').Base64
-    let data = {
-        "signKey": "V1FTMjAyMTEyMjFkOTVjNWM=",
-        "signSecret": "YWQwMmY3ZjQ4ZDJmMmYwNDA=",
-        "sealUser": "YWRtaW4=",
-        "password": "MTIzNA==",
-        "provideSigFile": Base64.encode(url),
+export function sealPre (url, fileKey) {
+    const Base64 = require('js-base64').Base64
+    const data = {
+        'signKey': 'V1FTMjAyMTEyMjFkOTVjNWM=',
+        'signSecret': 'YWQwMmY3ZjQ4ZDJmMmYwNDA=',
+        'sealUser': 'YWRtaW4=',
+        'password': 'MTIzNA==',
+        'provideSigFile': Base64.encode(url),
         // "getSigFile":  Base64.encode(this.$form.$getSigFile),
         // "getSigFile":  Base64.encode(this.$form.$getSigFile),
-        "getSigFile": Base64.encode('https://www.szjyxt.com/#/sealCompleted'),
-        "fileKey": Base64.encode(fileKey),
+        'getSigFile': Base64.encode(`${BASE_URL}#/sealCompleted`),
+        'fileKey': Base64.encode(fileKey)
     }
     }
     return axios({
     return axios({
-        url: 'https://www.szjyxt.com/preprocess/' ,
+        url: `${BASE_URL}preprocess/`,
         method: 'post',
         method: 'post',
         data: data
         data: data
     })
     })
 }
 }
 
 
 /* 手动微签:脚本对文件进行手动盖章-手动签章页面的url */
 /* 手动微签:脚本对文件进行手动盖章-手动签章页面的url */
-export function getSigPageUrl(sigFile) {
-    let sigUrl = 'http://120.77.249.241:9999/manualSig/manualSigPage/?signKey=V1FTMjAyMTEyMjFkOTVjNWM=&signSecret=YWQwMmY3ZjQ4ZDJmMmYwNDA=&sigFile=' + sigFile;
+export function getSigPageUrl (sigFile) {
+    const sigUrl = 'http://120.77.249.241:9999/manualSig/manualSigPage/?signKey=V1FTMjAyMTEyMjFkOTVjNWM=&signSecret=YWQwMmY3ZjQ4ZDJmMmYwNDA=&sigFile=' + sigFile
     return sigUrl
     return sigUrl
 }
 }
 
 
-export function generateUUID() {
-    var d = new Date().getTime();
+export function generateUUID () {
+    var d = new Date().getTime()
     var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
     var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
-        var r = (d + Math.random() * 16) % 16 | 0;
-        d = Math.floor(d / 16);
-        return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
-    });
-    return uuid;
-};
-
-
-
-
-
-
+        var r = (d + Math.random() * 16) % 16 | 0
+        d = Math.floor(d / 16)
+        return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)
+    })
+    return uuid
+}
 
 

+ 1 - 1
src/plugins/ibps/index.js

@@ -83,7 +83,7 @@ export default {
                 Vue.prototype.$reportPath = `${BASE_URL}demo/reportJsp/showReport.jsp?access_token=${getToken()}&rpx=${reportPath}/`
                 Vue.prototype.$reportPath = `${BASE_URL}demo/reportJsp/showReport.jsp?access_token=${getToken()}&rpx=${reportPath}/`
                 Vue.prototype.$getReportFile = downloadReport // 通过方法函数,拼接url,并将字符串格式化
                 Vue.prototype.$getReportFile = downloadReport // 通过方法函数,拼接url,并将字符串格式化
                 Vue.prototype.$getSealUri = 'http://120.77.249.241:9999/no/getSealFile/' // 微签 回显获取文件地址
                 Vue.prototype.$getSealUri = 'http://120.77.249.241:9999/no/getSealFile/' // 微签 回显获取文件地址
-                Vue.prototype.$getFileDow = 'https://www.szjyxt.com/ibps/platform/v3/file/download?attachmentId=' // 文件下载地址
+                Vue.prototype.$getFileDow = `${process.env.VUE_APP_BASE_URL}ibps/platform/v3/file/download?attachmentId=` // 文件下载地址
                 clearInterval(timer) // 添加成功后即删除定时任务
                 clearInterval(timer) // 添加成功后即删除定时任务
             }
             }
         }, 500)
         }, 500)