|
@@ -1,253 +1,250 @@
|
|
{{define "login.html"}}
|
|
{{define "login.html"}}
|
|
- <!DOCTYPE html>
|
|
|
|
- <html lang="en">
|
|
|
|
- <head>
|
|
|
|
- <meta charset="UTF-8">
|
|
|
|
- <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
|
|
|
|
- <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
|
|
|
|
- <title>接口服务平台后台管理系统</title>
|
|
|
|
- </head>
|
|
|
|
- <style>
|
|
|
|
-
|
|
|
|
- </style>
|
|
|
|
- <body>
|
|
|
|
- <style>
|
|
|
|
- .title {
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .tableDiv {
|
|
|
|
- margin-top: 20px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .box tr td {
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .handle a {
|
|
|
|
- text-decoration: none;
|
|
|
|
- margin-right: 5px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .userProductList {
|
|
|
|
- margin-top: 20px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .userProTbody tr td {
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .test {
|
|
|
|
-
|
|
|
|
- width: 400px;
|
|
|
|
- height: 400px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- </style>
|
|
|
|
- <div>
|
|
|
|
- <h1 class="title">接口服务平台测试系统</h1>
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- <button style="width: 80px;height: 35px"><a style="text-decoration:none;" href="/page/createUser">创建用户</a>
|
|
|
|
- </button>
|
|
|
|
- </div>
|
|
|
|
- <div class="tableDiv">
|
|
|
|
- <table border="1" cellspacing="0" cellpadding="0" id="tableId" width="80%" align="center" hidden>
|
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html lang="en">
|
|
|
|
+<head>
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
+ <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
|
|
|
|
+ <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
|
|
|
|
+ <title>接口服务平台后台管理系统</title>
|
|
|
|
+</head>
|
|
|
|
+<style>
|
|
|
|
+
|
|
|
|
+</style>
|
|
|
|
+<body>
|
|
|
|
+<style>
|
|
|
|
+ .title {
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tableDiv {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .box tr td {
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .handle a {
|
|
|
|
+ text-decoration: none;
|
|
|
|
+ margin-right: 5px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .userProductList {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .userProTbody tr td {
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .test {
|
|
|
|
+
|
|
|
|
+ width: 400px;
|
|
|
|
+ height: 400px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+</style>
|
|
|
|
+<div>
|
|
|
|
+ <h1 class="title">接口服务平台测试系统</h1>
|
|
|
|
+</div>
|
|
|
|
+<div>
|
|
|
|
+ <button style="width: 80px;height: 35px"><a target="_blank" style="text-decoration:none;" href="/page/createUser">创建用户</a>
|
|
|
|
+ </button>
|
|
|
|
+</div>
|
|
|
|
+<div class="tableDiv">
|
|
|
|
+ <table border="1" cellspacing="0" cellpadding="0" id="tableId" width="80%" align="center" hidden>
|
|
|
|
+ <thead>
|
|
|
|
+ <tr class="tableTitle">
|
|
|
|
+ <th style="width: 5%">序号</th>
|
|
|
|
+ <th style="width: 25%">客户名称</th>
|
|
|
|
+ <th style="width: 20%">APPID</th>
|
|
|
|
+ <th style="width: 10%">密钥</th>
|
|
|
|
+ <th style="width: 10%">客户电话</th>
|
|
|
|
+ <th style="width: 10%">余额</th>
|
|
|
|
+ <th style="width: 20%">操作</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody class="box">
|
|
|
|
+
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+</div>
|
|
|
|
+<div class="userProductList">
|
|
|
|
+ <div class="userProductDiv" hidden>
|
|
|
|
+ <p class="nodata"></p>
|
|
|
|
+ <h3>用户购买产品列表</h3>
|
|
|
|
+ <table border="1" cellspacing="0" cellpadding="0" width="80%" align="center" id="userProduct">
|
|
<thead>
|
|
<thead>
|
|
<tr class="tableTitle">
|
|
<tr class="tableTitle">
|
|
<th style="width: 5%">序号</th>
|
|
<th style="width: 5%">序号</th>
|
|
- <th style="width: 25%">客户名称</th>
|
|
|
|
- <th style="width: 20%">APPID</th>
|
|
|
|
- <th style="width: 10%">密钥</th>
|
|
|
|
- <th style="width: 10%">客户电话</th>
|
|
|
|
- <th style="width: 10%">余额</th>
|
|
|
|
- <th style="width: 20%">操作</th>
|
|
|
|
|
|
+ <th style="width: 5%">产品ID</th>
|
|
|
|
+ <th style="width: 8%">产品名称</th>
|
|
|
|
+ <th style="width: 25%">用户APPID</th>
|
|
|
|
+ <th style="width: 5%">剩余量</th>
|
|
|
|
+ <th style="width: 10%">扣费模式</th>
|
|
|
|
+ <th style="width: 5%">状态</th>
|
|
|
|
+ <th style="width: 10%">每日调用次数</th>
|
|
|
|
+ <th style="width: 10%">单次返回数量</th>
|
|
|
|
+ <th style="width: 25%">操作</th>
|
|
</tr>
|
|
</tr>
|
|
</thead>
|
|
</thead>
|
|
- <tbody class="box">
|
|
|
|
|
|
+ <tbody class="userProTbody">
|
|
|
|
|
|
</tbody>
|
|
</tbody>
|
|
</table>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
- <div class="userProductList">
|
|
|
|
- <div class="userProductDiv" hidden>
|
|
|
|
- <p class="nodata"></p>
|
|
|
|
- <h3>用户购买产品列表</h3>
|
|
|
|
- <table border="1" cellspacing="0" cellpadding="0" width="80%" align="center" id="userProduct">
|
|
|
|
- <thead>
|
|
|
|
- <tr class="tableTitle">
|
|
|
|
- <th style="width: 5%">序号</th>
|
|
|
|
- <th style="width: 5%">产品ID</th>
|
|
|
|
- <th style="width: 8%">产品名称</th>
|
|
|
|
- <th style="width: 25%">用户APPID</th>
|
|
|
|
- <th style="width: 5%">剩余量</th>
|
|
|
|
- <th style="width: 10%">扣费模式</th>
|
|
|
|
- <th style="width: 5%">状态</th>
|
|
|
|
- <th style="width: 10%">每日调用次数</th>
|
|
|
|
- <th style="width: 10%">单次返回数量</th>
|
|
|
|
- <th style="width: 25%">操作</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody class="userProTbody">
|
|
|
|
-
|
|
|
|
- </tbody>
|
|
|
|
- </table>
|
|
|
|
- </div>
|
|
|
|
|
|
|
|
- </div>
|
|
|
|
|
|
+</div>
|
|
|
|
|
|
- {{/*
|
|
|
|
|
|
+{{/*
|
|
<div class="test">
|
|
<div class="test">
|
|
<h3 id="demo">并发测试</h3>
|
|
<h3 id="demo">并发测试</h3>
|
|
<input type="text" placeholder="请输入并发量">
|
|
<input type="text" placeholder="请输入并发量">
|
|
<button>确定</button>
|
|
<button>确定</button>
|
|
</div>
|
|
</div>
|
|
*/}}
|
|
*/}}
|
|
- <div class="result"></div>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <script>
|
|
|
|
- userList()
|
|
|
|
-
|
|
|
|
- function userList() {
|
|
|
|
- $.ajax({
|
|
|
|
- url: "/manage/user/list",
|
|
|
|
- type: "POST",
|
|
|
|
- dataType: "json",
|
|
|
|
- async: false,
|
|
|
|
- success: function (r) {
|
|
|
|
- if (r.code === 0) {
|
|
|
|
- var str = ""
|
|
|
|
- if (r.data.length != 0) {
|
|
|
|
- $("#tableId").show();
|
|
|
|
- for (var i = 0; i < r.data.length; i++) {
|
|
|
|
- var item = r.data[i];
|
|
|
|
- str += "<tr >";
|
|
|
|
- str += "<td style='width: 50px'>" + (i + 1) + "</td>";
|
|
|
|
- str += "<td style='width: 100px'><a href='javascript:void(0);' style='pointer:hand;' onclick=\"userProductList('" + item.app_id + "','" + item.secret_key + "')\">" + item.name + "</a></td>";
|
|
|
|
- str += "<td style='width: 200px'>" + item.app_id + "</td>";
|
|
|
|
- str += "<td style='width: 100px'>" + item.secret_key + "</td>";
|
|
|
|
- str += "<td style='width: 100px'>" + item.phone + "</td>";
|
|
|
|
- str += "<td style='width: 100px'>" + (item.money / 100) + "</td>";
|
|
|
|
- str += "<td class='handle' style='width: 100px'><a href=\"/page/moneyRechargePage?appId=" + item.app_id + "\">账户余额充值</a><a href=\"/page/chooseProductPage?appId=" + item.app_id + "\">购买产品</a></td>";
|
|
|
|
-
|
|
|
|
- str += "</tr>";
|
|
|
|
- }
|
|
|
|
- $(".box").html(str);
|
|
|
|
- } else {
|
|
|
|
- $(".tableDiv").html("还没有客户,请添加客户信息");
|
|
|
|
|
|
+<div class="result"></div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ userList()
|
|
|
|
+
|
|
|
|
+ function userList() {
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: "/manage/user/list",
|
|
|
|
+ type: "POST",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ async: false,
|
|
|
|
+ success: function (r) {
|
|
|
|
+ if (r.code === 0) {
|
|
|
|
+ var str = ""
|
|
|
|
+ if (r.data.length != 0) {
|
|
|
|
+ $("#tableId").show();
|
|
|
|
+ for (var i = 0; i < r.data.length; i++) {
|
|
|
|
+ var item = r.data[i];
|
|
|
|
+ str += "<tr >";
|
|
|
|
+ str += "<td style='width: 50px'>" + (i + 1) + "</td>";
|
|
|
|
+ str += "<td style='width: 100px'><a href='javascript:void(0);' style='pointer:hand;' onclick=\"userProductList('" + item.app_id + "','" + item.secret_key + "')\">" + item.name + "</a></td>";
|
|
|
|
+ str += "<td style='width: 200px'>" + item.app_id + "</td>";
|
|
|
|
+ str += "<td style='width: 100px'>" + item.secret_key + "</td>";
|
|
|
|
+ str += "<td style='width: 100px'>" + item.phone + "</td>";
|
|
|
|
+ str += "<td style='width: 100px'>" + (item.money / 100) + "</td>";
|
|
|
|
+ str += "<td class='handle' style='width: 100px'><a target=\"_blank\" href=\"/page/moneyRechargePage?appId=" + item.app_id + "\">账户余额充值</a><a target=\"_blank\" href=\"/page/chooseProductPage?appId=" + item.app_id + "\">购买产品</a></td>";
|
|
|
|
+
|
|
|
|
+ str += "</tr>";
|
|
}
|
|
}
|
|
|
|
+ $(".box").html(str);
|
|
} else {
|
|
} else {
|
|
- $(".tableDiv").html(r.msg);
|
|
|
|
|
|
+ $(".tableDiv").html("还没有客户,请添加客户信息");
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ $(".tableDiv").html(r.msg);
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function userProductList(appId, key) {
|
|
|
|
+ //var appId = $(obj).find("td:eq(2)").text();
|
|
|
|
+ //var key = $(obj).find("td:eq(3)").text();
|
|
|
|
+ console.log(appId, "|", key)
|
|
|
|
+ let param = {
|
|
|
|
+ "appId": appId
|
|
|
|
+ };
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: "/manage/user/userProductList",
|
|
|
|
+ type: "POST",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ async: false,
|
|
|
|
+ data: param,
|
|
|
|
+ success: function (r) {
|
|
|
|
+ if (r.code === 0) {
|
|
|
|
+ var str = "";
|
|
|
|
+ if (r.data) {
|
|
|
|
+ $(".nodata").html("");
|
|
|
|
+ $(".userProductDiv").show();
|
|
|
|
+ $(".userProTbody").html("");
|
|
|
|
+ for (var i = 0; i < r.data.length; i++) {
|
|
|
|
+ var item = r.data[i];
|
|
|
|
+ str += "<tr>";
|
|
|
|
+ str += "<td>" + (i + 1) + "</td>";
|
|
|
|
+ str += "<td>" + item.product_id + "</td>";
|
|
|
|
+ str += "<td>" + item.name + "</td>";
|
|
|
|
+ str += "<td>" + item.app_id + "</td>";
|
|
|
|
+ str += "<td>" + item.left_num + "</td>";
|
|
|
|
+ if (item.cost_model == 0) {
|
|
|
|
+ str += "<td>扣量</td>";
|
|
|
|
+ } else {
|
|
|
|
+ str += "<td>扣余额</td>";
|
|
|
|
+ }
|
|
|
|
+ if (item.interface_status == 0) {
|
|
|
|
+ str += "<td>开启</td>";
|
|
|
|
+ } else {
|
|
|
|
+ str += "<td>关闭</td>";
|
|
|
|
+ }
|
|
|
|
+ str += "<td>" + item.call_times_limit_day + "</td>";
|
|
|
|
+ str += "<td>" + item.data_num_limit_one_times + "</td>";
|
|
|
|
+ if (item.product_id === 1000) {
|
|
|
|
+ str += "<td class='handle' style='width: 100px ;'><a target=\"_blank\" href=\"/page/projectListPage?appId=" + appId + "&key=" + key + "\" >测试接口</a>";
|
|
|
|
+ } else if (item.product_id === 1001) {
|
|
|
|
+ str += "<td class='handle' style='width: 100px ;'><a target=\"_blank\" href=\"/page/projectDetailSearchPage?projectId=1001&appId=" + appId + "&key=" + key + "\" >测试接口</a>";
|
|
|
|
+ } else if (item.product_id === 1002) {
|
|
|
|
+ str += "<td class='handle' style='width: 100px;'><a target=\"_blank\" href=\"/page/projectListDetail?appId=" + appId + "&key=" + key + "\" >测试接口</a>";
|
|
|
|
+ }
|
|
|
|
+ if (item.cost_model == 0) {
|
|
|
|
+ str += "<a target=\"_blank\" href=\"/page/userRecharge?appId=" + appId + "&productId=" + item.product_id + "\" >剩余量充值</a>"
|
|
|
|
+ }
|
|
|
|
+ str += "<a target=\"_blank\" href=\"/page/callLogPage?appId=" + appId + "&key=" + key + "&product_id=" + item.product_id + "\" >调用记录</a>";
|
|
|
|
+ str += "<a onclick=\"myFunction('" + appId + "','" + key + "','" + item.product_id + "')\" href='javascript:void(0);' style='pointer:hand;'>并发测试</a>"
|
|
|
|
+ // else {
|
|
|
|
+ //
|
|
|
|
+ // }
|
|
|
|
+ str += "</td>";
|
|
|
|
+ str += "</tr>";
|
|
|
|
+ }
|
|
|
|
+ // console.log(str);
|
|
|
|
+ let trBody = $(str);
|
|
|
|
+ $(".userProTbody").append(trBody);
|
|
|
|
+ } else {
|
|
|
|
+ $(".userProductDiv").hide();
|
|
|
|
+ }
|
|
|
|
|
|
- function userProductList(appId, key) {
|
|
|
|
- //var appId = $(obj).find("td:eq(2)").text();
|
|
|
|
- //var key = $(obj).find("td:eq(3)").text();
|
|
|
|
- console.log(appId, "|", key)
|
|
|
|
- let param = {
|
|
|
|
- "appId": appId
|
|
|
|
- };
|
|
|
|
|
|
+ } else {
|
|
|
|
+ $(".userProductList").html(r.msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //并发测试点击事件,参数 appid 产品id,并发量
|
|
|
|
+
|
|
|
|
+ function myFunction(appId, key, productId) {
|
|
|
|
+ console.log(appId, key, productId)
|
|
|
|
+ var num = prompt("请输入并发量", "");
|
|
|
|
+ if (num != null && num != "") {
|
|
|
|
+ console.log(num)
|
|
|
|
+ var param = {
|
|
|
|
+ "appid": appId,
|
|
|
|
+ "productId": productId,
|
|
|
|
+ "count": num,
|
|
|
|
+ }
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: "/manage/user/userProductList",
|
|
|
|
|
|
+ url: "/manage/user/concurrentTest",
|
|
type: "POST",
|
|
type: "POST",
|
|
dataType: "json",
|
|
dataType: "json",
|
|
async: false,
|
|
async: false,
|
|
data: param,
|
|
data: param,
|
|
success: function (r) {
|
|
success: function (r) {
|
|
- if (r.code === 0) {
|
|
|
|
- var str = "";
|
|
|
|
- if (r.data) {
|
|
|
|
- $(".nodata").html("");
|
|
|
|
- $(".userProductDiv").show();
|
|
|
|
- $(".userProTbody").html("");
|
|
|
|
- for (var i = 0; i < r.data.length; i++) {
|
|
|
|
- var item = r.data[i];
|
|
|
|
- str += "<tr>";
|
|
|
|
- str += "<td>" + (i + 1) + "</td>";
|
|
|
|
- str += "<td>" + item.product_id + "</td>";
|
|
|
|
- str += "<td>" + item.name + "</td>";
|
|
|
|
- str += "<td>" + item.app_id + "</td>";
|
|
|
|
- str += "<td>" + item.left_num + "</td>";
|
|
|
|
- if (item.cost_model == 0) {
|
|
|
|
- str += "<td>扣量</td>";
|
|
|
|
- } else {
|
|
|
|
- str += "<td>扣余额</td>";
|
|
|
|
- }
|
|
|
|
- if (item.interface_status == 0) {
|
|
|
|
- str += "<td>开启</td>";
|
|
|
|
- } else {
|
|
|
|
- str += "<td>关闭</td>";
|
|
|
|
- }
|
|
|
|
- str += "<td>" + item.call_times_limit_day + "</td>";
|
|
|
|
- str += "<td>" + item.data_num_limit_one_times + "</td>";
|
|
|
|
- if (item.product_id === 1000) {
|
|
|
|
- str += "<td class='handle' style='width: 100px ;'><a href=\"/page/projectListPage?appId=" + appId + "&key=" + key + "\" >测试接口</a>";
|
|
|
|
- } else if (item.product_id === 1001) {
|
|
|
|
- str += "<td class='handle' style='width: 100px ;'><a target=\"_blank\" href=\"/page/projectDetailSearchPage?projectId=1001&appId=" + appId + "&key=" + key + "\" >测试接口</a>";
|
|
|
|
- } else if (item.product_id === 1002) {
|
|
|
|
- str += "<td class='handle' style='width: 100px;'><a href=\"/page/projectListDetail?appId=" + appId + "&key=" + key + "\" >测试接口</a>";
|
|
|
|
- }
|
|
|
|
- if (item.cost_model == 0) {
|
|
|
|
- str += "<a href=\"/page/userRecharge?appId=" + appId + "\" >剩余量充值</a>"
|
|
|
|
- }
|
|
|
|
- str += "<a href=\"/page/callLogPage?appId=" + appId + "&key=" + key + "&product_id=" + item.product_id + "\" >调用记录</a>";
|
|
|
|
- str += "<a onclick=\"myFunction('" + appId + "','" + key + "','" + item.product_id + "')\" href='javascript:void(0);' style='pointer:hand;'>并发测试</a>"
|
|
|
|
- // else {
|
|
|
|
- //
|
|
|
|
- // }
|
|
|
|
- str += "</td>";
|
|
|
|
- str += "</tr>";
|
|
|
|
- }
|
|
|
|
- // console.log(str);
|
|
|
|
- let trBody = $(str);
|
|
|
|
- $(".userProTbody").append(trBody);
|
|
|
|
- } else {
|
|
|
|
- $(".userProductDiv").hide();
|
|
|
|
- }
|
|
|
|
|
|
|
|
- } else {
|
|
|
|
- $(".userProductList").html(r.msg);
|
|
|
|
- }
|
|
|
|
|
|
+ alert(JSON.stringify(r))
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
- //并发测试点击事件,参数 appid 产品id,并发量
|
|
|
|
-
|
|
|
|
- function myFunction(appId, key, productId) {
|
|
|
|
- console.log(appId, key, productId)
|
|
|
|
- var num = prompt("请输入并发量", "");
|
|
|
|
- if (num != null && num != "") {
|
|
|
|
- console.log(num)
|
|
|
|
- var param = {
|
|
|
|
- "appid": appId,
|
|
|
|
- "productId": productId,
|
|
|
|
- "count": num,
|
|
|
|
- };
|
|
|
|
- if (productId === 1001) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- $.ajax({
|
|
|
|
- url: "/manage/user/concurrentTest",
|
|
|
|
- type: "POST",
|
|
|
|
- dataType: "json",
|
|
|
|
- async: false,
|
|
|
|
- data: param,
|
|
|
|
- success: function (r) {
|
|
|
|
- alert(JSON.stringify(r))
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
- </script>
|
|
|
|
- </body>
|
|
|
|
- </html>
|
|
|
|
|
|
+</script>
|
|
|
|
+</body>
|
|
|
|
+</html>
|
|
{{end}}
|
|
{{end}}
|