fix: urlparam undefined error

This commit is contained in:
root 2021-06-16 12:11:50 +08:00
parent 43b79ffffc
commit b054ddaa31
3 changed files with 165 additions and 143 deletions

View File

@ -1,165 +1,182 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache"/>
<title>数瑞客户端</title> <title>数瑞客户端</title>
<script src="./js/createWS.js"></script> <script src="./js/createWS.js"></script>
<script src="./js/cryptico.js"></script> <script src="./js/cryptico.js"></script>
<script src="./js/jquery-2.1.4.js"></script> <script src="./js/jquery-2.1.4.js"></script>
<script src="./js/bootstrap.min.js"></script> <script src="./js/bootstrap.min.js"></script>
<script src="./js/commonutil.js"></script> <script src="./js/commonutil.js"></script>
<link href="./css/common.css" rel="stylesheet"> <link href="./css/common.css" rel="stylesheet">
<link href="./css/bootstrap.min.css" rel="stylesheet"> <link href="./css/bootstrap.min.css" rel="stylesheet">
<script src="./js/vue.js"></script> <script src="./js/vue.js"></script>
<script src="./js/bdwareclient.js"></script> <script src="./js/bdwareclient.js"></script>
<script src="./js/sm2.js"></script> <script src="./js/sm2.js"></script>
</head> </head>
<body> <body>
<header <header
class="headerFooter navbar navbar-default navbar-fixed-top navColor "> class="headerFooter navbar navbar-default navbar-fixed-top navColor ">
<div class="col-10"> <div class="col-10">
<div class="input-group"> <div class="input-group">
<a class="navbar-brand" href="#"> <img alt="Brand" <a class="navbar-brand" href="#"> <img alt="Brand"
src="./img/logo-1.png" style="height: 30px"> src="./img/logo-1.png" style="height: 30px">
</a><a class="navbar-brand">数瑞浏览器&nbsp;&nbsp; </a> <input id="urlInput" </a><a class="navbar-brand">数瑞浏览器&nbsp;&nbsp; </a>
type="text" class="form-control" placeholder="输入地址"> <div class="input-group-prepend" >
<input id="urlInput" style="border-top-left-radius: 5px; border-bottom-left-radius: 5px"
type="text" placeholder="输入地址">
</div>
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button"
onclick="connectNode()">GO
</button>
</div>
<div class="input-group-append">
<button class="btn btn-outline-secondary" style="border-top-right-radius: 5px; border-bottom-right-radius: 5px" id="switchRenderBtn" type="button"
onclick="changeRender()">不加载界面
</button>
</div>
<span>&nbsp;&nbsp;&nbsp;</span>
<button class="btn btn-outline-secondary" type="button" <div class="input-group-append">
onclick="connectNode()">GO</button> <select id="selectContract" class="custom-select"
<button class="btn btn-outline-secondary" id="switchRenderBtn" type="button" style="-webkit-appearance: none" onchange="changeApp()">
onclick="changeRender()">不加载界面</button> <option selected>选择合约</option>
<span>&nbsp;&nbsp;&nbsp;</span> </select>
<div class="input-group-append"> </div>
<select id="selectContract" class="custom-select"
style="-webkit-appearance: none" onchange="changeApp()">
<option selected>选择合约</option>
</select>
</div>
</div> </div>
</div> </div>
<div class=" nav navbar-right userName" data-toggle="modal" <div class=" nav navbar-right userName" data-toggle="modal"
data-target="#pubkeyDialog">欢迎, {{shortName}}</div> data-target="#pubkeyDialog">欢迎, {{shortName}}
</header> </div>
</header>
<div id="main"> <div id="main">
<div class="row h-100" id="mainDiv"></div> <div class="row h-100" id="mainDiv"></div>
</div> </div>
<!-- 用于配置sm2密钥的对话框 --> <!-- 用于配置sm2密钥的对话框 -->
<div class="modal fade" id="pubkeyDialog" tabindex="-1" role="dialog" <div class="modal fade" id="pubkeyDialog" tabindex="-1" role="dialog"
aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">用户信息</h5> <h5 class="modal-title" id="exampleModalLongTitle">用户信息</h5>
<button type="button" class="close" data-dismiss="modal" <button type="button" class="close" data-dismiss="modal"
aria-label="Close"> aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row" style="padding-left: 16px; padding-right: 16px"> <div class="row" style="padding-left: 16px; padding-right: 16px">
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<label class="input-group-text" for="localKeyList">本地公钥</label> <label class="input-group-text" for="localKeyList">本地公钥</label>
</div> </div>
<select class="custom-select" <select class="custom-select"
aria-label="Example select with button addon" aria-label="Example select with button addon"
style="appearance: none" v-model="selectedSM2Key" style="appearance: none" v-model="selectedSM2Key"
@change="changeSM2Key($event)"> @change="changeSM2Key($event)">
<option v-for="(item,index) in sm2KeyList" :key="index" <option v-for="(item,index) in sm2KeyList" :key="index"
:value='item.id'>{{item.title}}</option> :value='item.id'>{{item.title}}
</select> </option>
<div class="input-group-append"> </select>
<button class="btn btn-outline-primary" for="localKeyList" <div class="input-group-append">
v-on:click="exportPubkey">导出公钥</button> <button class="btn btn-outline-primary" for="localKeyList"
</div> v-on:click="exportPubkey">导出公钥
<div class="input-group-append"> </button>
<button class="btn btn-outline-danger" for="localKeyList" </div>
v-on:click="deletePubkey">删除公钥</button> <div class="input-group-append">
</div> <button class="btn btn-outline-danger" for="localKeyList"
</div> v-on:click="deletePubkey">删除公钥
</div> </button>
<div class="row" style="padding-left: 16px; padding-right: 16px"> </div>
</div>
</div>
<div class="row" style="padding-left: 16px; padding-right: 16px">
<div class="input-group mb-1"> <div class="input-group mb-1">
<div class="input-group-prepend"> <div class="input-group-prepend">
<label class="input-group-text" for="localKeyList">当前SM2密钥</label> <label class="input-group-text" for="localKeyList">当前SM2密钥</label>
</div> </div>
<input type="text" class="form-control" placeholder="(请复制并妥善保存)" <input type="text" class="form-control" placeholder="(请复制并妥善保存)"
disabled="disabled" aria-label="" disabled="disabled" aria-label=""
aria-describedby="basic-addon1"> aria-describedby="basic-addon1">
<div class="input-group-append"> <div class="input-group-append">
<button type="button" class="btn btn-outline-primary" <button type="button" class="btn btn-outline-primary"
id="generatePubkeyBtn" v-on:click="generatePubkey">生成新公钥</button> id="generatePubkeyBtn" v-on:click="generatePubkey">生成新公钥
<button type="button" class="btn btn-outline-primary" </button>
data-dismiss="modal" id="importPubkeyBtn" <button type="button" class="btn btn-outline-primary"
v-on:click="importPubkey">导入公钥</button> data-dismiss="modal" id="importPubkeyBtn"
</div> v-on:click="importPubkey">导入公钥
</button>
</div>
</div> </div>
</div> </div>
<textarea class="form-control mb-3" title="复制密钥,并妥善保存" <textarea class="form-control mb-3" title="复制密钥,并妥善保存"
id="sm2KeyTextarea" v-model="sm2KeyStr" id="sm2KeyTextarea" v-model="sm2KeyStr"
style="width: 100%; min-height: 150px" rows="" cols=""> style="width: 100%; min-height: 150px" rows="" cols="">
</textarea> </textarea>
<div class="row" style="padding-left: 16px; padding-right: 16px;"> <div class="row" style="padding-left: 16px; padding-right: 16px;">
</div> </div>
<div class="row" style="padding-left: 16px; padding-right: 16px"> <div class="row" style="padding-left: 16px; padding-right: 16px">
<span>我的权限:{{myRole}}</span> <span>我的权限:{{myRole}}</span>
</div> </div>
<div class="input-group"> <div class="input-group">
<select id="inputGroupSelect04" v-model="test" <select id="inputGroupSelect04" v-model="test"
class="custom-select" style="appearance: none" class="custom-select" style="appearance: none"
@change="changeProduct($event)"> @change="changeProduct($event)">
<option v-for="(item,index) in productList" :key="index" <option v-for="(item,index) in productList" :key="index"
:value='item.id'>{{item.title}}</option> :value='item.id'>{{item.title}}
</select> </option>
<div class="input-group-append"> </select>
<button class="btn btn-outline-primary" type="button" <div class="input-group-append">
v-on:click="applyRole">角色认证</button> <button class="btn btn-outline-primary" type="button"
</div> v-on:click="applyRole">角色认证
</div> </button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="dialog" tabindex="-1" role="dialog" <div class="modal fade" id="dialog" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true"> aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="dialogTitleH5">Modal title</h5> <h5 class="modal-title" id="dialogTitleH5">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" <button type="button" class="close" data-dismiss="modal"
aria-label="Close"> aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body" id="dialogBodyDiv">...</div> <div class="modal-body" id="dialogBodyDiv">...</div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" <button type="button" class="btn btn-outline-secondary"
data-dismiss="modal">关闭 data-dismiss="modal">关闭
</button> </button>
<button type="button" id="dialogConfimBtn" <button type="button" id="dialogConfimBtn"
class="btn btn-outline-primary" data-dismiss="modal">确定 class="btn btn-outline-primary" data-dismiss="modal">确定
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
var h = document.body.clientHeight var h = document.body.clientHeight
- $("header").css("height").replace("px", "") - $("header").css("height").replace("px", "")
@ -167,7 +184,9 @@
init(); init();
//initWSocket(); //initWSocket();
</script>
</script>
</body> </body>
</html> </html>

View File

@ -601,6 +601,7 @@ function renewList() {
for (let i = 0; i < global.contracts.length; ++i) { for (let i = 0; i < global.contracts.length; ++i) {
const c = global.contracts[i]; const c = global.contracts[i];
console.log(c); console.log(c);
if (c.contractStatus=="KILLED") continue;
if (!c.id) { if (!c.id) {
c.id = c.contractID; c.id = c.contractID;
} }

View File

@ -193,9 +193,11 @@ var initGlobal = function (urlParams) {
global.isBaaS = true global.isBaaS = true
primaryColor = '#08263a' primaryColor = '#08263a'
} }
if (urlParams){
global.urlparam = urlParams;
}
if (urlParams && urlParams.keys) { if (urlParams && urlParams.keys) {
global.urlparam = urlParams; global.sm2Key = urlParams.keys;
global.sm2Key = urlParams.keys
} else { } else {
global.sm2Key = localStorage.getItem("PrivKey"); global.sm2Key = localStorage.getItem("PrivKey");
if (!global.sm2Key || global.sm2Key.length < 100) { if (!global.sm2Key || global.sm2Key.length < 100) {