Browse Source

接入京东官方接口

sunxbiao 1 year ago
parent
commit
b29a443c4c
2 changed files with 12 additions and 8 deletions
  1. 11 7
      app/controller/api/store/product/Jd.php
  2. 1 1
      route/api.php

+ 11 - 7
app/controller/api/store/product/Jd.php

@@ -5,13 +5,13 @@ namespace app\controller\api\store\product;
5 5
 use app\common\repositories\store\product\ProductRepository;
6 6
 use app\common\repositories\user\UserThirdRepository;
7 7
 use think\App;
8
-use crmeb\basic\BaseController;
8
+// use crmeb\basic\BaseController;
9 9
 use think\Exception;
10 10
 use think\exception\ValidateException;
11 11
 use think\facade\Db;
12 12
 use think\facade\Log;
13 13
 
14
-class Jd extends BaseController
14
+class Jd
15 15
 {
16 16
     public $appid = '';
17 17
     public $key = '';
@@ -23,11 +23,15 @@ class Jd extends BaseController
23 23
     public function __construct(App $app)
24 24
     {
25 25
 
26
-        parent::__construct($app);
27
-        $this->appid = '4100076550';
28
-        $this->key = '5ce3da55dc739b6e7d9021d59618c5faa3b4030f41c5699658c7ca30cfd19f09b4046d606d196f1d';
29
-        $this->appKey = 'a2ad5078501e928b991cd8aaeb0446dc';
30
-        $this->secretKey = 'fd8aab59e9b94d9e889cb22838c03f2a';
26
+        // parent::__construct($app);
27
+        $this->appid = '4101490811';
28
+        $this->key = 'a7c43c21f3e156d2fd41dfbe884b9f62592ceb03b9f199c0811c82e35be53c0580a2638a7af39e74';
29
+        $this->appKey = 'e99703d01cbb6a2e48a8a34f19af9d87';
30
+        $this->secretKey = 'cea7578d5a314ef88086daa4ee3a5b4d';
31
+        // $this->appid = '4100076550';
32
+        // $this->key = '5ce3da55dc739b6e7d9021d59618c5faa3b4030f41c5699658c7ca30cfd19f09b4046d606d196f1d';
33
+        // $this->appKey = 'a2ad5078501e928b991cd8aaeb0446dc';
34
+        // $this->secretKey = 'fd8aab59e9b94d9e889cb22838c03f2a';
31 35
         $this->userThird = app()->make(UserThirdRepository::class);
32 36
         $this->url = 'https://api.jd.com/routerjson';
33 37
     }

+ 1 - 1
route/api.php

@@ -1024,7 +1024,7 @@ Route::group('api/', function () {
1024 1024
     Route::any('vip/order_update', 'api.store.product.Vip/updateVipOrder');
1025 1025
 
1026 1026
     // 京东
1027
-    if(false){
1027
+    if(true){
1028 1028
         // 京东联盟
1029 1029
         Route::any('get_jd_goods_list','api.store.product.Jd/get_jd_goods_list');//获取京东联盟商品入库,定时任务
1030 1030
         /*京东列表*/