Selaa lähdekoodia

Merge branch 'develop'

caihongxingqiu 6 vuotta sitten
vanhempi
commit
65ab4e9256

+ 6 - 1
.env.example

@@ -21,4 +21,9 @@ QUEUE_CONNECTION=sync
 ELASTICSEARCH_HOST=localhost
 ELASTICSEARCH_HOST=localhost
 ELASTICSEARCH_PORT=9200
 ELASTICSEARCH_PORT=9200
 ELASTICSEARCH_USER=
 ELASTICSEARCH_USER=
-ELASTICSEARCH_PASS=
+ELASTICSEARCH_PASS=
+
+APP_ID=chxq-platform
+CLUSTER=default
+APOLLO_NAMESPACES="application,shop-service"
+APOLLO_CONFIG_SERVER=http://47.92.174.125:18080

+ 2 - 1
.gitignore

@@ -4,4 +4,5 @@ Homestead.json
 Homestead.yaml
 Homestead.yaml
 .env
 .env
 /storage/*
 /storage/*
-composer.lock
+composer.lock
+/config/customer.php

+ 84 - 0
.rocketeer/config.php

@@ -0,0 +1,84 @@
+<?php
+
+use Rocketeer\Services\Connections\ConnectionsHandler;
+
+return [
+
+    // The name of the application to deploy
+    // This will create a folder of the same name in the root directory
+    // configured above, so be careful about the characters used
+    'application_name' => 'shop-service',
+
+    // Plugins
+    ////////////////////////////////////////////////////////////////////
+
+    // The plugins to load
+    'plugins'          => [// 'Rocketeer\Plugins\Slack\RocketeerSlack',
+    ],
+
+    // Logging
+    ////////////////////////////////////////////////////////////////////
+
+    // The schema to use to name log files
+    'logs'             => function (ConnectionsHandler $connections) {
+        return sprintf('%s-%s-%s.log', $connections->getConnection(), $connections->getStage(), date('Ymd'));
+    },
+
+    // Remote access
+    //
+    // You can either use a single connection or an array of connections
+    ////////////////////////////////////////////////////////////////////
+
+    // The default remote connection(s) to execute tasks on
+    'default'          => ['production'],
+
+    // The various connections you defined
+    // You can leave all of this empty or remove it entirely if you don't want
+    // to track files with credentials : Rocketeer will prompt you for your credentials
+    // and store them locally
+    'connections'      => [
+        'production' => [
+            'host'      => '47.92.174.125:2345',
+            'username'  => 'root',
+            'password'  => '',
+            'key'       => '/root/.ssh/id_rsa',
+            'keyphrase' => '',
+            'agent'     => '',
+            'db_role'   => true,
+        ],
+    ],
+
+    /*
+     * In most multiserver scenarios, migrations must be run in an exclusive server.
+     * In the event of not having a separate database server (in which case it can
+     * be handled through connections), you can assign a 'db_role' => true to the
+     * server's configuration and it will only run the migrations in that specific
+     * server at the time of deployment.
+     */
+    'use_roles'        => false,
+
+    // Contextual options
+    //
+    // In this section you can fine-tune the above configuration according
+    // to the stage or connection currently in use.
+    // Per example :
+    // 'stages' => array(
+    // 	'staging' => array(
+    // 		'scm' => array('branch' => 'staging'),
+    // 	),
+    //  'production' => array(
+    //    'scm' => array('branch' => 'master'),
+    //  ),
+    // ),
+    ////////////////////////////////////////////////////////////////////
+
+    'on'               => [
+
+        // Stages configurations
+        'stages'      => [],
+        // Connections configuration
+        'connections' => [],
+
+    ],
+
+];

+ 40 - 0
.rocketeer/hooks.php

@@ -0,0 +1,40 @@
+<?php
+
+return [
+
+    // Tasks
+    //
+    // Here you can define in the `before` and `after` array, Tasks to execute
+    // before or after the core Rocketeer Tasks. You can either put a simple command,
+    // a closure which receives a $task object, or the name of a class extending
+    // the Rocketeer\Abstracts\AbstractTask class
+    //
+    // In the `custom` array you can list custom Tasks classes to be added
+    // to Rocketeer. Those will then be available in the command line
+    // with all the other tasks
+    //////////////////////////////////////////////////////////////////////
+
+    // Tasks to execute before the core Rocketeer Tasks
+    'before' => [
+        'setup'   => [],
+        'deploy'  => [],
+        'cleanup' => [],
+    ],
+
+    // Tasks to execute after the core Rocketeer Tasks
+    'after'  => [
+        'setup'   => [],
+        'deploy'  => [
+            'composer dumpautoload',
+            'php artisan route:clear',
+            'chmod -R 777 bootstrap',
+            'chmod -R 777 storage',
+            'chmod -R 777 public'
+        ],
+        'cleanup' => [],
+    ],
+
+    // Custom Tasks to register with Rocketeer
+    'custom' => [],
+
+];

+ 24 - 0
.rocketeer/paths.php

@@ -0,0 +1,24 @@
+<?php
+
+return [
+
+    // Configurable paths
+    //
+    // Here you can manually set paths to some commands Rocketeer
+    // might try to use, if you leave those empty it will try to find them
+    // manually or assume they're in the root folder
+    //
+    // You can also add in this file custom paths for any command or binary
+    // Rocketeer might go looking for
+    ////////////////////////////////////////////////////////////////////
+
+    // Path to the PHP binary
+    'php'      => '/usr/local/php/bin/php',
+
+    // Path to Composer
+    'composer' => '/usr/local/bin/composer',
+
+    // Path to the Artisan CLI
+    'artisan'  => 'artisan',
+
+];

+ 80 - 0
.rocketeer/remote.php

@@ -0,0 +1,80 @@
+<?php
+
+return [
+
+    // Remote server
+    //////////////////////////////////////////////////////////////////////
+
+    // Variables about the servers. Those can be guessed but in
+    // case of problem it's best to input those manually
+    'variables'      => [
+        'directory_separator' => '/',
+        'line_endings'        => "\n",
+    ],
+
+    // The number of releases to keep at all times
+    'keep_releases'  => 4,
+
+    // Folders
+    ////////////////////////////////////////////////////////////////////
+
+    // The root directory where your applications will be deployed
+    // This path *needs* to start at the root, ie. start with a /
+    'root_directory' => '/data/wwwroot/beta',
+
+    // The folder the application will be cloned in
+    // Leave empty to use `application_name` as your folder name
+    'app_directory'  => '',
+
+    // A list of folders/file to be shared between releases
+    // Use this to list folders that need to keep their state, like
+    // user uploaded data, file-based databases, etc.
+    'shared'         => [
+        'storage',
+        'vendor',
+        '.env',
+    ],
+
+    // Execution
+    //////////////////////////////////////////////////////////////////////
+
+    // If enabled will force a shell to be created
+    // which is required for some tools like RVM or NVM
+    'shell'          => false,
+
+    // An array of commands to run under shell
+    'shelled'        => ['which', 'ruby', 'npm', 'bower', 'bundle', 'grunt'],
+
+    // Enable use of sudo for some commands
+    // You can specify a sudo user by doing
+    // 'sudo' => 'the_user'
+    'sudo' => false,
+
+    // An array of commands to run under sudo
+    'sudoed' => [],
+
+    // Permissions$
+    ////////////////////////////////////////////////////////////////////
+
+    'permissions'    => [
+
+        // The folders and files to set as web writable
+        'files'    => [
+            'bootstrap/cache',
+            'storage',
+        ],
+
+        // Here you can configure what actions will be executed to set
+        // permissions on the folder above. The Closure can return
+        // a single command as a string or an array of commands
+        'callback' => function ($task, $file) {
+            return [
+                sprintf('chmod -R 777 %s', $file),
+                sprintf('chmod -R g+s %s', $file),
+                sprintf('chown -R www:www %s', $file),
+            ];
+        },
+
+    ],
+
+];

+ 35 - 0
.rocketeer/scm.php

@@ -0,0 +1,35 @@
+<?php
+
+return [
+
+    // SCM repository
+    //////////////////////////////////////////////////////////////////////
+
+    // The SCM used (supported: "git", "svn")
+    'scm'        => 'git',
+
+    // The SSH/HTTPS address to your repository
+    // Example: https://github.com/vendor/website.git
+    'repository' => 'http://caihongxingqiu:Ch20151002@git.caihongxingqiu.net/rainbow/shop-service.git',
+
+    // The repository credentials : you can leave those empty
+    // if you're using SSH or if your repository is public
+    // In other cases you can leave this empty too, and you will
+    // be prompted for the credentials on deploy. If you don't want
+    // to be prompted (public repo, etc) set the values to null
+    'username'   => 'null',
+    'password'   => 'null',
+
+    // The branch to deploy
+    'branch'     => 'master',
+
+    // Whether your SCM should do a "shallow" clone of the repository
+    // or not – this means a clone with just the latest state of your
+    // application (no history)
+    // If you're having problems cloning, try setting this to false
+    'shallow'    => true,
+
+    // Recursively pull in submodules. Works only with GIT.
+    'submodules' => true,
+
+];

+ 19 - 0
.rocketeer/stages.php

@@ -0,0 +1,19 @@
+<?php
+
+return [
+
+    // Stages
+    //
+    // The multiples stages of your application
+    // if you don't know what this does, then you don't need it
+    //////////////////////////////////////////////////////////////////////
+
+    // Adding entries to this array will split the remote folder in stages
+    // Like /var/www/yourapp/staging and /var/www/yourapp/production
+    'stages'  => [],
+
+    // The default stage to execute tasks on when --stage is not provided
+    // Falsey means all of them
+    'default' => '',
+
+];

+ 61 - 0
.rocketeer/strategies.php

@@ -0,0 +1,61 @@
+<?php
+
+/*
+ * This file is part of Rocketeer
+ *
+ * (c) Maxime Fabre <ehtnam6@gmail.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+use Rocketeer\Binaries\PackageManagers\Composer;
+use Rocketeer\Tasks\Subtasks\Primer;
+
+return [
+
+    // Task strategies
+    //
+    // Here you can configure in a modular way which tasks to use to
+    // execute various core parts of your deployment's flow
+    //////////////////////////////////////////////////////////////////////
+
+    // Which strategy to use to check the server
+    'check'        => 'Php',
+
+    // Which strategy to use to create a new release
+    'deploy'       => 'Clone',
+
+    // Which strategy to use to test your application
+    'test'         => 'Phpunit',
+
+    // Which strategy to use to migrate your database
+    'migrate'      => 'Artisan',
+
+    // Which strategy to use to install your application's dependencies
+    'dependencies' => 'Composer',
+
+    // Execution hooks
+    //////////////////////////////////////////////////////////////////////
+
+    'composer'     => [
+        'install' => function (Composer $composer, $task) {
+            return $composer->install([], ['--no-interaction' => null, '--prefer-dist' => null]);
+        },
+        'update'  => function (Composer $composer) {
+            return $composer->update();
+        },
+    ],
+
+    // Here you can configure the Primer tasks
+    // which will run a set of commands on the local
+    // machine, determining whether the deploy can proceed
+    // or not
+    'primer'       => function (Primer $task) {
+        return [
+            // $task->executeTask('Test'),
+            // $task->binary('grunt')->execute('lint'),
+        ];
+    },
+
+];

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

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\Log;
+use Org\Multilinguals\Apollo\Client\ApolloClient;
+
+class Apollo extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'apollo';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Apollo配置服务';
+
+
+    private $apollo;
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+
+        $this->save_dir = storage_path('apollo');
+        $this->config_tpl = config_path() . '/customer.tpl';
+        $this->config_file = config_path() . '/customer.php';
+
+        $this->apollo = new ApolloClient(
+            config('apollo.config_server'),
+            config('apollo.app_id'),
+            config('apollo.namespaces')
+        );
+        $this->apollo->save_dir = $this->save_dir;
+        if(!is_dir($this->save_dir)){
+            mkdir($this->save_dir);
+        }
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return mixed
+     */
+    public function handle()
+    {
+        $this->line('apollo配置服务开启');
+        $restart = true; //失败自动重启
+        do {
+            $error = $this->apollo->start(function () {
+                $list = glob($this->save_dir . DIRECTORY_SEPARATOR . 'apolloConfig.*');
+                $apollo = [];
+                foreach ($list as $l) {
+                    $config = require $l;
+                    if (is_array($config) && isset($config['configurations'])) {
+                        $apollo = array_merge($apollo, $config['configurations']);
+                    }
+                }
+                if (!$apollo) {
+                    Log::error('Load Apollo Config Failed, no config available');
+                }
+                $tpl = file_get_contents($this->config_tpl);
+                foreach ($apollo as $key =>$value){
+                    $tpl = str_replace('{'.$key.'}',$value,$tpl);
+                }
+                file_put_contents($this->config_file,$tpl);
+            }); //此处传入回调
+            if ($error) {
+                Log::info("Apollo Hand error :" . $error);
+            }
+        } while ($error && $restart);
+    }
+}

+ 2 - 1
app/Console/Kernel.php

@@ -2,6 +2,7 @@
 
 
 namespace App\Console;
 namespace App\Console;
 
 
+use App\Console\Commands\Apollo;
 use Illuminate\Console\Scheduling\Schedule;
 use Illuminate\Console\Scheduling\Schedule;
 use Laravel\Lumen\Console\Kernel as ConsoleKernel;
 use Laravel\Lumen\Console\Kernel as ConsoleKernel;
 
 
@@ -13,7 +14,7 @@ class Kernel extends ConsoleKernel
      * @var array
      * @var array
      */
      */
     protected $commands = [
     protected $commands = [
-        //
+        Apollo::class
     ];
     ];
 
 
     /**
     /**

+ 14 - 0
app/Helper/helper.php

@@ -3,6 +3,20 @@
  * 添加自定义辅助函数
  * 添加自定义辅助函数
  */
  */
 
 
+if ( ! function_exists('config_path'))
+{
+    /**
+     * Get the configuration path.
+     *
+     * @param string $path
+     * @return string
+     */
+    function config_path($path = '')
+    {
+        return app()->basePath() . '/config' . ($path ? '/' . $path : $path);
+    }
+}
+
 /**
 /**
  * 参数签名校验
  * 参数签名校验
  * @param array $params
  * @param array $params

+ 59 - 0
app/Http/Controllers/V1/ShopController.php

@@ -0,0 +1,59 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019-05-06
+ * Time: 16:01
+ */
+
+namespace App\Http\Controllers\V1;
+
+
+use App\Shop;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Validator;
+
+class ShopController extends Controller {
+    /**
+     * @param Request $request
+     * @return array
+     * 获取商户详情
+     */
+    public function getShop(Request $request){
+        $data = $request->only('id');
+        $validator = Validator::make($data, [
+            'id' => 'required|integer',
+        ]);
+        if ($validator->fails()) {
+            return $this->jsonError($validator->errors()->first());
+        }
+        $res['data']  = Shop::where('shop_id',$data['id'])->first();
+        if($res){
+            return $this->jsonSuccess($res);
+        }else{
+            return $this->jsonError('获取失败');
+        }
+    }
+    /**
+     * @param Request $request
+     * @return array
+     * 根据ids 获取商户
+     */
+    public function getShopList(Request $request){
+        $data = $request->only('ids');
+        $validator = Validator::make($data, [
+            'ids' => 'required|string',
+        ]);
+        if ($validator->fails()) {
+            return $this->jsonError($validator->errors()->first());
+        }
+
+        $shop = Shop::whereIn('shop_id',explode(',',$data['ids']))->where('status',1)->pluck('shop_name','shop_id');
+        if($shop){
+            return $this->jsonSuccess($shop);
+        }else{
+            return $this->jsonError('失败未找到');
+        }
+
+    }
+}

+ 24 - 2
app/Http/Middleware/JwtAuthMiddleware.php

@@ -5,8 +5,8 @@ namespace App\Http\Middleware;
 use Closure;
 use Closure;
 use Tymon\JWTAuth\Exceptions\JWTException;
 use Tymon\JWTAuth\Exceptions\JWTException;
 use Tymon\JWTAuth\Exceptions\TokenExpiredException;
 use Tymon\JWTAuth\Exceptions\TokenExpiredException;
+use Tymon\JWTAuth\Exceptions\TokenInvalidException;
 use Tymon\JWTAuth\Facades\JWTAuth;
 use Tymon\JWTAuth\Facades\JWTAuth;
-use Tymon\JWTAuth\Http\Middleware\BaseMiddleware;
 
 
 class JwtAuthMiddleware
 class JwtAuthMiddleware
 {
 {
@@ -21,7 +21,22 @@ class JwtAuthMiddleware
     {
     {
 
 
         try {
         try {
-            $user = JWTAuth::parseToken()->authenticate();
+            $token = JWTAuth::getToken();
+            if(empty($token)){
+                $error = [
+                    'message' => 'token is required',
+                    'code' => 401,
+                ];
+                return response()->json($error);
+            }
+            $data = JWTAuth::decode($token)['user'];
+            if ($data->sign !== md5($data->uid . env('JWT_SECRET'))) {
+                $error = [
+                    'message' => 'request is not allow',
+                    'code' => 401,
+                ];
+                return response()->json($error);
+            }
         } catch (TokenExpiredException $e) {
         } catch (TokenExpiredException $e) {
             $error = [
             $error = [
                 'message' => 'Token is Expired',
                 'message' => 'Token is Expired',
@@ -39,6 +54,13 @@ class JwtAuthMiddleware
                 'message' => $e->getMessage(),
                 'message' => $e->getMessage(),
                 'code' => 401,
                 'code' => 401,
             ];
             ];
+
+            return response()->json($error)->setStatusCode(401);
+        }catch (\Exception $e){
+            $error = [
+                'message' => $e->getMessage(),
+                'code' => 401,
+            ];
             return response()->json($error)->setStatusCode(401);
             return response()->json($error)->setStatusCode(401);
         }
         }
         return $next($request);
         return $next($request);

+ 40 - 0
app/Shop.php

@@ -0,0 +1,40 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019-04-28
+ * Time: 15:30
+ */
+
+namespace App;
+
+
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\SoftDeletes;
+
+class Shop extends Model
+{
+    use SoftDeletes;
+
+    protected $primaryKey = 'shop_id';
+
+    public $table = 'shop';
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array
+     */
+    protected $fillable = ['shop_name','shop_short_name','mobile','address','province_id','province_name','city_id','city_name','contact_mobile','contact_name','shop_desc','status','logo_img','license_img','food_trans_license','other_license','proportion','verify_type','star'];
+
+    /**
+     * The attributes excluded from the model's JSON form.
+     *
+     * @var array
+     */
+    protected $hidden = [];
+    //关联账户
+    public function account()
+    {
+        return $this->hasOne('App\ShopAccount', 'shop_id', 'shop_id');
+    }
+}

+ 1 - 0
bootstrap/app.php

@@ -26,6 +26,7 @@ $app->withFacades();
 $app->withEloquent();
 $app->withEloquent();
 
 
 $app->configure('api');
 $app->configure('api');
+$app->configure('apollo');
 $app->configure('auth');
 $app->configure('auth');
 $app->configure('jwt');
 $app->configure('jwt');
 $app->configure('customer');
 $app->configure('customer');

+ 1 - 0
composer.json

@@ -16,6 +16,7 @@
         "predis/predis": "^1.1",
         "predis/predis": "^1.1",
         "tymon/jwt-auth": "1.0.0-rc.4.1",
         "tymon/jwt-auth": "1.0.0-rc.4.1",
         "vlucas/phpdotenv": "^3.3",
         "vlucas/phpdotenv": "^3.3",
+        "multilinguals/apollo-client": "^0.1.2",
         "yansongda/laravel-pay": "^2.0"
         "yansongda/laravel-pay": "^2.0"
     },
     },
     "require-dev": {
     "require-dev": {

+ 10 - 0
config/apollo.php

@@ -0,0 +1,10 @@
+<?php
+
+return [
+    'namespaces' => explode(',', env('APOLLO_NAMESPACES')),
+    'cluster' => env('APOLLO_CLUSTER'),
+    'save_dir' => storage_path('apollo'),
+    'config_server' => env('APOLLO_CONFIG_SERVER'),
+    'app_id' => env('APP_ID'),
+    'timeout_interval' => 70
+];

+ 0 - 5
config/customer.php

@@ -1,5 +0,0 @@
-<?php
-//此文件为apollo配置文件模板,禁止修改移动
-return [
-    'app_secret' => 'aaaaaaaaaaa'
-];

+ 7 - 0
config/customer.tpl

@@ -0,0 +1,7 @@
+<?php
+//此文件为apollo配置文件模板,禁止修改移动
+return [
+    'app_secret' => '{app_secret}',
+    'jwt_secret' => '{jwt_secret}',
+    'app_service_url' => '{app_service_url}',
+];

+ 1 - 1
config/jwt.php

@@ -25,7 +25,7 @@ return [
     |
     |
     */
     */
 
 
-    'secret' => env('JWT_SECRET'),
+    'secret' => env('JWT_SECRET',config('customer.jwt_secret')),
 
 
     /*
     /*
     |--------------------------------------------------------------------------
     |--------------------------------------------------------------------------

+ 20 - 0
deploy/nginx/conf.d/app.beta.conf

@@ -0,0 +1,20 @@
+server {
+    listen 80;
+    index index.php index.html;
+    error_log  /var/log/nginx/error.log;
+    access_log /var/log/nginx/access.log;
+    root /var/www/public;
+    location ~ \.php$ {
+        try_files $uri =404;
+        fastcgi_split_path_info ^(.+\.php)(/.+)$;
+        fastcgi_pass app_shop_service_beta:9000;
+        fastcgi_index index.php;
+        include fastcgi_params;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_param PATH_INFO $fastcgi_path_info;
+    }
+    location / {
+        try_files $uri $uri/ /index.php?$query_string;
+        gzip_static on;
+    }
+}

+ 20 - 0
deploy/nginx/conf.d/app.dev.conf

@@ -0,0 +1,20 @@
+server {
+    listen 80;
+    index index.php index.html;
+    error_log  /var/log/nginx/error.log;
+    access_log /var/log/nginx/access.log;
+    root /var/www/public;
+    location ~ \.php$ {
+        try_files $uri =404;
+        fastcgi_split_path_info ^(.+\.php)(/.+)$;
+        fastcgi_pass app_shop_service_dev:9000;
+        fastcgi_index index.php;
+        include fastcgi_params;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_param PATH_INFO $fastcgi_path_info;
+    }
+    location / {
+        try_files $uri $uri/ /index.php?$query_string;
+        gzip_static on;
+    }
+}

+ 2 - 0
deploy/php/local.ini

@@ -0,0 +1,2 @@
+upload_max_filesize=40M
+post_max_size=40M

+ 32 - 0
docker-compose-beta.yml

@@ -0,0 +1,32 @@
+version: '3'
+
+services:
+  app_shop_service_beta:
+    image: harbor.caihongxingqiu.com:9401/library/php:latest
+    tty: true
+    working_dir: /var/www
+    volumes:
+      - ./:/var/www
+      - ./deploy/php/local.ini:/usr/local/etc/php/conf.d/local.ini
+      - /data/wwwroot/beta/shop-service:/data/wwwroot/beta/shop-service
+    networks:
+      - chxq
+
+  server_shop_service_beta:
+    image: harbor.caihongxingqiu.com:9401/library/nginx:latest
+    tty: true
+    depends_on:
+      - app_shop_service_beta
+    ports:
+      - "28209:80"
+    volumes:
+      - ./:/var/www
+      - ./deploy/nginx/conf.d/app.beta.conf:/etc/nginx/conf.d/app.beta.conf
+    networks:
+      - chxq
+
+#docker networks
+#docker network create --driver overlay chxq
+networks:
+  chxq:
+    external: true

+ 31 - 0
docker-compose-dev.yml

@@ -0,0 +1,31 @@
+version: '3'
+
+services:
+  app_shop_service_dev:
+    image: harbor.caihongxingqiu.com:9401/library/php:latest
+    tty: true
+    working_dir: /var/www
+    volumes:
+      - ./:/var/www
+      - ./deploy/php/local.ini:/usr/local/etc/php/conf.d/local.ini
+    networks:
+      - chxq
+
+  server_shop_service_dev:
+    image: harbor.caihongxingqiu.com:9401/library/nginx:latest
+    tty: true
+    depends_on:
+      - app_shop_service_dev
+    ports:
+      - "18209:80"
+    volumes:
+      - ./:/var/www
+      - ./deploy/nginx/conf.d/app.dev.conf:/etc/nginx/conf.d/app.dev.conf
+    networks:
+      - chxq
+
+#docker networks
+#docker network create --driver overlay chxq
+networks:
+  chxq:
+    external: true

+ 7 - 55
routes/api.php

@@ -16,68 +16,20 @@ $api = app('Dingo\Api\Routing\Router');
 $api->version('v1', [
 $api->version('v1', [
     'namespace' => 'App\Http\Controllers\V1',
     'namespace' => 'App\Http\Controllers\V1',
 ], function ($api) {
 ], function ($api) {
-    //登录
-    $api->post('login', 'AuthController@authenticate');
-    //测试签名
-    $api->post('sign', 'IndexController@index4');
-    //测试支付宝 支付
-    $api->post('alipay', 'AlipayController@index');
-    //回调
-    $api->post('return', 'AlipayController@return');
-    //异步回调
-    $api->post('notify', 'AlipayController@notify');
-    //测试微信支付
-    $api->post('weixin', 'WeixinPayController@index');
-    //微信回调
-    $api->post('wxin_notify', 'WeixinPayController@notify');
-    //测试短信验证码
-    $api->post('send_sms', 'SendSmsController@index');
-    //手机号码注册
-    $api->post('mobileRegister', 'AuthController@mobileRegister');
-    //微信注册
-    $api->post('weixinRegister', 'AuthController@weixinRegister');
-    //手机号码,密码登录
-    $api->post('mobileLogin', 'AuthController@mobileLogin');
-    //手机号码短信登陆
-    $api->post('mobileSmsLogin', 'AuthController@mobileSmsLogin');
-    //微信登录
-    $api->post('weixinLogin', 'AuthController@weixinLogin');
-    //测试reids
-    $api->post('loginCount', 'AuthController@loginCount');
+
 
 
 
 
     $api->group(['middleware' => 'auth:api'], function ($api) {
     $api->group(['middleware' => 'auth:api'], function ($api) {
 
 
     });
     });
-
+    $api->post('view', 'ShopController@getShop');
+    //获取商户列表
+    $api->post('getShopList', 'ShopController@getShopList');
     //登录+验签
     //登录+验签
     $api->group(['middleware' => ['chxq_jwt_auth','chxq_sign']], function ($api) {
     $api->group(['middleware' => ['chxq_jwt_auth','chxq_sign']], function ($api) {
-        //登出
-        $api->post('logout', 'AuthController@logout');
-        //刷新身份令牌
-        $api->post('refresh', 'AuthController@refresh');
-        //绑定微信
-        $api->post('bindWeixin', 'AuthController@bindWeixin');
-        //绑定手机
-        $api->post('bindMobile', 'AuthController@bindMobile');
-        //设置密码
-        $api->post('setPassword', 'AuthController@setPassword');
-        //修改密码
-        $api->post('updatePassword', 'AuthController@updatePassword');
-        //解绑温馨
-        $api->post('unbindWeixin', 'AuthController@unbindWeixin');
-        //检查微信号是否绑定
-        $api->post('isBindWeixin', 'AuthController@isBindWeixin');
-        //新增快递地址
-        $api->post('addExpressAddress', 'MemberExpressAddressController@addExpressAddress');
-        //新增自提地址
-        $api->post('addSelfAddress', 'MemberExpressAddressController@addSelfAddress');
-        //用户自提地址
-        $api->post('selfAddressList', 'MemberExpressAddressController@selfAddressList');
-        //删除地址
-        $api->post('addressDelete', 'MemberExpressAddressController@delete');
-        //设置默认地址
-        $api->post('addressIsDefault', 'MemberExpressAddressController@isDefault');
+
+        //获取商户详情
+
     });
     });
     //仅验签
     //仅验签
     $api->group(['middleware' => 'chxq_sign'], function ($api) {
     $api->group(['middleware' => 'chxq_sign'], function ($api) {