Browse Source

新增国密SM3加密

xieqy 2 years ago
parent
commit
278cd8e49d

+ 4 - 2
src/bigDataPanel/index.html

@@ -24,7 +24,8 @@
                 </div>
                 <div class="progressContainer">
                     <div class="progress">
-                        <div class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar" data-count="0" style="width: 0%">
+                        <div class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar"
+                            data-count="0" style="width: 0%">
                             0%
                         </div>
                     </div>
@@ -32,7 +33,7 @@
             </div>
         </div>
         <div class="bigDataPanle">
-         <div class='goToSys'></div>
+            <div class='goToSys'></div>
         </div>
         <div class="error">
             <span class="errorInfoUsername"></span>
@@ -40,6 +41,7 @@
     </div>
 </body>
 <script type="text/javascript" src="../vendor/jquery-3.3.1/jquery.min.js"></script>
+<script type="text/javascript" src="../vendor/js-security/sm3.js"></script>
 <script type="text/javascript" src="../vendor/js-security/sha1.js"></script>
 <script type="text/javascript" src="../vendor/js-cookie-2.1.3/cookie.min.js"></script>
 <script type="text/javascript" src="./js/login.js"></script>

+ 17 - 16
src/configure.ts

@@ -14,19 +14,20 @@ var AppX = {
         "activeSystemId": "sys",//当前子系统id
         "activeSystemModel": "list",//当前UI模式,地图模式“map”,列表模式“list”
         "loadHomePage": "false",//是否加载首页
-        "hasHomePage":false,
+        "hasHomePage": false,
         "wkid": 4326,//系统使用坐标系wkid
         "initExtent": { xmax: 117.1768887, ymax: 34.2601264, xmin: 117.1734544, ymin: 34.2575668 },//地图初始范围 
         "excavationRegion": [104.678724018602, 31.5467934286538, 600, 104.706247791155, 31.5467892556996, 600, 104.704816666531, 31.5288749593986, 600, 104.679306640162, 31.5296956607958, 600],//开挖范围
         "excavationDepth": 1000,//开挖深度,单位m
         "transparentLayers": ["Config"],//透明地表
         //"apiRoot": "http://10.37.25.78:8568",//后台接口地址    
-        "apiRoot": "https://yeepms.yeec.com.cn/gis-api",//后台接口地址
-        "myDeskUrl":"https://uac.ctg.com.cn/sso/login",//mydesk地址 
-        "epcSys":"https://yeepms.yeec.com.cn/gis/yc/#/login",//决策分析平台   
+        // "apiRoot": "https://yeepms.yeec.com.cn/gis-api",//后台接口地址
+        "apiRoot": "https://tgdcepc.ctg.com.cn:8443/gis-api",//后台接口地址
+        "myDeskUrl": "https://uac.ctg.com.cn/sso/login",//mydesk地址 
+        "epcSys": "https://yeepms.yeec.com.cn/gis/yc/#/login",//决策分析平台   
         "userToken": "",//系统用户token
-        "currentPrj":undefined,//当前项目
-        "lastSessionTime":new Date().getTime(),//最新操作时间
+        "currentPrj": undefined,//当前项目
+        "lastSessionTime": new Date().getTime(),//最新操作时间
         "deptName": "",
         "realName": "",
         "userSkyId": "",
@@ -39,9 +40,9 @@ var AppX = {
         "imageopacity": null,//地表透明
         "groundopacity": 0.1,//地表透明度
         "downDepth": 0,//默认管网高度
-        "upDepth":0,//管网抬升高度
+        "upDepth": 0,//管网抬升高度
         "initPosition": [{
-            id:1,//岳阳
+            id: 1,//岳阳
             position: {
                 x: -2204482.2366905585,
                 y: 5150077.372278957,
@@ -57,8 +58,8 @@ var AppX = {
                 y: -0.44955502587622165,
                 z: 0.8715616431164707
             }
-        },{
-            id:30,//岳阳
+        }, {
+            id: 30,//岳阳
             position: {
                 x: -2204482.2366905585,
                 y: 5150077.372278957,
@@ -74,8 +75,8 @@ var AppX = {
                 y: -0.44955502587622165,
                 z: 0.8715616431164707
             }
-        },{
-            id:43,//华容
+        }, {
+            id: 43,//华容
             position: {
                 x: -2204482.2366905585,
                 y: 5150077.372278957,
@@ -91,8 +92,8 @@ var AppX = {
                 y: -0.44955502587622165,
                 z: 0.8715616431164707
             }
-        },{
-            id:25,//诸暨
+        }, {
+            id: 25,//诸暨
             position: {
                 x: -2814850.568371547,
                 y: 4799297.654890055,
@@ -1383,7 +1384,7 @@ var AppX = {
                 "name": "专题地图服务",
                 "type": "theme",
                 "config": [
-                    
+
                 ]
             }
         }
@@ -1438,7 +1439,7 @@ var AppX = {
             },
             {
                 name: "vue",
-                location: root+"/vendor/vue-2.6.8/",
+                location: root + "/vendor/vue-2.6.8/",
                 main: "vue.min"
             },
             {

+ 9 - 7
src/controlPanel/index.html

@@ -25,7 +25,8 @@
                 </div>
                 <div class="progressContainer">
                     <div class="progress">
-                        <div class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar" data-count="0" style="width: 0%">
+                        <div class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar"
+                            data-count="0" style="width: 0%">
                             0%
                         </div>
                     </div>
@@ -39,15 +40,15 @@
         </div>
         <div class="logoContainer">
             <p>
-                     <img src='./css/img/companymark.png' />
-               三峡发展智慧EPC管网施工
+                <img src='./css/img/companymark.png' />
+                三峡发展智慧EPC管网施工
             </p>
         </div>
-              <div class='titlespan'>
-                  系统切换
-            </div>
+        <div class='titlespan'>
+            系统切换
+        </div>
         <div class='titleremark'>
-            </div>
+        </div>
         <div class="shadow  controlPanel">
             <table>
                 <tbody class="itemControl">
@@ -67,6 +68,7 @@
     </div>
 </body>
 <script type="text/javascript" src="../vendor/jquery-3.3.1/jquery.min.js"></script>
+<script type="text/javascript" src="../vendor/js-security/sm3.js"></script>
 <script type="text/javascript" src="../vendor/js-security/sha1.js"></script>
 <script type="text/javascript" src="../vendor/js-cookie-2.1.3/cookie.min.js"></script>
 <script type="text/javascript" src="../vendor/require/require.min.js"></script>

+ 11 - 8
src/index.html

@@ -28,7 +28,7 @@
     <link rel="stylesheet" href="./vendor/bootstrap-select-1.13.7/css/bootstrap-select.min.css">
     <link rel="stylesheet" href="./vendor/select2-4.1.0-rc.0/css/select2.min.css">
     <link rel="stylesheet" href="./vendor/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
-    <link rel="stylesheet" href="./vendor/jquery-viewer/css/viewer.min.css">   
+    <link rel="stylesheet" href="./vendor/jquery-viewer/css/viewer.min.css">
     <link rel="stylesheet" href="css/style.css" />
     <link rel="stylesheet" href="css/animate.min.css" />
     <link rel="stylesheet" href="./vendor/iCheck/build.css" />
@@ -36,7 +36,7 @@
     <script type="text/javascript" src="https://yeepms.yeec.com.cn/gis/supermapjs/leaflet/leaflet.js"></script>
     <script type="text/javascript" src="https://yeepms.yeec.com.cn/gis/supermapjs/ol/ol.js"></script>
     <link rel="stylesheet" href="./vendor/jtoggler/jtoggler.css">
-    <link rel="stylesheet" href="./vendor/videojs/video-js.min.css" rel="stylesheet">    
+    <link rel="stylesheet" href="./vendor/videojs/video-js.min.css" rel="stylesheet">
     <script src="./vendor/videojs/video.min.js"></script>
     <script src="./vendor/videojs/videojs-http-streaming.min.js"></script>
     <link rel="stylesheet" href="./vendor/datepicker/css/daterangepicker.css">
@@ -50,10 +50,11 @@
     <script src="./vendor/js-csv-encoding/js/encoding.min.js"></script>
     <script src="./vendor/file-saver/js/FileSaver.min.js"></script>
     <script src="./vendor/jquery-3.3.1/jquery.min.js"></script>
-    
+
     <script type="text/javascript" src="./vendor/datepicker/js/moment.js"></script>
     <script type="text/javascript" src="./vendor/datepicker/js/daterangepicker.js"></script>
 
+    <script type="text/javascript" src="./vendor/js-security/sm3.js"></script>
     <script type="text/javascript" src="./vendor/js-security/sha1.js"></script>
     <script src="./vendor/jquery-ui-1.12.1/jquery-ui.min.js"></script>
     <script src="./vendor/jquery-treetable/jquery.treetable.js"></script>
@@ -101,14 +102,16 @@
     <script src="./vendor/ext_cesium/tools/tools.min.js" type="text/javascript"></script>
     <script src="./vendor/jspdf/html2canvas-0.4.1.js" type="text/javascript"></script>
     <script language="javascript" type="text/javascript" src="./vendor/my97datepicker/WdatePicker.js"></script>
-    <script type="text/javascript" src="https://yeepms.yeec.com.cn/gis/supermap10iSP1/Build/supermap/SuperMap.Include.js"></script>
-    <script type="text/javascript" src="https://yeepms.yeec.com.cn/gis/supermapjs/leaflet/iclient9-leaflet.min.js"></script>
+    <script type="text/javascript"
+        src="https://yeepms.yeec.com.cn/gis/supermap10iSP1/Build/supermap/SuperMap.Include.js"></script>
+    <script type="text/javascript"
+        src="https://yeepms.yeec.com.cn/gis/supermapjs/leaflet/iclient9-leaflet.min.js"></script>
     <script type="text/javascript" src="https://yeepms.yeec.com.cn/gis/supermapjs/ol/iclient-ol.min.js"></script>
     <script type="text/javascript" src="./vendor/jtoggler/jtoggler.js"></script>
     <script type="text/javascript" src="./vendor/jquery-pagination-2.1.5/js/pages.js"></script>
-    
-    
-    
+
+
+
     <script>
         require(["./main.js"]);
     </script>

+ 1 - 0
src/login/index.html

@@ -185,6 +185,7 @@
     </div>
 </body>
 <script type="text/javascript" src="../vendor/jquery-3.3.1/jquery.min.js"></script>
+<script type="text/javascript" src="../vendor/js-security/sm3.js"></script>
 <script type="text/javascript" src="../vendor/js-security/sha1.js"></script>
 <script type="text/javascript" src="../vendor/js-cookie-2.1.3/cookie.min.js"></script>
 <script type="text/javascript" src="../vendor/require/require.min.js"></script>

+ 9 - 7
src/login/js/login.js

@@ -8,6 +8,7 @@ var configurejs = SYS_ADDR + "configure.js";
 
 const regPhone = () => /^1[3456789]\d{9}$/ // 手机号码验证
 const regNewPassword = () => /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9!@#$%&+-]{12,}$/ // 密码强度验证
+
 //const mydeskUrl="http://10.37.5.54:8080/UAC/sso/login";
 /* CONFIGURE END */
 require([configurejs], function (AppX) {
@@ -16,6 +17,7 @@ require([configurejs], function (AppX) {
 })
 
 function load() {
+    console.log(hex_sha1('13Sxgk@2478!'), sm3('13Sxgk@2478!'))
     // const search = window.location.search;
     // if(search){
     //     const token = getSearchString('token', search);
@@ -154,7 +156,7 @@ function load() {
                 url: API_ADDR + "/auth/oauth/token?project=8020",
                 data: {
                     "username": $.trim(userInput.val()) + "_UNIONLOGIN",
-                    "password": hex_sha1($.trim(passwordInput.val())),
+                    "password": sm3($.trim(passwordInput.val())),
                     "authCode": $.trim(msgInput.val())
                 },
                 type: "post",
@@ -279,6 +281,7 @@ function load() {
         $('.dialog-title').text('重置密码')
         $(".modelDialog").css('display', 'block');
         $('.next > span').text('下一步')
+        console.log(SM3.digest('13Sxgk@2478!', 'utf8', 'hex'))
     }.bind(this))
 
     //下一步获取验证码
@@ -310,6 +313,7 @@ function load() {
 
     function reset() {
         $('.usernameInput').val('')
+        $('.authCodeInput').val('')
         passParam = null
         modifyParam = null
         isPass = false
@@ -425,7 +429,7 @@ function load() {
         }
         const data = {
             ...passParam,
-            password: hex_sha1(checkNewPass)
+            password: sm3(checkNewPass)
         }
         $.ajax({
             url: API_ADDR + "/base/user/info/updatePasswordByUser",
@@ -482,8 +486,8 @@ function load() {
         let params = {
             // username,
             ...modifyParam,
-            originalPassword: hex_sha1(originalPassword),
-            password: hex_sha1(newPassword)
+            originalPassword: sm3(originalPassword),
+            password: sm3(newPassword)
         }
         $.ajax({
             url: API_ADDR + "/base/user/updatePassword",
@@ -508,9 +512,7 @@ function load() {
     }
 
     function showTipsInfo(className, text) {
-        if ($('.alertInfo').hasClass(className)) {
-            $('.alertInfo').removeClass(className)
-        }
+        $('.alertInfo').attr('class', 'alert alertInfo')
         $('.alertInfo').addClass(className)//'alert-success'
         $('.alertInfo > strong').text(text)
         $('.alertInfo').show()

+ 2 - 1
src/newsPage/index.html

@@ -22,13 +22,14 @@
                     <span class="department"></span>
                     <span class="publishtime"></span>
                 </div> -->
-                <hr/>
+                <hr />
             </div>
             <div class="content"></div>
         </div>
     </div>
 </body>
 <script type="text/javascript" src="../vendor/jquery-3.3.1/jquery.min.js"></script>
+<script type="text/javascript" src="../vendor/js-security/sm3.js"></script>
 <script type="text/javascript" src="../vendor/js-security/sha1.js"></script>
 <script type="text/javascript" src="../vendor/js-cookie-2.1.3/cookie.min.js"></script>
 <script type="text/javascript" src="../vendor/require/require.min.js"></script>

+ 15 - 9
src/projectSelectPanel/index.html

@@ -26,7 +26,8 @@
                 </div>
                 <div class="progressContainer">
                     <div class="progress">
-                        <div class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar" data-count="0" style="width: 0%">
+                        <div class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar"
+                            data-count="0" style="width: 0%">
                             0%
                         </div>
                     </div>
@@ -36,25 +37,30 @@
         <div class="bigDataPanle">
             <div class="projectTableContainer">
                 <div class="prjheader row">
-                    <div class="col-6"><h4>项目应用</h2><span class='enterBigScreen'>【进入大屏】</span></div>
+                    <div class="col-6">
+                        <h4>项目应用</h2><span class='enterBigScreen'>【进入大屏】</span>
+                    </div>
                     <div class="col-6">
                         <div class="input-group">
                             <input id="searchVal" placeholder="请输入查询条件" type="text" class="form-control">
                             <div class="input-group-append">
-                                <button id="searchClickBtn" class="btn btn-secondary"><i class="fa fa-search"></i></button>
-                                <button id="searchFreshBtn" class="btn btn-secondary"><i class="fa fa-refresh"></i></button>
+                                <button id="searchClickBtn" class="btn btn-secondary"><i
+                                        class="fa fa-search"></i></button>
+                                <button id="searchFreshBtn" class="btn btn-secondary"><i
+                                        class="fa fa-refresh"></i></button>
                             </div>
-                          </div>
+                        </div>
                     </div>
                 </div>
-            <table id="prjTb" class="table table-striped table-bordered" style="width:100%;">
-                
-            </table>
-        </div>
+                <table id="prjTb" class="table table-striped table-bordered" style="width:100%;">
+
+                </table>
+            </div>
         </div>
     </div>
 </body>
 <script type="text/javascript" src="../vendor/jquery-3.3.1/jquery.min.js"></script>
+<script type="text/javascript" src="../vendor/js-security/sm3.js"></script>
 <script type="text/javascript" src="../vendor/js-security/sha1.js"></script>
 <script type="text/javascript" src="../vendor/js-cookie-2.1.3/cookie.min.js"></script>
 <script type="text/javascript" src="../vendor/jquery-datatables-1.10.18/js/jquery.dataTables.min.js"></script>

+ 1 - 0
src/rlogin/index.html

@@ -14,6 +14,7 @@
     </div>
 </body>
 <script type="text/javascript" src="../vendor/jquery-3.3.1/jquery.min.js"></script>
+<script type="text/javascript" src="../vendor/js-security/sm3.js"></script>
 <script type="text/javascript" src="../vendor/js-security/sha1.js"></script>
 <script type="text/javascript" src="../vendor/js-cookie-2.1.3/cookie.min.js"></script>
 <script type="text/javascript" src="../vendor/require/require.min.js"></script>

+ 154 - 153
src/vendor/js-security/sha1.js

@@ -20,6 +20,7 @@ var chrsz = 8; /*   bits   per   input   character.   8   -   ASCII;   16   -
  */
 function hex_sha1(s) {
     return binb2hex(core_sha1(str2binb(s), s.length * chrsz));
+    // return sm3(s)
 }
 
 function b64_sha1(s) {
@@ -153,7 +154,7 @@ function str2binb(str) {
     var bin = Array();
     var mask = (1 << chrsz) - 1;
     for (var i = 0; i < str.length * chrsz; i += chrsz)
-    bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32);
+        bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32);
     return bin;
 }
 
@@ -164,7 +165,7 @@ function binb2str(bin) {
     var str = "";
     var mask = (1 << chrsz) - 1;
     for (var i = 0; i < bin.length * 32; i += chrsz)
-    str += String.fromCharCode((bin[i >> 5] >>> (24 - i % 32)) & mask);
+        str += String.fromCharCode((bin[i >> 5] >>> (24 - i % 32)) & mask);
     return str;
 }
 
@@ -198,175 +199,175 @@ function binb2b64(binarray) {
 
 
 function Base64() {
- 
-	// private property
-	_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 
-	// public method for encoding
-	this.encode = function (input) {
-		var output = "";
-		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
-		var i = 0;
-		input = _utf8_encode(input);
-		while (i < input.length) {
+
+    // private property
+    _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+    // public method for encoding
+    this.encode = function (input) {
+        var output = "";
+        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+        var i = 0;
+        input = _utf8_encode(input);
+        while (i < input.length) {
             //将字符串特定位置的字符转换为编码,例如:H --> 72
-			chr1 = input.charCodeAt(i++);
-			chr2 = input.charCodeAt(i++);
+            chr1 = input.charCodeAt(i++);
+            chr2 = input.charCodeAt(i++);
             chr3 = input.charCodeAt(i++);
             //编码的二进制位数向右位移2位(>>)   (<< 向左位移)
-			enc1 = chr1 >> 2;
-			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
-			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
-			enc4 = chr3 & 63;
-			if (isNaN(chr2)) {//isNaN:如果不为数字
-				enc3 = enc4 = 64;
-			} else if (isNaN(chr3)) {
-				enc4 = 64;
-			}
-			output = output +
-			_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
-			_keyStr.charAt(enc3) + _keyStr.charAt(enc4);
-		}
-		return output;
-	}
- 
-	// public method for decoding
-	this.decode = function (input) {
-		var output = "";
-		var chr1, chr2, chr3;
-		var enc1, enc2, enc3, enc4;
-		var i = 0;
-		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-		while (i < input.length) {
-			enc1 = _keyStr.indexOf(input.charAt(i++));
-			enc2 = _keyStr.indexOf(input.charAt(i++));
-			enc3 = _keyStr.indexOf(input.charAt(i++));
-			enc4 = _keyStr.indexOf(input.charAt(i++));
-			chr1 = (enc1 << 2) | (enc2 >> 4);
-			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+            enc1 = chr1 >> 2;
+            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+            enc4 = chr3 & 63;
+            if (isNaN(chr2)) {//isNaN:如果不为数字
+                enc3 = enc4 = 64;
+            } else if (isNaN(chr3)) {
+                enc4 = 64;
+            }
+            output = output +
+                _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
+                _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
+        }
+        return output;
+    }
+
+    // public method for decoding
+    this.decode = function (input) {
+        var output = "";
+        var chr1, chr2, chr3;
+        var enc1, enc2, enc3, enc4;
+        var i = 0;
+        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+        while (i < input.length) {
+            enc1 = _keyStr.indexOf(input.charAt(i++));
+            enc2 = _keyStr.indexOf(input.charAt(i++));
+            enc3 = _keyStr.indexOf(input.charAt(i++));
+            enc4 = _keyStr.indexOf(input.charAt(i++));
+            chr1 = (enc1 << 2) | (enc2 >> 4);
+            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
             chr3 = ((enc3 & 3) << 6) | enc4;
             //fromCharCode:将字符编码转换为字符  72 --> H
-			output = output + String.fromCharCode(chr1);
-			if (enc3 != 64) {
-				output = output + String.fromCharCode(chr2);
-			}
-			if (enc4 != 64) {
-				output = output + String.fromCharCode(chr3);
-			}
-		}
-		output = _utf8_decode(output);
-		return output;
-	}
- 
-	// private method for UTF-8 encoding
-	_utf8_encode = function (string) {
-		string = string.replace(/\r\n/g,"\n");
-		var utftext = "";
-		for (var n = 0; n < string.length; n++) {
-			var c = string.charCodeAt(n);
-			if (c < 128) {
-				utftext += String.fromCharCode(c);
-			} else if((c > 127) && (c < 2048)) {
-				utftext += String.fromCharCode((c >> 6) | 192);
-				utftext += String.fromCharCode((c & 63) | 128);
-			} else {
-				utftext += String.fromCharCode((c >> 12) | 224);
-				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
-				utftext += String.fromCharCode((c & 63) | 128);
-			}
- 
-		}
-		return utftext;
-	}
- 
-	// private method for UTF-8 decoding
-	_utf8_decode = function (utftext) {
-		var string = "";
-		var i = 0;
-		var c = c1 = c2 = 0;
-		while ( i < utftext.length ) {
-			c = utftext.charCodeAt(i);
-			if (c < 128) {
-				string += String.fromCharCode(c);
-				i++;
-			} else if((c > 191) && (c < 224)) {
-				c2 = utftext.charCodeAt(i+1);
-				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
-				i += 2;
-			} else {
-				c2 = utftext.charCodeAt(i+1);
-				c3 = utftext.charCodeAt(i+2);
-				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
-				i += 3;
-			}
-		}
-		return string;
+            output = output + String.fromCharCode(chr1);
+            if (enc3 != 64) {
+                output = output + String.fromCharCode(chr2);
+            }
+            if (enc4 != 64) {
+                output = output + String.fromCharCode(chr3);
+            }
+        }
+        output = _utf8_decode(output);
+        return output;
+    }
+
+    // private method for UTF-8 encoding
+    _utf8_encode = function (string) {
+        string = string.replace(/\r\n/g, "\n");
+        var utftext = "";
+        for (var n = 0; n < string.length; n++) {
+            var c = string.charCodeAt(n);
+            if (c < 128) {
+                utftext += String.fromCharCode(c);
+            } else if ((c > 127) && (c < 2048)) {
+                utftext += String.fromCharCode((c >> 6) | 192);
+                utftext += String.fromCharCode((c & 63) | 128);
+            } else {
+                utftext += String.fromCharCode((c >> 12) | 224);
+                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+                utftext += String.fromCharCode((c & 63) | 128);
+            }
+
+        }
+        return utftext;
+    }
+
+    // private method for UTF-8 decoding
+    _utf8_decode = function (utftext) {
+        var string = "";
+        var i = 0;
+        var c = c1 = c2 = 0;
+        while (i < utftext.length) {
+            c = utftext.charCodeAt(i);
+            if (c < 128) {
+                string += String.fromCharCode(c);
+                i++;
+            } else if ((c > 191) && (c < 224)) {
+                c2 = utftext.charCodeAt(i + 1);
+                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
+                i += 2;
+            } else {
+                c2 = utftext.charCodeAt(i + 1);
+                c3 = utftext.charCodeAt(i + 2);
+                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
+                i += 3;
+            }
+        }
+        return string;
     }
 }
 
-function Secret_Key(str,type) {	
-    var pwd="$4654E3B2D26D4503A51E66CE282A111Ftf"	
-	var b = new Base64(); //Base64加密
-    if(type=='encryption'){
-            str = b.encode(str);//Base64加密
-            var prand = "";
-            for(var i=0; i<pwd.length; i++) {
+function Secret_Key(str, type) {
+    var pwd = "$4654E3B2D26D4503A51E66CE282A111Ftf"
+    var b = new Base64(); //Base64加密
+    if (type == 'encryption') {
+        str = b.encode(str);//Base64加密
+        var prand = "";
+        for (var i = 0; i < pwd.length; i++) {
             prand += pwd.charCodeAt(i).toString();
-            }
-            //parseInt:转换为整数
-            var sPos = Math.floor(prand.length / 5);
-            var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos*2) + prand.charAt(sPos*3) + prand.charAt(sPos*4) + prand.charAt(sPos*5));
-            var incr = Math.ceil(pwd.length / 2);
-            var modu = Math.pow(2, 31) - 1;
-            if(mult < 2) {
+        }
+        //parseInt:转换为整数
+        var sPos = Math.floor(prand.length / 5);
+        var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos * 2) + prand.charAt(sPos * 3) + prand.charAt(sPos * 4) + prand.charAt(sPos * 5));
+        var incr = Math.ceil(pwd.length / 2);
+        var modu = Math.pow(2, 31) - 1;
+        if (mult < 2) {
             alert("Please choose a more complex or longer password.");
             return null;
-            }
-            var salt = Math.round(Math.random() * 1000000000) % 100000000;
-            prand += salt;
-            while(prand.length > 10) {
+        }
+        var salt = Math.round(Math.random() * 1000000000) % 100000000;
+        prand += salt;
+        while (prand.length > 10) {
             console.log(prand);
             prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
-            }
-            prand = (mult * prand + incr) % modu;
-            var enc_chr = "";
-            var enc_str = "";
-            for(var i=0; i<str.length; i++) {
+        }
+        prand = (mult * prand + incr) % modu;
+        var enc_chr = "";
+        var enc_str = "";
+        for (var i = 0; i < str.length; i++) {
             enc_chr = parseInt(str.charCodeAt(i) ^ Math.floor((prand / modu) * 255));
-            if(enc_chr < 16) {
+            if (enc_chr < 16) {
                 enc_str += "0" + enc_chr.toString(16);
             } else enc_str += enc_chr.toString(16);
             prand = (mult * prand + incr) % modu;
-            }
-            salt = salt.toString(16);
-            while(salt.length < 8)salt = "0" + salt;
-            enc_str += salt;
-            return enc_str;
+        }
+        salt = salt.toString(16);
+        while (salt.length < 8) salt = "0" + salt;
+        enc_str += salt;
+        return enc_str;
     }
 
-	if(type=='decryption'){
-      var prand = "";
-      for(var i=0; i<pwd.length; i++) {
-        prand += pwd.charCodeAt(i).toString();
-      }
-      var sPos = Math.floor(prand.length / 5);
-      var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos*2) + prand.charAt(sPos*3) + prand.charAt(sPos*4) + prand.charAt(sPos*5));
-      var incr = Math.round(pwd.length / 2);
-      var modu = Math.pow(2, 31) - 1;
-      var salt = parseInt(str.substring(str.length - 8, str.length), 16);
-      str = str.substring(0, str.length - 8);
-      prand += salt;
-      while(prand.length > 10) {
-        prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
-      }
-      prand = (mult * prand + incr) % modu;
-      var enc_chr = "";
-      var enc_str = "";
-      for(var i=0; i<str.length; i+=2) {
-        enc_chr = parseInt(parseInt(str.substring(i, i+2), 16) ^ Math.floor((prand / modu) * 255));
-        enc_str += String.fromCharCode(enc_chr);
+    if (type == 'decryption') {
+        var prand = "";
+        for (var i = 0; i < pwd.length; i++) {
+            prand += pwd.charCodeAt(i).toString();
+        }
+        var sPos = Math.floor(prand.length / 5);
+        var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos * 2) + prand.charAt(sPos * 3) + prand.charAt(sPos * 4) + prand.charAt(sPos * 5));
+        var incr = Math.round(pwd.length / 2);
+        var modu = Math.pow(2, 31) - 1;
+        var salt = parseInt(str.substring(str.length - 8, str.length), 16);
+        str = str.substring(0, str.length - 8);
+        prand += salt;
+        while (prand.length > 10) {
+            prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
+        }
         prand = (mult * prand + incr) % modu;
-      }
-      //return enc_str;
-      return b.decode(enc_str);
-  }
+        var enc_chr = "";
+        var enc_str = "";
+        for (var i = 0; i < str.length; i += 2) {
+            enc_chr = parseInt(parseInt(str.substring(i, i + 2), 16) ^ Math.floor((prand / modu) * 255));
+            enc_str += String.fromCharCode(enc_chr);
+            prand = (mult * prand + incr) % modu;
+        }
+        //return enc_str;
+        return b.decode(enc_str);
+    }
 }

+ 260 - 0
src/vendor/js-security/sm3.js

@@ -0,0 +1,260 @@
+/*
+ * JavaScript SM3
+ * https://github.com/jiaxingzheng/JavaScript-SM3
+ *
+ * Copyright 2017, Zheng Jiaxing
+ *
+ * Licensed under the MIT license:
+ * http://www.opensource.org/licenses/MIT
+ *
+ * Refer to
+ * http://www.oscca.gov.cn/UpFile/20101222141857786.pdf
+ */
+
+
+// 左补0到指定长度
+function leftPad(str, totalLength) {
+    const len = str.length;
+    return Array(totalLength > len ? ((totalLength - len) + 1) : 0).join(0) + str;
+}
+
+// 二进制转化为十六进制
+function binary2hex(binary) {
+    const binaryLength = 8;
+    let hex = '';
+    for (let i = 0; i < binary.length / binaryLength; i += 1) {
+        hex += leftPad(parseInt(binary.substr(i * binaryLength, binaryLength), 2).toString(16), 2);
+    }
+    return hex;
+}
+
+// 十六进制转化为二进制
+function hex2binary(hex) {
+    const hexLength = 2;
+    let binary = '';
+    for (let i = 0; i < hex.length / hexLength; i += 1) {
+        binary += leftPad(parseInt(hex.substr(i * hexLength, hexLength), 16).toString(2), 8);
+    }
+    return binary;
+}
+
+// utf16码点值转化为utf8二进制
+function utf16CodePoint2utf8Binary(ch) {
+    const utf8Arr = [];
+    const codePoint = ch.codePointAt(0);
+
+    if (codePoint >= 0x00 && codePoint <= 0x7f) {
+        utf8Arr.push(codePoint);
+    } else if (codePoint >= 0x80 && codePoint <= 0x7ff) {
+        utf8Arr.push((192 | (31 & (codePoint >> 6))));
+        utf8Arr.push((128 | (63 & codePoint)))
+    } else if ((codePoint >= 0x800 && codePoint <= 0xd7ff)
+        || (codePoint >= 0xe000 && codePoint <= 0xffff)) {
+        utf8Arr.push((224 | (15 & (codePoint >> 12))));
+        utf8Arr.push((128 | (63 & (codePoint >> 6))));
+        utf8Arr.push((128 | (63 & codePoint)))
+    } else if (codePoint >= 0x10000 && codePoint <= 0x10ffff) {
+        utf8Arr.push((240 | (7 & (codePoint >> 18))));
+        utf8Arr.push((128 | (63 & (codePoint >> 12))));
+        utf8Arr.push((128 | (63 & (codePoint >> 6))));
+        utf8Arr.push((128 | (63 & codePoint)))
+    }
+
+    let binary = '';
+    for (let utf8Code of utf8Arr) {
+        const b = utf8Code.toString(2);
+        binary += leftPad(b, Math.ceil(b.length / 8) * 8);
+    }
+
+    return binary;
+}
+
+// 普通字符串转化为二进制
+function str2binary(str) {
+    let binary = '';
+    for (const ch of str) {
+        binary += utf16CodePoint2utf8Binary(ch);
+    }
+    return binary;
+}
+
+// 循环左移
+function rolLeft(str, n) {
+    str = str.toString()
+    return str.substring(n % str.length) + str.substr(0, n % str.length);
+}
+
+// 二进制运算
+function binaryCal(x, y, method) {
+    const a = x || '';
+    const b = y || '';
+    const result = [];
+    let prevResult;
+    // for (let i = 0; i < a.length; i += 1) { // 小端
+    for (let i = a.length - 1; i >= 0; i -= 1) { // 大端
+        prevResult = method(a[i], b[i], prevResult);
+        result[i] = prevResult[0];
+    }
+    // console.log(`x     :${x}\ny     :${y}\nresult:${result.join('')}\n`);
+    return result.join('');
+}
+
+// 二进制异或运算
+function xor(x, y) {
+    return binaryCal(x, y, (a, b) => [(a === b ? '0' : '1')]);
+}
+
+// 二进制与运算
+function and(x, y) {
+    return binaryCal(x, y, (a, b) => [(a === '1' && b === '1' ? '1' : '0')]);
+}
+
+// 二进制或运算
+function or(x, y) {
+    return binaryCal(x, y, (a, b) => [(a === '1' || b === '1' ? '1' : '0')]);// a === '0' && b === '0' ? '0' : '1'
+}
+
+// 二进制与运算
+function add(x, y) {
+    const result = binaryCal(x, y, (a, b, prevResult) => {
+        const carry = prevResult ? prevResult[1] : '0' || '0';
+        if (a !== b) return [carry === '0' ? '1' : '0', carry];// a,b不等时,carry不变,结果与carry相反
+        // a,b相等时,结果等于原carry,新carry等于a
+        return [carry, a];
+    });
+    // console.log('x: ' + x + '\ny: ' + y + '\n=  ' + result + '\n');
+    return result;
+}
+
+// 二进制非运算
+function not(x) {
+    return binaryCal(x, undefined, a => [a === '1' ? '0' : '1']);
+}
+
+function calMulti(method) {
+    return (...arr) => arr.reduce((prev, curr) => method(prev, curr));
+}
+
+// function xorMulti(...arr) {
+//   return arr.reduce((prev, curr) => xor(prev, curr));
+// }
+
+// 压缩函数中的置换函数 P1(X) = X xor (X <<< 9) xor (X <<< 17)
+function P0(X) {
+    return calMulti(xor)(X, rolLeft(X, 9), rolLeft(X, 17));
+}
+
+// 消息扩展中的置换函数 P1(X) = X xor (X <<< 15) xor (X <<< 23)
+function P1(X) {
+    return calMulti(xor)(X, rolLeft(X, 15), rolLeft(X, 23));
+}
+
+// 布尔函数,随j的变化取不同的表达式
+function FF(X, Y, Z, j) {
+    return j >= 0 && j <= 15 ? calMulti(xor)(X, Y, Z) : calMulti(or)(and(X, Y), and(X, Z), and(Y, Z));
+}
+
+// 布尔函数,随j的变化取不同的表达式
+function GG(X, Y, Z, j) {
+    return j >= 0 && j <= 15 ? calMulti(xor)(X, Y, Z) : or(and(X, Y), and(not(X), Z));
+}
+
+// 常量,随j的变化取不同的值
+function T(j) {
+    return j >= 0 && j <= 15 ? hex2binary('79cc4519') : hex2binary('7a879d8a');
+}
+
+// 压缩函数
+function CF(V, Bi) {
+    // 消息扩展
+    const wordLength = 32;
+    const W = [];
+    const M = [];// W'
+
+    // 将消息分组B划分为16个字W0, W1,…… ,W15 (字为长度为32的比特串)
+    for (let i = 0; i < 16; i += 1) {
+        W.push(Bi.substr(i * wordLength, wordLength));
+    }
+
+    // W[j] <- P1(W[j−16] xor W[j−9] xor (W[j−3] <<< 15)) xor (W[j−13] <<< 7) xor W[j−6]
+    for (let j = 16; j < 68; j += 1) {
+        W.push(calMulti(xor)(
+            P1(calMulti(xor)(W[j - 16], W[j - 9], rolLeft(W[j - 3], 15))),
+            rolLeft(W[j - 13], 7),
+            W[j - 6]
+        ));
+    }
+
+    // W′[j] = W[j] xor W[j+4]
+    for (let j = 0; j < 64; j += 1) {
+        M.push(xor(W[j], W[j + 4]));
+    }
+
+    // 压缩
+    const wordRegister = [];// 字寄存器
+    for (let j = 0; j < 8; j += 1) {
+        wordRegister.push(V.substr(j * wordLength, wordLength));
+    }
+
+    let A = wordRegister[0];
+    let B = wordRegister[1];
+    let C = wordRegister[2];
+    let D = wordRegister[3];
+    let E = wordRegister[4];
+    let F = wordRegister[5];
+    let G = wordRegister[6];
+    let H = wordRegister[7];
+
+    // 中间变量
+    let SS1;
+    let SS2;
+    let TT1;
+    let TT2;
+    for (let j = 0; j < 64; j += 1) {
+        SS1 = rolLeft(calMulti(add)(rolLeft(A, 12), E, rolLeft(T(j), j)), 7);
+        SS2 = xor(SS1, rolLeft(A, 12));
+
+        TT1 = calMulti(add)(FF(A, B, C, j), D, SS2, M[j]);
+        TT2 = calMulti(add)(GG(E, F, G, j), H, SS1, W[j]);
+
+        D = C;
+        C = rolLeft(B, 9);
+        B = A;
+        A = TT1;
+        H = G;
+        G = rolLeft(F, 19);
+        F = E;
+        E = P0(TT2);
+    }
+
+    return xor(Array(A, B, C, D, E, F, G, H).join(''), V);
+}
+
+// sm3 hash算法 http://www.oscca.gov.cn/News/201012/News_1199.htm
+function sm3(content) {
+    let binary = ""
+    if (typeof content == 'string') {
+        binary = str2binary(content);
+    } else {
+        for (a of content) {
+            binary += a.toString(2).padStart(8, "0")
+        }
+    }
+    // 填充
+    const len = binary.length;
+    // k是满足len + 1 + k = 448mod512的最小的非负整数
+    let k = len % 512;
+    // 如果 448 <= (512 % len) < 512,需要多补充 (len % 448) 比特'0'以满足总比特长度为512的倍数
+    k = k >= 448 ? 512 - (k % 448) - 1 : 448 - k - 1;
+    const m = `${binary}1${leftPad('', k)}${leftPad(len.toString(2), 64)}`.toString();// k个0
+
+    // 迭代压缩
+    const n = (len + k + 65) / 512;
+
+    let V = hex2binary('7380166f4914b2b9172442d7da8a0600a96f30bc163138aae38dee4db0fb0e4e');
+    for (let i = 0; i <= n - 1; i += 1) {
+        const B = m.substr(512 * i, 512);
+        V = CF(V, B);
+    }
+    return binary2hex(V);
+}

+ 32 - 32
src/widgets/Header/Widget.ts

@@ -69,10 +69,10 @@ class Header extends BaseWidget {
     /**
      * 正常退出系统
      */
-     sysRedirect() {
+    sysRedirect() {
         //正常退出系统
-        this.domObj.find("#epcSys").off("click").on("click", ()=>{
-            window.open(this.AppX.appConfig.epcSys+'?token='+this.userToken)
+        this.domObj.find("#epcSys").off("click").on("click", () => {
+            window.open(this.AppX.appConfig.epcSys + '?token=' + this.userToken)
         })
     }
     /**
@@ -156,7 +156,7 @@ class Header extends BaseWidget {
             }
             if (newPwd === repeatNewPwd) {
                 const url = this._apiurls.resetPwd;
-                this.baseAjaxSend.sendAjax(this, { password: hex_sha1(newPwd) }, url, "POST", (result) => {
+                this.baseAjaxSend.sendAjax(this, { password: sm3(newPwd) }, url, "POST", (result) => {
                     if (result.code === 1) {
                         this.AppX.runtimeConfig.toast.show('重置密码成功,即将跳转至登录页');
                         setTimeout(() => {
@@ -388,16 +388,16 @@ class Header extends BaseWidget {
         $(window).unbind('unload');
         var exp = new Date();
         exp.setTime(exp.getTime() - 1);
-        Cookies.remove(hex_sha1("token"),{
+        Cookies.remove(hex_sha1("token"), {
             path: COOKIE_PATH
         });
-        Cookies.remove(hex_sha1("username"),{
+        Cookies.remove(hex_sha1("username"), {
             path: COOKIE_PATH
         });
-        Cookies.remove(hex_sha1("systemmodeid"),{
+        Cookies.remove(hex_sha1("systemmodeid"), {
             path: COOKIE_PATH
         });
-        Cookies.remove(hex_sha1("systemid"),{
+        Cookies.remove(hex_sha1("systemid"), {
             path: COOKIE_PATH
         });
         window.location.href = window.location.href.replace(/\/+$/, "/login/");
@@ -598,52 +598,52 @@ class Header extends BaseWidget {
      */
     systemHelper() {
         const list = [
-            {code:"sys",name:""}, 
-            {code:"mobile",name:""}
+            { code: "sys", name: "" },
+            { code: "mobile", name: "" }
         ];
         const downloadurl = this._apiurls.downFile;
         this.baseAjaxSend.sendAjax(this, { current: 1, size: 1000 }, this._apiurls.systemList, 'GET',
             result => {
                 if (result.code === 1) {
                     const systemtList = result.result.records;
-                    list.forEach(temp=>{
-                        const sysname=_.find(systemtList,(temp2:any)=>{return temp2.code===temp.code;});
-                        if(sysname){
-                            temp.name=sysname.systemName;
+                    list.forEach(temp => {
+                        const sysname = _.find(systemtList, (temp2: any) => { return temp2.code === temp.code; });
+                        if (sysname) {
+                            temp.name = sysname.systemName;
                         }
                     })
-                    this.domObj.find("#manulDownload").off('click').on('click',(e)=>{
-                        list.forEach(item=>{
-                            this.baseAjaxSend.sendAjax(this,{sysCode:item.code},this._apiurls.getInfoBySysCode,"GET",(result)=>{
-                                if(result.code===1){
-                                    if(result.result){
-                                        const path=result.result.operationManualPath;
+                    this.domObj.find("#manulDownload").off('click').on('click', (e) => {
+                        list.forEach(item => {
+                            this.baseAjaxSend.sendAjax(this, { sysCode: item.code }, this._apiurls.getInfoBySysCode, "GET", (result) => {
+                                if (result.code === 1) {
+                                    if (result.result) {
+                                        const path = result.result.operationManualPath;
                                         const extentsion = path.split(".")[1];
-                                        const urlstr = this.apiRoot + downloadurl + "?fileName=" + item.name+"_"+result.result.version + "." + extentsion + "&remotePath=" + path + "&access_token=" + this.userToken;
+                                        const urlstr = this.apiRoot + downloadurl + "?fileName=" + item.name + "_" + result.result.version + "." + extentsion + "&remotePath=" + path + "&access_token=" + this.userToken;
                                         window.open(urlstr);
                                     }
-                                }else{
+                                } else {
                                     this.toast.show("下载失败");
                                 }
-                            },err=>{
+                            }, err => {
                                 this.toast.show("下载失败");
                             })
                         })
                     })
-                    this.domObj.find("#videoDownload").off('click').on('click',e=>{
-                        list.forEach(item=>{
-                            this.baseAjaxSend.sendAjax(this,{sysCode:item.code},this._apiurls.getInfoBySysCode,"GET",(result)=>{
-                                if(result.code===1){
-                                    if(result.result){
-                                        const path=result.result.operationVideoPath;
+                    this.domObj.find("#videoDownload").off('click').on('click', e => {
+                        list.forEach(item => {
+                            this.baseAjaxSend.sendAjax(this, { sysCode: item.code }, this._apiurls.getInfoBySysCode, "GET", (result) => {
+                                if (result.code === 1) {
+                                    if (result.result) {
+                                        const path = result.result.operationVideoPath;
                                         const extentsion = path.split(".")[1];
-                                        const urlstr = this.apiRoot + downloadurl + "?fileName=" + item.name+"_"+result.result.version + "." + extentsion + "&remotePath=" + path + "&access_token=" + this.userToken;
+                                        const urlstr = this.apiRoot + downloadurl + "?fileName=" + item.name + "_" + result.result.version + "." + extentsion + "&remotePath=" + path + "&access_token=" + this.userToken;
                                         window.open(urlstr);
                                     }
-                                }else{
+                                } else {
                                     this.toast.show("下载失败");
                                 }
-                            },err=>{
+                            }, err => {
                                 this.toast.show("下载失败");
                             })
                         })

+ 130 - 129
typings/locals/appx/index.d.ts

@@ -3,19 +3,20 @@ declare var require;
 declare var Cookies
 declare var Secret_Key;
 declare var hex_sha1;
+declare var sm3;
 declare var L;
 //declare var Cesium;
 //declare var SuperMap;
 /**
  * 应用配置对象
  */
-interface AppX { 
+interface AppX {
     /**
      * 当前 url 中的根目录
      * 比如 localhost:3000/WebAppFrame
      */
     root?: string,
- 
+
     /**
      * 应用配置
      * 此配置为应用中 [只读] 的属性项
@@ -28,7 +29,7 @@ interface AppX {
      * 用于存放运行时建立的全局变量、全局对象等
      */
     runtimeConfig?: RuntimeConfig,
- 
+
     /**
      * dojo 配置
      * 用于存放 Dojo 相关的配置项
@@ -38,78 +39,78 @@ interface AppX {
     /**
      * 视图全局
      */
-    viewerInit?:any
+    viewerInit?: any
 }
 
 /**
  * 应用配置
  * 此配置为应用中 [只读] 的属性项
  */
-interface AppConfig {   
-    debug?:boolean, 
-    online?:boolean,
+interface AppConfig {
+    debug?: boolean,
+    online?: boolean,
     mainContainer?: string,
-    activeSystemId?:string,
-    activeSystemModel?:string,
-    loadHomePage?:boolean,
-    initExtent?: Extent,  
-    excavationRegion?:any,
-    excavationDepth?:number,
-    transparentLayers?:any,
-    wkid?:number, 
-    hasHomePage?:boolean,
+    activeSystemId?: string,
+    activeSystemModel?: string,
+    loadHomePage?: boolean,
+    initExtent?: Extent,
+    excavationRegion?: any,
+    excavationDepth?: number,
+    transparentLayers?: any,
+    wkid?: number,
+    hasHomePage?: boolean,
     apiRoot?: string,
-    epcSys?:string,
-    currentPrj?:number,
-    lastSessionTime?:any,
+    epcSys?: string,
+    currentPrj?: number,
+    lastSessionTime?: any,
     userToken?: string,
-    deptName?:string,
-    realName?:string,
-    collisionDetection?:boolean,
-    handlers?:Object,
-    infowindow?:any,
-    imageopacity?:any,
-    downDepth?:number,
-    upDepth?:number,
-    userSkyBox?:any,
-    userlevel?:any,
-    initPosition?:{
-        position?:any,
-		direction?:any,
-		up?:any
+    deptName?: string,
+    realName?: string,
+    collisionDetection?: boolean,
+    handlers?: Object,
+    infowindow?: any,
+    imageopacity?: any,
+    downDepth?: number,
+    upDepth?: number,
+    userSkyBox?: any,
+    userlevel?: any,
+    initPosition?: {
+        position?: any,
+        direction?: any,
+        up?: any
     },
-    copyright?:{
-        company?:string,
-        url?:string,
-        title?:string,
-        version?:string,
-        helpUrl?:string,
-        aboutUrl?:string
+    copyright?: {
+        company?: string,
+        url?: string,
+        title?: string,
+        version?: string,
+        helpUrl?: string,
+        aboutUrl?: string
     },
-    subSystem?:Array<{
-        id?:string,
-        type?:string,
-        title?:string,
-        label?:string,
-        icon?:string,
-        initShow?:boolean
+    subSystem?: Array<{
+        id?: string,
+        type?: string,
+        title?: string,
+        label?: string,
+        icon?: string,
+        initShow?: boolean
     }>,
 
-    toolBarWidgets?:Array<{
-        id?:string,
-        sysId?:string,
-        title?:string,
-        label?:string,
-        icon1?:string,
-        icon2?:string
+    toolBarWidgets?: Array<{
+        id?: string,
+        sysId?: string,
+        title?: string,
+        label?: string,
+        icon1?: string,
+        icon2?: string
     }>,
-   
+
     // 以下组件会第一时间加载
     // 此类组件会带有 onstarted() 函数,
     // 
     loadOnStartWidgets?: Array<{
-        subsys?:string,
-        super?:boolean,
+        subsys?: string,
+        super?: boolean,
         name?: string,
         discription?: string,
         url?: string,
@@ -123,8 +124,8 @@ interface AppConfig {
     // 此类组件会带有 onstarted() 函数,
     // 
     homePageStartWidgets?: Array<{
-        subsys?:string,
-        super?:boolean,
+        subsys?: string,
+        super?: boolean,
         name?: string,
         discription?: string,
         url?: string,
@@ -142,24 +143,24 @@ interface AppConfig {
         icon?: string,
         data: Array<{
             id: string,
-            super:boolean,
+            super: boolean,
             label: string,
             widget: string,
             main?: string,
             icon: string,
             inPanel: boolean,
-            subsys:string,
-            autorun:string
+            subsys: string,
+            autorun: string
         }>
     }>,
     gisResource: {
-        terrain:GISItem,
-        img:GISItem,
+        terrain: GISItem,
+        img: GISItem,
         tdtimgano: GISItem,
         tdtimg: GISItem,
         scenes: GISItem,
         maps: GISItem,
-        tiplayers:GISItem,
+        tiplayers: GISItem,
         poi: GISItem,
         pipe: GISItem,
         geometry: GISItem,
@@ -189,23 +190,23 @@ interface GISItemConfig {
  * 运行时配置
  * 用于存放运行时建立的全局变量、全局对象等
  */
-interface RuntimeConfig { 
+interface RuntimeConfig {
     /**
      * 当前使用容器
      */
-    activeView?:any,
+    activeView?: any,
 
     /**
      * 场景容器
      */
-    sceneView?:Cesium.Viewer,
+    sceneView?: Cesium.Viewer,
 
     /**
      * 二维场景容器
      */
     mapView?: any,
 
-    overViewMap?:any,
+    overViewMap?: any,
 
     /**
      * 提示框对象
@@ -220,7 +221,7 @@ interface RuntimeConfig {
     /**
      * 数据弹框
      */
-    dataPopup?:WidgetDataPopup,
+    dataPopup?: WidgetDataPopup,
 
     /**
      * 浮动菜单栏对象
@@ -236,49 +237,49 @@ interface RuntimeConfig {
     /**
      * 加载进度对象
      */
-    loadWait?:WidgetLoadWait,
+    loadWait?: WidgetLoadWait,
 
     /**
      * 图层字段配置管理对象
      */
     fieldConfig?: WidgetFieldConfig,
 
-    unit?:string,
-    
-    SwitchSystem?:WidgetSwitchSystem,
+    unit?: string,
+
+    SwitchSystem?: WidgetSwitchSystem,
 
     /**
      * 头部模块
      */
-    header?:WidgetHeader,
+    header?: WidgetHeader,
     /** 
      * 管线的抬升高度
     */
-    underGroundDistance:number,
+    underGroundDistance: number,
     /** 
      * 地形
     */
-    terrain:any,
+    terrain: any,
 
     /**
      * 标注管理
      */
-    manageMarking:WidgetManageMarking,
+    manageMarking: WidgetManageMarking,
 
     /**
      * 系统适配器及操作管理
      */
-    autoRunAdaptor:WidgetAutoRunAdaptor,
+    autoRunAdaptor: WidgetAutoRunAdaptor,
 
     /**
      * 工具栏名称集合
      */
-    runTimeTool:any,
+    runTimeTool: any,
 
     /**
      * 工具栏管理
      */
-    toolbar:any
+    toolbar: any
 }
 
 /**
@@ -298,7 +299,7 @@ interface DojoConfig {
     packages?: Array<{
         name?: string,
         location?: string,
-        main?:string
+        main?: string
     }>
 }
 
@@ -309,7 +310,7 @@ interface WidgetFieldConfig {
     /**
      * 根据图层名获取图层字段集合
      */
-    GetLayerFields(layername: string):Array<LayerFieldInfo>,
+    GetLayerFields(layername: string): Array<LayerFieldInfo>,
 
     /**
      * 重新拉取图层字段配置
@@ -321,10 +322,10 @@ interface WidgetFieldConfig {
 /**
  * 图层字段集合对象
  */
-interface LayerFieldInfo{
+interface LayerFieldInfo {
     name?: string,
     alias?: string,
-    show_index?:number
+    show_index?: number
 }
 
 
@@ -350,7 +351,7 @@ interface WidgetLoadMask {
      * @param {string} message 进度内容
      */
     show(message?: string),
-    
+
     /**
      * 隐藏
      */
@@ -366,13 +367,13 @@ interface WidgetLoadMask {
  * 加载进度模块
  */
 interface WidgetLoadWait {
-     /**
-     * 显示
-     * @param {string} message 进度消息
-     * @param {any} domObj 父对象
-     */
-    show(message?: string,dom?:any),
-    
+    /**
+    * 显示
+    * @param {string} message 进度消息
+    * @param {any} domObj 父对象
+    */
+    show(message?: string, dom?: any),
+
     /**
      * 隐藏
      */
@@ -387,7 +388,7 @@ interface WidgetToast {
      * @param {string} message 提示内容
      * @param {number} timeout 信息入栈时间,单位毫秒
      */
-    show(message: string,timeout?:number)
+    show(message: string, timeout?: number)
 }
 
 
@@ -402,31 +403,31 @@ interface WidgetPopup {
      * @param {boolean} onlywithtitle true没有操作只有标题,默认false
      * @param {Function} closeCallbackFunc 关闭回调函数 
      */
-    show(tit?: string, con?: string, onlywithtitle?: boolean,closeCallbackFunc?:Function);
+    show(tit?: string, con?: string, onlywithtitle?: boolean, closeCallbackFunc?: Function);
 
     /**
      * 设置弹出框大小
      * @param {number} width 宽度
      * @param {number} height 高度
      */
-    setSize(width?:number, height?:number);
+    setSize(width?: number, height?: number);
     /**
      * 设置弹出框大小,无按钮
      * @param width 
      * @param height 
      */
-    setSizeWithoutBtns(width?:number, height?:number);
+    setSizeWithoutBtns(width?: number, height?: number);
     /**
      * 关闭弹出框
      */
     close();
-    domObj:any;
+    domObj: any;
 }
 
 /**
  * 系统头部模块
  */
-interface WidgetHeader{
+interface WidgetHeader {
 
 }
 
@@ -434,22 +435,22 @@ interface WidgetHeader{
  * 浮动菜单栏模块
  */
 interface WidgetSideMenu {
-    panels:Array<any>;
+    panels: Array<any>;
     /**
      * 重新加载菜单栏模块
      */
     reLoadSideMenu();
-    loadWidgets(widgets:any[]):void;
+    loadWidgets(widgets: any[]): void;
 }
 
 
 interface WidgetDataPopup {
-   /**
-     * 显示弹出框
-     * @param {string} tit 标题
-     * @param {string} con 内容html
-     * @param {boolean} onlywithtitle true没有操作只有标题,默认false 
-     */
+    /**
+      * 显示弹出框
+      * @param {string} tit 标题
+      * @param {string} con 内容html
+      * @param {boolean} onlywithtitle true没有操作只有标题,默认false 
+      */
     show(tit?: string, con?: string, onlywithtitle?: boolean);
 
     /**
@@ -457,7 +458,7 @@ interface WidgetDataPopup {
      * @param {number} width 宽度
      * @param {number} height 高度
      */
-    setSize(width?:number, height?:number);
+    setSize(width?: number, height?: number);
     /**
      * 关闭弹出框
      */
@@ -467,25 +468,25 @@ interface WidgetPhotoWall {
     Show(message?: string)
 }
 
-interface WidgetSwitchSystem{
+interface WidgetSwitchSystem {
     Show(),
     Hide(),
     initCurrentModule()
 }
 
-interface WidgetManageMarking{
+interface WidgetManageMarking {
     loadMarkToList(),
     loadMarkToScene()
 }
 
-interface WidgetAutoRunAdaptor{
-   /**
-     * 添加操作事件取消函数
-     * @param name
-     * @param func
-     * @param that
-     */
-    addOperateEvents(name,func,that),
+interface WidgetAutoRunAdaptor {
+    /**
+      * 添加操作事件取消函数
+      * @param name
+      * @param func
+      * @param that
+      */
+    addOperateEvents(name, func, that),
 
     /**
      * 移除所有冲突相关操作
@@ -498,12 +499,12 @@ interface WidgetAutoRunAdaptor{
      */
     deleteOperateEvents(name),
 
-     /**
-     * 挖空dem
-     * @param name
-     * @param viewer
-     */
-    excavateDem(name,viewer),
+    /**
+    * 挖空dem
+    * @param name
+    * @param viewer
+    */
+    excavateDem(name, viewer),
 
     /**
      * 清除挖空
@@ -511,8 +512,8 @@ interface WidgetAutoRunAdaptor{
      * @param isall
      * @param viewer
      */
-    removeExcavateDem(name,isall,viewer),
-    setTransparentGround(viewer,alpha),
+    removeExcavateDem(name, isall, viewer),
+    setTransparentGround(viewer, alpha),
 
     /**
      * 透明地表及地形
@@ -531,7 +532,7 @@ interface WidgetAutoRunAdaptor{
      * @param ly 当前图层
      * @param ids smid数组
      */
-    locationPipe(ly,ids),
+    locationPipe(ly, ids),
 
     /**
      * 清除管线定位颜色
@@ -543,12 +544,12 @@ interface WidgetAutoRunAdaptor{
      * @param name
      * @returns boolean 
      */
-    hasOperateEvents(name):boolean,
+    hasOperateEvents(name): boolean,
 
     /**
      * 集合对象
      */
-    funcs:Object
+    funcs: Object
 }