From 5cca41e6d141e1366776c8580c732082ec50c487 Mon Sep 17 00:00:00 2001
From: 1012414140@qq.com <1012414140@qq.com>
Date: 星期五, 16 十月 2026 11:03:41 +0800
Subject: [PATCH] feat: 恢复code2 的获取方式
---
src/components/page/IndexXTYH.vue | 43 +++++++++++++++++++------------------------
1 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/src/components/page/IndexXTYH.vue b/src/components/page/IndexXTYH.vue
index 97fb194..a53b450 100644
--- a/src/components/page/IndexXTYH.vue
+++ b/src/components/page/IndexXTYH.vue
@@ -228,6 +228,8 @@
}
},
created(){
+ //39鏈嶅姟鍣ㄧ敤鐨勬槸code2瀛楁锛�183鏈嶅姟鍣ㄧ敤鐨勬槸code瀛楁锛岃繖鏍峰氨鍙互杈惧埌183璁块棶鐨勬椂鍊欓噸鏂拌烦杞埌39鏈嶅姟鍣ㄩ〉闈�
+
this.$message = Message; // 鎸傝浇鍏ㄥ眬Message锛岄伩鍏嶉噸澶嶅紩鍏�
this.code = ''
this.code2 = ''
@@ -254,36 +256,28 @@
return;
}
- var url = decodeURIComponent(window.location.href);
- const getUrlParams=(url) => {
- const params = {};
- const queryIndex = url.indexOf('?');
- if (queryIndex === -1) return params;
- const query = url.slice(queryIndex + 1);
- query.split('&').forEach(item => {
- const [key, val] = item.split('=');
- if (key) params[key] = val || '';
- });
- return params;
- }
-
- const params = getUrlParams(url);
- this.code = params.code || '';
- this.code2 = params.code2 || '';
-
- // 浼樺寲璺宠浆閫昏緫锛堥伩鍏嶉噸澶嶈烦杞級
- if (Object.keys(params).length > 2 && params.code && params.code2) {
- // 浠呭綋鍙傛暟瀹屾暣鏃惰烦杞紙閬垮厤鏃犻檺寰幆锛�
- window.location.href = `http://hesuancj.cn/#/index2?code=${encodeURIComponent(params.code)}&state=STATE&code2=${encodeURIComponent(params.code2)}`;
+ var url = window.location.href;
+ url = decodeURIComponent(url)
+ var count = url.split('?').length-1;
+ if(count >1){ //鑾峰彇鐢ㄦ埛淇℃伅鍚庤烦鍥炴潵鏈〉闈�
+ let data = this.getCodeFromUrl(url)
+ window.location.href = `http://hesuancj.cn/#/index2?code=${encodeURIComponent(data.code)}&state=STATE&code2=${encodeURIComponent(data.code2)}`
return;
}
-
+ var cs = url.split('?')[1];
+ var cs_arr = cs.split('&');
+ var cs={};
+ for(var i=0;i<cs_arr.length;i++){
+ cs[cs_arr[i].split('=')[0]] = cs_arr[i].split('=')[1]
+ }
+ this.code2 = cs.code2;
+ this.code = cs.code;
//鍒濆鍖栬烦杞� 39 鏈嶅姟鍣�
if(this.code2 == null || this.code2 == ''){
- window.location.href = `http://hesuancj.cn/#/index2?code2=${params.code || ''}`;
- //window.location.href = "http://60.0.121.40:8889/#/IndexXTYH39?code2="+cs.code //娴嬭瘯鐢ㄧ殑
+ window.location.href = "http://hesuancj.cn/#/index2?code2="+cs.code //姝e紡
return;
}
+
if(this.code != null && this.code != '') {
this.dialogVisible = true //绔嬪嵆鏀粯寮规
}else {
@@ -518,6 +512,7 @@
if(this.type == 0 ){
//寰俊锛岃幏鍙朿ode
if(this.code==null||this.code==""){
+ this.$message.loading("姝e湪璺宠浆寰俊鎺堟潈...", 0)
var url = encodeURIComponent("http://hesuancj.cn/#/index2?code2="+this.code2);
// window.location.href = `http://192.168.0.8:8082/#/Index2?code=${encodeURIComponent('123')}&state=STATE?code2=${encodeURIComponent(this.code2)}`
// window.location.href =url;
--
Gitblit v1.9.1