瀏覽代碼

修改接口问题

Your Name 1 周之前
父節點
當前提交
c3e7f04d77
共有 1 個文件被更改,包括 16 次插入3 次删除
  1. 16
    3
      app/api/logic/ShopContentLogic.php

+ 16
- 3
app/api/logic/ShopContentLogic.php 查看文件

@@ -145,7 +145,8 @@ class ShopContentLogic extends Logic
145 145
                     $data = [
146 146
                         'status' => 100,
147 147
                         'msg' => "绑定机器码成功!",
148
-                        'is_gi' => $is_gi
148
+                        'is_gi' => $is_gi,
149
+                        'count' => $shop['hksy_count']
149 150
                     ];
150 151
                 } else {
151 152
                     $data = [
@@ -179,7 +180,8 @@ class ShopContentLogic extends Logic
179 180
                     $data = [
180 181
                         'status' => 100,
181 182
                         'msg' => "已绑定该机器码!",
182
-                        'is_gi' => $is_gi
183
+                        'is_gi' => $is_gi,
184
+                        'count' => $shop['hksy_count']
183 185
                     ];
184 186
                 }
185 187
             }
@@ -837,16 +839,27 @@ class ShopContentLogic extends Logic
837 839
      */
838 840
     public static function subHKSYCount($post) {
839 841
         $code = $post["code"] ?? '';
842
+        $mcode = $post["mcode"] ?? '0000';
843
+
840 844
         //$count = $post["count"] ?? 1; //默认就是1
841 845
         $count = 1;
842 846
         $remark = $post["remark"] ?? '';
843 847
 
844
-        if ($count <= 0 || empty($remark)) {
848
+        if ($count <= 0 || empty($remark) || empty($mcode)) {
845 849
             self::$errCode = 1;
846 850
             self::$error = "参数错误";
847 851
             return false;
848 852
         }
849 853
 
854
+        //没有必要验证机器码 后续需要对接口进行加密传输,解密操作,验证来源 防篡改,使用token也不安全,秘钥和机器码和token都会暴露;
855
+        /*$where001 = [
856
+            "del" => 0,
857
+            "is_show" => 1,
858
+            "pid" => 0, //必须是电脑
859
+            "code" => $code
860
+        ];
861
+        $item = EquiCategoryModel::where($where001)->find();*/
862
+
850 863
         $shop = self::getShopByCode($code);
851 864
         if (empty($shop)) {
852 865
             self::$errCode = 9;

Loading…
取消
儲存