From acc90863c49a9059c7a865d8fd600a4d3a55f86f Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期三, 22 十二月 2021 17:03:54 +0800
Subject: [PATCH] fix bug: jwt、mobile userid

---
 js/changable_params.js |    2 +-
 js/function_1001.js    |    2 +-
 js/index.js            |    3 +++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/js/changable_params.js b/js/changable_params.js
index cbdbd81..f894e37 100644
--- a/js/changable_params.js
+++ b/js/changable_params.js
@@ -49,7 +49,7 @@
   , 3003: ['#00EE00', '#FF9F7F', '#FFD700', '#ff6600', '#ff0066', '#ff6666']
 }
 
-var default_system_params = { geoserver_url_predix: 'http://58.246.27.194:7011/', nodejs_url_predix: 'http://58.246.27.194:7012/', userid: 2, queryDataType: 'hour', weathercitycode: '101020100', wind360: 0, windSpeed: 10, is_single_taxi_replaying: false,summary_topN_count :50, un_authorization_url: 'http://www.sohu.com'};
+var default_system_params = { geoserver_url_predix: 'http://223.167.111.168:7001/', nodejs_url_predix: 'http://223.167.111.168:7012/', userid: 2, queryDataType: 'hour', weathercitycode: '101020100', wind360: 0, windSpeed: 10, is_single_taxi_replaying: false,summary_topN_count :50, un_authorization_url: 'http://www.sohu.com'};
 var default_grid_camerview = {grid5000:{"lat":30.306622,"lng":121.251151,"alt":180451,"heading":2,"pitch":-61},grid3000:{"lat":31.076898,"lng":121.418675,"alt":36483,"heading":2,"pitch":-61},grid1000:{"lat":31.216173,"lng":121.350382,"alt":8883,"heading":2,"pitch":-60}};
 
 function bindPopupFunction(event) {
diff --git a/js/function_1001.js b/js/function_1001.js
index 81e3450..3e7af16 100644
--- a/js/function_1001.js
+++ b/js/function_1001.js
@@ -13,7 +13,7 @@
     pid: item.pid,
     name: item.name,
     type: "wms",
-    url: mars3d.global_variables.geoserver_url_predix + "/geoserver/konglu_58/wms",
+    url: mars3d.global_variables.geoserver_url_predix + "geoserver/konglu_58/wms",
     layers: "konglu_58:" + item.geoname_prefix + mars3d.global_variables.queryDataType,
     crs: "EPSG:4326",
     parameters: {
diff --git a/js/index.js b/js/index.js
index 18f48d4..f20c5ef 100644
--- a/js/index.js
+++ b/js/index.js
@@ -23,8 +23,11 @@
     var strs_ = jwtstr.split('.');
     var jwt_header_ = new buffer.Buffer(strs_[0].toString('base64'), 'base64').toString();
     var jwt_payload_ = new buffer.Buffer(strs_[1].toString('base64'), 'base64').toString();
+    var payload_ = JSON.parse(jwt_payload_);
+    mars3d.global_variables.userid = payload_.userid;
     var hash = CryptoJS.HmacSHA256(strs_[0] + '.' + strs_[1], "sxyd");
     var hashInBase64 = base64UrlEncode(hash);
+
     var reg = RegExp(strs_[2]);
     if (!reg.exec(hashInBase64)) {
       // verification failed, go back

--
Gitblit v1.9.1