zjs_project hai 1 ano
pai
achega
6caf60659d

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3 - 0
src/assets/crypto-js.min.js


+ 3 - 3
src/pages/webgl_rxdz_env/webgl_rxdz_env.vue

@@ -69,7 +69,7 @@
 		mounted(options) {
 			console.log("***onLoad-webgl_rxdz_customize***", this.$route.query)
 			const that = this;
-			this.houseId = this.$route.query.houseId ? this.$route.query.houseId : '';
+			this.houseId = this.$route.query.houseId ? this.$route.query.houseId : (this.$store.state.houseId || '');
 			// this.spaceId = this.$route.query.spaceId?this.$route.query.spaceId:'';
 			this.id = this.$route.query.id ? this.$route.query.id : '111';
 			this.queryTestcaseSingle();
@@ -292,7 +292,7 @@
 				// houseData.expand = expand;
 				let param = {
 					"brandId": $config.brandId,
-					"houseId": curHouseObj.houseId,
+					"houseId": this.houseId || curHouseObj.houseId,
 					"userId": userId,
 					"floot": 1,
 					"spaceName": curHouseObj.name,
@@ -314,7 +314,7 @@
 				loading.close();
 				if(res && res.success && res.single){//提交成功
 					let data = {
-						houseId:this.houseId,
+						houseId:this.houseId || curHouseObj.houseId,
 						id:res.single,
 					}
 					router.push({

+ 13 - 2
src/pages/webgl_rxdz_text_customize/webgl_rxdz_text_customize.vue

@@ -177,6 +177,7 @@ export default {
 		    } else {
 		        this.fakeLeavePhone()
 		    }
+			this.isSend = false;
 		},
 		async fakeLeavePhone(){
 			let signParam = {
@@ -202,7 +203,13 @@ export default {
 					gdt_vid: "",
 					url: window.location.href,
 				};
-				requestConfig('authorizedMobile', parm, true);
+				let result = await requestConfig('authorizedMobile', parm, true);
+				if(result && result.success){
+					Toast({
+						message: '留电成功',
+					});
+				}
+				this.showUserInput = false;
 			}
 			
 		},
@@ -342,7 +349,11 @@ export default {
 					this.tabData.push(data);
 				})
 				this.gsImage = this.form.layoutImgCustomized;//获取高斯模糊的图片
-            }
+            }else{
+				Toast({
+					message: '作品未找到!',
+				});
+			}
         },
         changeTab(id){
             if(id == this.tabIndex){

+ 38 - 2
src/services/requestConfig.js

@@ -1,6 +1,9 @@
 import store from "@/store";
-
+import CryptoJS from '@/assets/crypto-js.min.js';
 var doubleClickList = []; //防连击的数组对象
+var keys = "ELAB_AUTHOPENAPI";
+var iv = "ELAB_SECRET_APIS";
+
 // 请求地址对象
 const endpoints = {
     upload: 'elab-marketing-system/behavior/brandMiniWeb/upload', //埋点接口
@@ -53,6 +56,24 @@ const endpoints = {
 	submitAnswer: 'elab-marketing-content/question/submitAnswer',//答题
 	// predictions: "https://api.replicate.com/v1/deployments/feathers-wing/spacely-realistic-style-softedge-a100/predictions", // 分享查看
 };
+/**
+ * 加密参数
+ * @param content
+ * @returns {string}
+ * @constructor
+ */
+function AES_encrypt(content) {
+	content = JSON.stringify(content);
+	let param = CryptoJS.enc.Utf8.parse(content);
+	let _key = CryptoJS.enc.Utf8.parse(keys);
+	let _iv = CryptoJS.enc.Utf8.parse(iv);
+	let encrypted = CryptoJS.AES.encrypt(param, _key, {
+		mode: CryptoJS.mode.CBC,
+		padding: CryptoJS.pad.Pkcs7,
+		iv: _iv,
+	});
+	return encrypted.ciphertext.toString();
+}
 // var source = CancelToken.source();
 window.requestConfig = async(endpoint, options, isHideLoading = false, preventDoubleClick = false, method = 'post',uploadProgress=null,cancel=null) => {
 	if (!endpoints.hasOwnProperty(endpoint)) {
@@ -65,6 +86,11 @@ window.requestConfig = async(endpoint, options, isHideLoading = false, preventDo
         path: endpoints[endpoint],
         data: options,
     };
+	let encryptedData = '';
+	if (endpoint.indexOf('authorizedMobile') >= 0) {
+	    encryptedData = await AES_encrypt(requestOptions.data);
+	    requestOptions.data = {};
+	}
     if (preventDoubleClick) {
         //说明该接口需要防止连击
         if (doubleClickList[requestOptions.path] && doubleClickList[requestOptions.path].isRunning) {
@@ -98,6 +124,10 @@ window.requestConfig = async(endpoint, options, isHideLoading = false, preventDo
     if (isHideLoading) {
         store.state.loading = false; //显示loading态
     }
+	if (encryptedData) {
+		requestOptions.headers = {};
+	    requestOptions.headers.sign = encryptedData;
+	}
     if (requestOptions.url.includes('elab-marketing-analyse/heavenlyEye/importLocations') ||
         requestOptions.url.includes('elab-marketing-sms/aliyun/openapi/uploadOss') ||
 		requestOptions.url.includes('/robust_video')) {
@@ -131,7 +161,13 @@ window.requestConfig = async(endpoint, options, isHideLoading = false, preventDo
 			}
 			response = await axios.post(requestOptions.url, requestOptions.data,_dt);
 		}else{
-			response = await axios.post(requestOptions.url, requestOptions.data);
+			if(requestOptions.headers){
+				response = await axios.post(requestOptions.url, requestOptions.data,{
+					headers:requestOptions.headers
+				});
+			}else{
+				response = await axios.post(requestOptions.url, requestOptions.data);
+			}
 		}
         
     }