From e5de5e13e933d67450eb86b90ff3483cdd6cacfc Mon Sep 17 00:00:00 2001 From: xiaohei <11674173+xiaohei102908@user.noreply.gitee.com> Date: Mon, 11 Dec 2023 10:35:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC3.8.0=20=202023-12-11=20=20lj?= =?UTF-8?q?d=201=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=BA=E8=84=B8=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E6=98=AFbase64=EF=BC=8C=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E4=BC=A0=E8=BF=87=E5=8E=BB=E7=9A=84=E6=95=B0=E6=8D=AE=E6=98=AF?= =?UTF-8?q?=E7=89=B9=E5=BE=81=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 11 ++++++++++- src/api/index.js | 16 +++++++++++++++- src/store/index.js | 1 + src/utils/util.js | 33 +++++++++++++++++++++++++++++++++ src/views/userManagement.vue | 2 +- 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/config/index.js b/config/index.js index 9192788..b7a4306 100644 --- a/config/index.js +++ b/config/index.js @@ -19,6 +19,15 @@ module.exports = { //重写路径 '^/api': '' //代理路径 } + }, + '/face-api1':{ + target: 'https://139.196.122.181:443/', + changeOrigin: true, //是否跨域 + secure: false, + pathRewrite: { + //重写路径 + '^/face-api1': '' //代理路径 + } } }, configureWebpack: { @@ -30,7 +39,7 @@ module.exports = { } } }, - host: '192.168.1.2', + host: '192.168.1.11', port: 8082, autoOpenBrowser: false, errorOverlay: true, diff --git a/src/api/index.js b/src/api/index.js index 01ada54..381bc5b 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -2,6 +2,7 @@ import request from '../utils/request'; import request1 from '../utils/request1'; import request2 from '../utils/request2'; import request3 from '../utils/requsetThree.js'; +import request4 from "../utils/request4"; import JSEncrypt from 'jsencrypt' import url1 from '../utils/url' const httpGet = (query,url) => { @@ -11,6 +12,19 @@ const httpGet = (query,url) => { params: query }); }; +const httpPostE = (query,url) => { + let url1='' + // if (process.env.NODE_ENV === "development") { + // url1='/face-api1' + // }else { + // url1='' + // } + return request4({ + url: url1+url, + method: "POST", + data: query + }); +}; // const httpGet2 = (query,url) => { // return request4({ // url:url1 +url, @@ -98,4 +112,4 @@ const silentRequest = (query,url) => { params: query }); }; -export {httpGet,RefreshToken,httpPost,setCode,httpGet1,httpPost1,download,httgetaxio,httgetaxio1,downloadPost,httpPostno,httpGetno,silentRequest} +export {httpGet,RefreshToken,httpPost,setCode,httpGet1,httpPost1,download,httgetaxio,httgetaxio1,downloadPost,httpPostno,httpGetno,silentRequest, httpPostE} diff --git a/src/store/index.js b/src/store/index.js index fc15114..84d26b8 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -18,6 +18,7 @@ import moment from "moment" } from "../utils/index"; const store = new Vuex.Store({ state: { + facemessage: {}, treeList:[], tenantId: '1200', // tenantId: '100', diff --git a/src/utils/util.js b/src/utils/util.js index 07dc149..5dd83b6 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -62,6 +62,39 @@ FromBase64(base64) { return new Buffer.from(base64, "base64").toString(); } + static facetransform(imagebase64){ + console.log(imagebase64) + var realSecret = "MIID6zCCAtOgAwIBAgIUdA7us4MQkpVkpNFKDsYOCjyTYSAwDQYJKoZIhvcNAQELBQAwgYQxCzAJBgNVBAYTAkNOMREwDwYDVQQIDAhzaGFuZ2hhaTEPMA0GA1UEBwwGcHVkb25nMREwDwYDVQQKDAhhaXZhdGVjaDENMAsGA1UECwwEYWl2YTENMAsGA1UEAwwEYWl2YTEgMB4GCSqGSIb3DQEJARYRMTk4MzY0NTAxMkBxcS5jb20wHhcNMjMwNDIwMDQzNTI3WhcNMzMwNDE3MDQzNTI3WjCBhDELMAkGA1UEBhMCQ04xETAPBgNVBAgMCHNoYW5naGFpMQ8wDQYDVQQHDAZwdWRvbmcxETAPBgNVBAoMCGFpdmF0ZWNoMQ0wCwYDVQQLDARhaXZhMQ0wCwYDVQQDDARhaXZhMSAwHgYJKoZIhvcNAQkBFhExOTgzNjQ1MDEyQHFxLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ+WYvWBTBsvc16hUz41NEiaDAgondSvx3kFVhZ87jWMNFRflrPwzNgju5F2ta9GDcjyvDvswIGtTNR5n6DnYkeCBD9eW8bt/xbfvAS7Bq6JB/73/+DvI51Zh+gtvUDq4wULyVY5CM0pfFp6YzIZbp0V3vKBOrNBEXMbLXfQXkM7yo0TNOtpHqtgDz4/JB7/EQO7vv+lEMEdceqzqNE8Wqzvdvu5nwNdcckE7M3EoZNHNUjT6B9dEnVzgc9Nn25qyM/2iQoNayw04w+sTG22UZ+0CZ4X1W4oBa57oOno0QyGjSj6aUsPl+zC/ApqatRguUbimRyEWdIIrR88eEPTw5UCAwEAAaNTMFEwHQYDVR0OBBYEFFqKMU62KCTAYFE1AS4pFYmpX5enMB8GA1UdIwQYMBaAFFqKMU62KCTAYFE1AS4pFYmpX5enMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE9xWE2n68DkdCX+IeDb00ynTEm49Ms/pmoXWMqsEM15L3jLk93pXW+UOJinO8avyyWlOG97TTGSG52gq7TEPTBrP8vO7vd9pCtZ1zyKOcUhc8s3CAinffvGu9EltoNkcyKJkGq6ZO4vZA6a8d7PohrA671KwXn7JQ05qzYuZsHoCWul88pJyS5kEynjgBRe8lu4VD2qN1bzF6nhvCuy751itTRZVvfqez9iMBwqN76hq533AuZZCcLqhuW6o6BOk3JYJMPQk/FfDKYBoq//D2hJfFYdM7MEGE4oFEqVxKcNX3kjR9tJvnx1X10zzXDtvnOMzhOTH6nkZkCbGy/Xno4=" + var ctimestamp = (moment().valueOf()).toString() + // var ctimestamp = "1599648837833" + var cnonce = '123456' + var requestParam = "" + var uri = "/v1/api/feature/extract" + var method = "POST" + var firmwareVersion = "SU18L_FT-V0.12.4.2" + var requestBodyMd5 = "" + var requestBodyJson = "" + var signStr = "" + var map = { + "featureVersion": "V0.3.5", + "imageBase64": imagebase64, + "imageType": "jpg", + "firmwareVersion": "SU18L_FT-V0.12.4.2" + } + console.log(map) + requestBodyMd5 = md5(JSON.stringify(map)) + signStr = uri+'-'+method+'-'+requestParam+'-'+requestBodyMd5+'-'+realSecret+'-'+ + ctimestamp+'-'+cnonce+'-'+'appkey1' + console.log(signStr) + var csign = md5(signStr) + return { + "firmwareVersion": firmwareVersion, + "ctimestamp": ctimestamp, + "featureVersion": "V0.3.5", + // "csign": "8c265dee9d01c65eef98c4962c9ce037" + "csign": csign + } + } static decrypt(word, keyStr) { diff --git a/src/views/userManagement.vue b/src/views/userManagement.vue index a0a084d..262e1d9 100644 --- a/src/views/userManagement.vue +++ b/src/views/userManagement.vue @@ -1178,7 +1178,7 @@ export default { }, methods: { getFaceData(val) { - this.faceData = val.split(',')[1] + this.faceData = val }, // 获取全部合同 getLeasesList() {