ソースを参照

Merge branch 'develop'

xielin 6 年 前
コミット
476e2de8a0
共有5 個のファイルを変更した36 個の追加3 個の削除を含む
  1. 0 1
      app/Console/Commands/apollo.php
  2. 30 0
      app/Http/Controllers/ConfigController.php
  3. 2 2
      app/Http/Controllers/UploadController.php
  4. 2 0
      config/customer.tpl
  5. 2 0
      routes/api.php

+ 0 - 1
app/Console/Commands/apollo.php

@@ -56,7 +56,6 @@ class Apollo extends Command
      */
     public function handle()
     {
-        Log::debug('apollo test');
         $this->line('apollo配置服务开启');
         $restart = true; //失败自动重启
         do {

+ 30 - 0
app/Http/Controllers/ConfigController.php

@@ -0,0 +1,30 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: wangzhiqiang
+ * Date: 2019/4/24
+ * Time: 9:36
+ */
+namespace App\Http\Controllers;
+
+class ConfigController extends Controller
+{
+    /**
+     * Create a new controller instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        //
+    }
+    public function index()
+    {
+        $data = [
+            //商品类型
+            'order_expired_time' => config('customer.order_expired_time')
+        ];
+        return $this->jsonSuccess($data, '成功');
+    }
+
+}

+ 2 - 2
app/Http/Controllers/UploadController.php

@@ -22,7 +22,7 @@ class UploadController extends Controller
             $imageUrl = Storage::put($path . $filename, file_get_contents($filePath));
             Log::debug('upload_url:' . $imageUrl);
             if ($imageUrl) {
-                return $this->jsonSuccess(['url' => $path . $filename]);
+                return $this->jsonSuccess(['url' => config('customer.chxq_oss_url').$path . $filename]);
             } else {
                 return $this->jsonError('图片上传失败,请重试');
             }
@@ -43,7 +43,7 @@ class UploadController extends Controller
             $filename = time() . '_' . uniqid() . '.' . $kuoname;
             $imageUrl = Storage::put($filename, file_get_contents($filePath));
             if ($imageUrl) {
-                array_push($urls, $filename);
+                array_push($urls, config('customer.chxq_oss_url').$filename);
             } else {
                 Log::debug('文件上传失败。' . $filename);
             }

+ 2 - 0
config/customer.tpl

@@ -4,4 +4,6 @@ return [
     'app_secret' => '{app_secret}',
     'jwt_secret' => '{jwt_secret}',
     'app_service_url' => '{app_service_url}',
+    'chxq_oss_url' => '{chxq_oss_url}',
+    'order_expired_time' => '{order_expired_time}',
 ];

+ 2 - 0
routes/api.php

@@ -27,6 +27,8 @@ $api->version('v1', [
     });
     //仅验签
     $api->group(['middleware' => 'chxq_sign'], function ($api) {
+        //公共配置
+        $api->get('/config','ConfigController@index');
         //自提点列表
         $api->get('/pickupNode/index','ConfigPickupNodeController@index');
         //获取某自提点