jiaojiao7 4 gadi atpakaļ
vecāks
revīzija
d775a5951d
2 mainītis faili ar 57 papildinājumiem un 7 dzēšanām
  1. 56 7
      static/templates/login.html
  2. 1 0
      static/templates/moneyRecharge.html

+ 56 - 7
static/templates/login.html

@@ -36,6 +36,14 @@
         .userProTbody tr td {
             text-align: center;
         }
+
+        .test {
+
+            width: 400px;
+            height: 400px;
+        }
+
+
     </style>
     <div>
         <h1 class="title">接口服务平台测试系统</h1>
@@ -70,14 +78,14 @@
                 <thead>
                 <tr class="tableTitle">
                     <th style="width: 5%">序号</th>
-                    <th style="width: 10%">产品ID</th>
+                    <th style="width: 5%">产品ID</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: 20%">操作</th>
+                    <th style="width: 25%">操作</th>
                 </tr>
                 </thead>
                 <tbody class="userProTbody">
@@ -88,6 +96,14 @@
 
     </div>
 
+    {{/*<div class="test">
+        <h3 id="demo">并发测试</h3>
+        <input type="text" placeholder="请输入并发量">
+        <button>确定</button>
+    </div>*/}}
+    <div class="result"></div>
+
+
     <script>
         userList()
 
@@ -111,7 +127,7 @@
                                 str += "<td style='width: 100px'>" + item.secret_key + "</td>";
                                 str += "<td style='width: 100px'>" + item.phone + "</td>";
                                 str += "<td style='width: 100px'>" + item.money + "</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 += "<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>";
                             }
@@ -167,20 +183,21 @@
                                 str += "<td>" + item.call_times_limit_day + "</td>";
                                 str += "<td>" + item.data_num_limit_one_times + "</td>";
                                 if (item.product_id === 1000 || item.product_id === 1001) {
-                                    str += "<td class='handle' style='width: 100px ;text-align: left'><a href=\"/page/projectListPage?appId=" + appId + "&key=" + key + "\" >测试接口</a>";
+                                    str += "<td class='handle' style='width: 100px ;'><a href=\"/page/projectListPage?appId=" + appId + "&key=" + key + "\" >测试接口</a>";
                                 } else {
-                                    str += "<td class='handle' style='width: 100px;text-align: left'><a href=\"/page/projectListDetail?appId=" + appId + "&key=" + key + "\"  >测试接口</a>";
+                                    str += "<td class='handle' style='width: 100px;'><a href=\"/page/projectListDetail?appId=" + appId + "&key=" + key + "\"  >测试接口</a>";
                                 }
-                                if (item.cost_model == 0){
+                                if (item.cost_model == 0) {
                                     str += "<a href=\"/page/userRecharge?appId=" + appId + "\"  >剩余量充值</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);
+                            // console.log(str);
                             let trBody = $(str);
                             $(".userProTbody").append(trBody);
                         } else {
@@ -194,6 +211,38 @@
             })
         }
 
+        //并发测试点击事件,参数 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({
+                    url: "/manage/user/userProductList",
+                    type: "POST",
+                    dataType: "json",
+                    async: false,
+                    data: param,
+                    success: function (r) {
+                        // if (r.code === 0) {
+                            alert(JSON.stringify(r))
+                            // $(".result").html(r)
+                        // } else {
+                        //
+                        // }
+                    }
+                })
+
+            }
+        }
+
+
     </script>
     </body>
     </html>

+ 1 - 0
static/templates/moneyRecharge.html

@@ -12,6 +12,7 @@
         <input type="number" id="moneys" placeholder="请输入充值金额">
         <button type="button" id="moneyBtn">提交</button>
     </div>
+    <div id="resultContent"></div>
 
     </body>
     </html>