胖虎 3 лет назад
Родитель
Сommit
5270bea083

+ 26 - 0
app/Http/Controllers/AdminApi/CommonController.php

@@ -0,0 +1,26 @@
+<?php
+
+
+namespace App\Http\Controllers\AdminApi;
+
+
+use App\Http\Controllers\AdminController;
+use App\Servers\Common\CommonServer;
+
+class CommonController extends AdminController
+{
+
+    /**
+     * 获取阿里云临时权限
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getAliSts()
+    {
+        $ret = CommonServer::creatServer()->getAliSts();
+        if (empty($ret['code'])) {
+            return $this->apiResponseError($ret['msg']);
+        } else {
+            return $this->apiResponseSuccess($ret['msg'], $ret['data']);
+        }
+    }
+}

+ 81 - 0
app/Http/Controllers/AdminApi/LoginController.php

@@ -0,0 +1,81 @@
+<?php
+
+namespace App\Http\Controllers\AdminApi;
+
+use App\Http\Controllers\AdminController;
+use App\Models\SysModels\User;
+use App\Servers\Common\CommonServer;
+use App\Servers\Common\PassServer;
+use App\Servers\Common\RedisDataServer;
+
+class LoginController extends AdminController
+{
+
+    /**
+     * 后台登录
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function login(){
+//        $type = request()->input('type',1);//登录类型 1密码2验证码
+        $phone = request()->input('phone', '');//账号
+        $password = request()->input('password', '123456');//密码
+        $code = request()->input('code', '');//验证码
+
+//        if(!in_array($type,[1,2]))  return $this->apiResponseError('缺少必要参数');
+        if (empty($phone))  return $this->apiResponseError( '登录手机号必填');
+        if(!CommonServer::creatServer()->verifyPhoneNumber($phone)){
+            return $this->apiResponseError( '手机号不正确');
+        }
+
+        if (empty($password))  return $this->apiResponseError( '登录密码必填');
+        //获取用户信息
+        $where = [['is_del',0], ['phone',$phone]];
+
+        $user = User::where($where)->select(['id', 'password', 'encrypt', 'api_token','status'])->first();
+        if (empty($user)) {
+            return $this->apiResponseError('当前账户不存在');
+        }
+        if ($user['status'] == 2) {
+            return $this->apiResponseError('账户已关闭');
+        }
+        //密码验证
+        $pass_server = PassServer::creatServer($password, $user->{'encrypt'});
+        if (!$pass_server->verifyPass($user->{'password'})) {
+            return $this->apiResponseError('登陆密码错误');
+        }
+
+        //记录旧token
+        $old_token = 'gw_adminLogin_' . $user['api_token'];
+        //生成token
+        $token = hash('sha256', $user['id'] . 'token' . time());
+        $update['api_token'] = $token;
+        //更新token
+        $token_ret = $user->update($update);
+
+        if(empty($token_ret)){
+            return $this->apiResponseError('登陆信息更新失败');
+        }
+        //清除原token缓存
+        if(RedisDataServer::creatServer()->getData($old_token,'json')){
+            RedisDataServer::creatServer()->delData($old_token);
+        }
+        //获取用户信息
+        $info = User::where('api_token', $token)->select(['id','name','phone'])->first();
+        return $this->apiResponseSuccess('登录成功',['token'=>$token,'user'=>$info]);
+    }
+
+    /**
+     * 退出登录
+     * @return \Illuminate\Http\JsonResponse
+     */
+    public function logout()
+    {
+        $token = request()->input('api_token');
+        if(empty($token)) $token = request()->header('ApiToken');
+        //清除原token缓存
+        RedisDataServer::creatServer()->delData( 'adminApiLogin_' . $token);
+        User::where('api_token', $token)->update(['api_token'=>'']);
+
+        return $this->apiResponseSuccess('退出成功');
+    }
+}

+ 24 - 0
app/Http/Controllers/Api/IndexController.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Http\Controllers\FrontController;
+use App\Models\SysModels\Config;
+
+class IndexController extends FrontController
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+
+    /**
+     * 获取网站基础信息
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getWebsite(){
+        $configs = Config::whereIn('key',['logo','title'])->pluck('value','key');
+        return $this->apiResponseSuccess('获取成功',$configs);
+    }
+}

+ 24 - 0
app/Http/Controllers/FrontController.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Http\Controllers\Traits\ApiResponseTrait;
+use Illuminate\Foundation\Bus\DispatchesJobs;
+use Illuminate\Foundation\Validation\ValidatesRequests;
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+
+class FrontController extends Controller
+{
+    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+    use ApiResponseTrait;
+
+    // 接口响应
+    protected $member = null;
+
+    public function __construct()
+    {
+
+    }
+
+
+}

+ 52 - 0
app/Http/Middleware/AdminApiAuthMiddleware.php

@@ -2,11 +2,16 @@
 
 namespace App\Http\Middleware;
 
+use App\Models\SysModels\User;
+use App\Servers\Common\PermissionServer;
+use App\Servers\Common\RedisDataServer;
 use Closure;
 
 class AdminApiAuthMiddleware
 {
     private $noAuth = [
+        'adminApi.login',
+        'adminApi.logout',
     ];
     /**
      * Handle an incoming request.
@@ -22,6 +27,53 @@ class AdminApiAuthMiddleware
         if (in_array($clientRoute, $this->noAuth)) {//不需要验证的路由
             return $next($request);
         }
+
+        //获取token
+        $api_token = $request->input('api_token');
+        if(empty($api_token)) $api_token = $request->header('ApiToken');
+        if(empty($api_token)){
+            return response()->json([
+                'msg'   => '缺少认证信息',
+                'code'  => 401,
+                'data' => []
+            ]);
+        }
+
+        //获取当前用户
+        $user = RedisDataServer::creatServer()->getData( 'gw_adminLogin_' . $api_token, 'json');
+        if(!$user){
+            //数据库查找当前用户
+            $user = User::where('api_token', $api_token)->where('is_del', 0)->first();
+            if($user){
+                //用户信息缓存
+                RedisDataServer::creatServer()->setData('gw_adminLogin_' . $api_token, $user, 'json', 300);
+            }else{
+                return response()->json([
+                    'msg'   => '身份验证失败',
+                    'code'  => 401,
+                    'data' => []
+                ]);
+            }
+
+        }
+        //状态验证
+        if($user['status'] == 2){
+            return response()->json([
+                'msg'   => '账号已关闭',
+                'code'  => 402,
+                'data' => []
+            ]);
+        }
+        //进行路由验证
+        $ret = PermissionServer::verifyAuth($user['role_id'], $clientRoute);
+        if (empty($ret) && $user['id'] != 1) {
+            return response()->json([
+                'msg' => '暂无权限',
+                'code' => 402,
+                'data' => []
+            ]);
+        }
+
         return $next($request);
     }
 }

+ 37 - 0
app/Models/SysModels/Config.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Models\SysModels;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Config extends Model
+{
+    /**
+     * 表名。
+     *
+     * @var string
+     */
+    protected $table = 'configs';
+
+    /**
+     * 与表关联的主键。
+     *
+     * @var string
+     */
+    protected $primaryKey = 'id';
+
+    /**
+     * 是否主动维护时间戳
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 不能被批量赋值的属性
+     *
+     * @var array
+     */
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+}

+ 39 - 0
app/Models/SysModels/Menu.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Models\SysModels;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Menu extends Model
+{
+
+    /**
+     * 表名。
+     *
+     * @var string
+     */
+    protected $table = 'menus';
+
+    /**
+     * 与表关联的主键。
+     *
+     * @var string
+     */
+    protected $primaryKey = 'id';
+
+    /**
+     * 是否主动维护时间戳
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 不能被批量赋值的属性
+     *
+     * @var array
+     */
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+
+}

+ 49 - 0
app/Models/SysModels/Role.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Models\SysModels;
+
+use Illuminate\Database\Eloquent\Model;
+use App\Models\Traits\Timestamp;
+
+class Role extends Model
+{
+    use Timestamp;
+
+    /**
+     * 表名。
+     *
+     * @var string
+     */
+    protected $table = 'roles';
+
+    /**
+     * 与表关联的主键。
+     *
+     * @var string
+     */
+    protected $primaryKey = 'id';
+
+    /**
+     * 是否主动维护时间戳
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 不能被批量赋值的属性
+     *
+     * @var array
+     */
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+    /**
+     * 时间格式化
+     * @var string[]
+     */
+    protected $casts = [
+        'created_at' => 'datetime:Y-m-d H:i:s',
+        'updated_at' => 'datetime:Y-m-d H:i:s'
+    ];
+
+}

+ 39 - 0
app/Models/SysModels/User.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Models\SysModels;
+
+use App\Models\Traits\Timestamp;
+use Illuminate\Database\Eloquent\Model;
+
+class User extends Model
+{
+    use Timestamp;
+    /**
+     * 表名。
+     *
+     * @var string
+     */
+    protected $table = 'users';
+
+    /**
+     * 与表关联的主键。
+     *
+     * @var string
+     */
+    protected $primaryKey = 'id';
+
+    /**
+     * 是否主动维护时间戳
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 不能被批量赋值的属性
+     *
+     * @var array
+     */
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+}

+ 27 - 0
app/Models/Traits/Timestamp.php

@@ -0,0 +1,27 @@
+<?php
+namespace App\Models\Traits;
+
+trait Timestamp{
+
+    public function getCreatedAtAttribute($rawTime){
+        return $this->changeTimeZone($rawTime, '',config('app.timezone'));
+    }
+
+    public function getUpdatedAtAttribute($rawTime){
+        return $this->changeTimeZone($rawTime, '',config('app.timezone'));
+    }
+
+    public function changeTimeZone($dateString, $timeZoneSource = null, $timeZoneTarget = null){
+
+        if (empty($timeZoneSource)) {
+            $timeZoneSource = date_default_timezone_get();
+        }
+        if (empty($timeZoneTarget)) {
+            $timeZoneTarget = date_default_timezone_get();
+        }
+
+        $dt = new \DateTime($dateString, new \DateTimeZone($timeZoneSource));
+        $dt->setTimezone(new \DateTimeZone($timeZoneTarget));
+        return $dt->format('Y-m-d H:i:s');
+    }
+}

+ 0 - 44
app/Models/User.php

@@ -1,44 +0,0 @@
-<?php
-
-namespace App\Models;
-
-use Illuminate\Contracts\Auth\MustVerifyEmail;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
-use Illuminate\Foundation\Auth\User as Authenticatable;
-use Illuminate\Notifications\Notifiable;
-use Laravel\Sanctum\HasApiTokens;
-
-class User extends Authenticatable
-{
-    use HasApiTokens, HasFactory, Notifiable;
-
-    /**
-     * The attributes that are mass assignable.
-     *
-     * @var array<int, string>
-     */
-    protected $fillable = [
-        'name',
-        'email',
-        'password',
-    ];
-
-    /**
-     * The attributes that should be hidden for serialization.
-     *
-     * @var array<int, string>
-     */
-    protected $hidden = [
-        'password',
-        'remember_token',
-    ];
-
-    /**
-     * The attributes that should be cast.
-     *
-     * @var array<string, string>
-     */
-    protected $casts = [
-        'email_verified_at' => 'datetime',
-    ];
-}

+ 1 - 0
app/Providers/RouteServiceProvider.php

@@ -18,6 +18,7 @@ class RouteServiceProvider extends ServiceProvider
      * @var string
      */
     public const HOME = '/home';
+    protected $namespace = 'App\Http\Controllers';
 
     /**
      * The controller namespace for the application.

+ 139 - 0
app/Servers/Common/CommonServer.php

@@ -0,0 +1,139 @@
+<?php
+
+
+namespace App\Servers\Common;
+
+
+
+use AlibabaCloud\Client\AlibabaCloud;
+use AlibabaCloud\Client\Exception\ClientException;
+use AlibabaCloud\Client\Exception\ServerException;
+
+/**
+ * Redis数据缓存类
+ */
+class CommonServer
+{
+
+    /**
+     * 错误信息
+     * @var string
+     */
+    private $errorMsg = '';
+
+    static private $server = null;
+
+
+    private function __construct()
+    {
+
+    }
+
+    /**
+     * 创建对象
+     * @return CommonServer
+     */
+    static function creatServer()
+    {
+        if (empty(self::$server)) self::$server = new CommonServer();
+        return self::$server;
+    }
+
+    /**
+     * 获取真实IP
+     * @return mixed
+     */
+    function getClientIp()
+    {
+        $http_x_forwarded_for = request()->header('x-forwarded-for');
+        if (empty($http_x_forwarded_for)) {
+            return request()->getClientIp();
+        } else {
+            $http_x_forwarded_for = explode(',', $http_x_forwarded_for);
+            return $http_x_forwarded_for[0];
+        }
+    }
+
+    /**
+     * 字符串去标签过滤及空格过滤
+     * @param $str_name
+     * @param $default
+     * @return string
+     */
+    function filtrationStr($str_name, $default = '')
+    {
+        $str = request()->input($str_name, $default);
+        if (empty($str)) return $str;
+        if (!is_string($str)) {
+            $str = json_encode($str);
+            $str = strip_tags($str);
+            $str = trim($str);
+            $str = json_decode($str, true);
+        } else {
+            $str = strip_tags($str);
+            $str = trim($str);
+        }
+        return $str;
+    }
+
+    /**
+     * 验证手机号码格式
+     * @param $phone
+     * @return bool
+     */
+    public function verifyPhoneNumber($phone)
+    {
+        if (empty($phone)) return false;
+        if (!preg_match('/^1[3-9]\d{9}$/', $phone)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 获取阿里云sts临时权限
+     */
+    function getAliSts()
+    {
+        $data = RedisDataServer::creatServer()->getData('sts_data');
+        if ($data) {
+            $data = json_decode($data, true);
+        } else {
+            $accessKeyId = env('ALI_OSS_ACCESS_ID');
+            $accessSecret = env('ALI_OSS_ACCESS_KEY');
+            AlibabaCloud::accessKeyClient($accessKeyId, $accessSecret)->regionId('cn-hangzhou')->asDefaultClient();
+            //设置参数,发起请求。
+            try {
+                $result = AlibabaCloud::rpc()
+                    ->product('Sts')
+                    ->scheme('https') // https | http
+                    ->version('2015-04-01')
+                    ->action('AssumeRole')
+                    ->method('POST')
+                    ->host('sts.aliyuncs.com')
+                    ->options([
+                        'query' => [
+                            'RegionId' => "cn-chengdu",
+                            'RoleArn' => "acs:ram::1470797691368660:role/oss-js",
+                            'RoleSessionName' => "js-oss-serve",
+                            'DurationSeconds' => 900,
+                        ],
+                    ])
+                    ->request();
+                $result = $result->toArray();
+                if (empty($result['Credentials'])) {
+                    return ['code' => 0, 'msg' => '获取token信息失败'];
+                }
+                $data = $result['Credentials'];
+                unset($data['Expiration']);
+                RedisDataServer::creatServer()->setData('sts_data', $data, 'json', 800);
+            } catch (ClientException $e) {
+                return ['code' => 0, 'msg' => $e->getErrorMessage()];
+            } catch (ServerException $e) {
+                return ['code' => 0, 'msg' => $e->getErrorMessage()];
+            }
+        }
+        return ['code' => 1, 'msg' => '获取信息成功', 'data' => $data];
+
+    }
+}

+ 89 - 0
app/Servers/Common/MenuServer.php

@@ -0,0 +1,89 @@
+<?php
+
+
+namespace App\Servers\Common;
+
+use App\Models\SysModels\Menu;
+use App\Models\SysModels\Role;
+
+
+/**
+ * 后台菜单路由
+ */
+class MenuServer
+{
+    /**
+     * 单列对象
+     * @var
+     */
+    private static $server;
+
+    private function __construct()
+    {
+
+    }
+
+    /**
+     * 创建对象
+     * @return MenuServer
+     */
+    static function creatServer()
+    {
+        if (empty(self::$server)) {
+            self::$server = new MenuServer();
+        }
+        return self::$server;
+    }
+
+    /**
+     * 获取后台菜单
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getMenuList($role_id = ''){
+        if($role_id){
+            //获取该角色的权限节点
+            $permission_ids = Role::where('id', $role_id)->value('permission_ids');
+            $url_ids = explode(',', $permission_ids);
+        }else{
+            $url_ids = [];
+        }
+        //获取数据
+        $list = Menu::where([['p_id',0], ['level',1]])
+            ->select(['id as value','menu_name as label'])
+            ->orderBy('sort','asc')
+            ->get();
+        foreach ($list as $value){
+            $value['is_check'] = in_array($value['value'],$url_ids) ? 1 : 0;
+            $value['children'] = Menu::where([['level',2], ['p_id',$value['value']]])->orderBy('sort', 'asc')->select(['id as value','menu_name as label'])->get();
+            foreach ($value['children'] as $item){
+                $item['is_check'] = in_array($item['value'],$url_ids) ? 1 : 0;
+                $item['children'] = Menu::where([['level',3], ['p_id',$item['value']]])->orderBy('sort', 'asc')->select(['id as value','menu_name as label'])->get();
+                foreach ($item['children'] as $three){
+                    $three['is_check'] = in_array($three['value'],$url_ids) ? 1 : 0;
+                }
+            }
+        }
+        return $list;
+    }
+
+    /**
+     * 获取系统后台角色对应权限节点
+     * @param $role_id
+     * @return false|mixed|string[]
+     */
+    function getRole($role_id){
+        //获取该角色的权限节点
+        $key_name = 'gw_role_ids_' . $role_id;
+        $url_ids = RedisDataServer::creatServer()->getData($key_name,'json');
+
+        if(empty($url_ids)){
+            $permission_ids = Role::where('id', $role_id)->value('permission_ids');
+            $url_ids = explode(',', $permission_ids);
+            RedisDataServer::creatServer()->setData($key_name,$url_ids,'json',7200);
+        }
+        if (empty($url_ids)) {
+            return false;
+        }
+        return $url_ids;
+    }
+}

+ 135 - 0
app/Servers/Common/PassServer.php

@@ -0,0 +1,135 @@
+<?php
+
+
+namespace App\Servers\Common;
+
+
+/**
+ * Redis数据缓存类
+ */
+class PassServer
+{
+
+    /**
+     * 错误信息
+     * @var string
+     */
+    private $errorMsg = '';
+
+    private $password = '';
+
+
+    private function __construct($password = '', $encrypt = '')
+    {
+        $this->setPassword($password);
+        $this->setEncrypt($encrypt);
+    }
+
+    /**
+     * 创建对象
+     * @param string $password
+     * @param string $encrypt
+     * @return PassServer
+     */
+    static function creatServer($password = '', $encrypt = '')
+    {
+        return new PassServer($password, $encrypt);
+    }
+
+    /**
+     * @return string
+     */
+    public function getPassword(): string
+    {
+        return $this->password;
+    }
+
+    /**
+     * @param string $password
+     */
+    public function setPassword($password = ''): void
+    {
+        if (!empty($password)) $this->password = $password;
+    }
+
+    /**
+     * @return string
+     */
+    public function getEncrypt(): string
+    {
+        return $this->encrypt;
+    }
+
+    /**
+     * @param string $encrypt
+     */
+    public function setEncrypt($encrypt = ''): void
+    {
+        if (!empty($encrypt)) $this->encrypt = $encrypt;
+    }
+
+    private $encrypt = '';
+
+
+    /**
+     * @return string
+     */
+    public function getErrorMsg(): string
+    {
+        return $this->errorMsg;
+    }
+
+    /**
+     * 加密字符串
+     * @param $length
+     * @return null|string
+     */
+    public function getRandChar($length = 6)
+    {
+        $str = null;
+        $strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
+        $max = strlen($strPol) - 1;
+        for ($i = 0; $i < $length; $i++) {
+            $str .= $strPol[rand(0, $max)];//rand($min,$max)生成介于min和max两个数之间的一个随机整数
+        }
+        return $str;
+    }
+
+    /**
+     * 创建会员密码
+     * @return array|false
+     */
+    function creatPassword()
+    {
+        if (empty($this->password)) {
+            $this->errorMsg = "密码不能为空";
+            return false;
+        }
+        if (empty($this->encrypt)) $this->encrypt = $this->getRandChar();
+        $password = $this->memberPassword();
+        return ['password' => $password, 'encrypt' => $this->encrypt];
+    }
+
+    /**
+     * 验证密码
+     * @param $member_pass
+     * @return bool
+     */
+    public function verifyPass($member_pass)
+    {
+        $str = $this->memberPassword();
+        return $member_pass == $str;
+    }
+
+    /**
+     * 密码加密
+     * @return string
+     */
+    private function memberPassword()
+    {
+        $str = md5($this->password) . md5($this->encrypt);
+        return md5($str);
+    }
+
+
+}

+ 43 - 0
app/Servers/Common/PermissionServer.php

@@ -0,0 +1,43 @@
+<?php
+
+
+namespace App\Servers\Common;
+
+
+
+use App\Models\SysModels\Menu;
+
+/**
+ * 权限验证
+ */
+class PermissionServer
+{
+
+    /**
+     * 后台权限检查
+     * @param $role_id
+     * @param $clientRoute
+     * @return bool
+     */
+    public static function verifyAuth($role_id, $clientRoute){
+        //跳过权限认证的路由
+        $url_list = [
+            'common.sts',
+        ];
+        if (in_array($clientRoute, $url_list) || $role_id == 0) {
+            return true;
+        }
+
+        $where = [['url_name',$clientRoute], ['status',1], ['is_del',0]];
+        $client_id = Menu::where($where)->value('id');
+        if (empty($client_id)) {
+            return false;
+        }
+        //获取该角色的权限节点
+        $url_ids = MenuServer::creatServer()->getRole($role_id);
+        if (empty($url_ids) || !in_array($client_id, $url_ids)) {
+            return false;
+        }
+        return true;
+    }
+}

+ 144 - 0
app/Servers/Common/RedisDataServer.php

@@ -0,0 +1,144 @@
+<?php
+
+
+namespace App\Servers\Common;
+
+use Illuminate\Support\Facades\Redis;
+
+
+/**
+ * Redis数据缓存类
+ */
+class RedisDataServer
+{
+    /**
+     * 单列对象
+     * @var
+     */
+    private static $server;
+
+    private function __construct()
+    {
+
+    }
+
+    /**
+     * 创建对象
+     * @return RedisDataServer
+     */
+    static function creatServer()
+    {
+        if (empty(self::$server)) {
+            self::$server = new RedisDataServer();
+        }
+        return self::$server;
+    }
+
+    /**
+     * 获取缓存数据
+     * @param $key
+     * @param string $type
+     * @return mixed
+     */
+    function getData($key, $type = 'str')
+    {
+
+        $value = Redis::get($key);
+        if ($type == 'json') {
+            $value = json_decode($value, true);
+        }
+        return $value;
+    }
+
+    /**
+     * 设置缓存数据
+     * @param $key
+     * @param $value
+     * @param string $type
+     * @param int $time
+     * @param $random
+     */
+    function setData($key, $value, $type = 'str', $time = 10, $random = true)
+    {
+        if (!empty($value)) {
+            if ($type == 'json') {
+                $value = json_encode($value);
+            }
+            if ($time > 1 && $random) $time += $this->getRandom();
+            Redis::setex($key, $time, $value);
+        }
+
+    }
+
+    /**
+     * 长时间存放数据
+     * @param $key
+     * @param $value
+     * @param string $type
+     */
+    function setLongData($key, $value, $type = 'str')
+    {
+        if (!empty($value)) {
+            if ($type == 'json') {
+                $value = json_encode($value);
+            }
+            Redis::set($key, $value);
+        }
+
+    }
+
+    /**
+     * 更新数据
+     * @param $key
+     * @param $value
+     * @param string $type
+     * @param int $start_num
+     */
+    function setSetrange($key, $value, $type = 'str', $start_num = 0)
+    {
+        if (!empty($value)) {
+            if ($type == 'json') {
+                $value = json_encode($value);
+            }
+            Redis::setrange($key, $start_num, $value);
+        }
+    }
+
+    /**
+     * 删除Redis数据
+     * @param $key
+     */
+    function delData($key)
+    {
+        Redis::del($key);
+    }
+
+    /**
+     * 获取随机数
+     * @return int
+     */
+    private function getRandom()
+    {
+        return mt_rand(1, 10);
+    }
+
+    /**
+     * 获取过期时间
+     * @param $key
+     * @return mixed
+     */
+    function getTime($key)
+    {
+        $key_num = Redis::ttl($key);
+        return $key_num;
+    }
+
+    /**
+     * 缓存清除
+     * @return mixed
+     */
+    function flushdb()
+    {
+        return Redis::flushdb();
+    }
+}

+ 1 - 0
composer.json

@@ -6,6 +6,7 @@
     "license": "MIT",
     "require": {
         "php": "^7.3|^8.0",
+        "alibabacloud/sdk": "^1.8",
         "fruitcake/laravel-cors": "^2.0",
         "guzzlehttp/guzzle": "^7.0.1",
         "laravel/framework": "^8.75",

+ 581 - 32
composer.lock

@@ -4,8 +4,384 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "c61ff82cbf0142a401a48a8161e1595a",
+    "content-hash": "0aea38a9727665403b2dc934fc4fc0eb",
     "packages": [
+        {
+            "name": "adbario/php-dot-notation",
+            "version": "2.4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/adbario/php-dot-notation.git",
+                "reference": "3bfe67895d26697d20485343499532234eeb7c08"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/adbario/php-dot-notation/zipball/3bfe67895d26697d20485343499532234eeb7c08",
+                "reference": "3bfe67895d26697d20485343499532234eeb7c08",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "php": "^5.5 || ^7.0 || ^8.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.8|^5.7|^6.6|^7.5|^8.5|^9.5",
+                "squizlabs/php_codesniffer": "^3.6"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "src/helpers.php"
+                ],
+                "psr-4": {
+                    "Adbar\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Riku Särkinen",
+                    "email": "riku@adbar.io"
+                }
+            ],
+            "description": "PHP dot notation access to arrays",
+            "homepage": "https://github.com/adbario/php-dot-notation",
+            "keywords": [
+                "ArrayAccess",
+                "dotnotation"
+            ],
+            "support": {
+                "issues": "https://github.com/adbario/php-dot-notation/issues",
+                "source": "https://github.com/adbario/php-dot-notation/tree/2.4.1"
+            },
+            "time": "2022-08-25T19:47:20+00:00"
+        },
+        {
+            "name": "alibabacloud/client",
+            "version": "1.5.31",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/aliyun/openapi-sdk-php-client.git",
+                "reference": "19224d92fe27ab8ef501d77d4891e7660bc023c1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/aliyun/openapi-sdk-php-client/zipball/19224d92fe27ab8ef501d77d4891e7660bc023c1",
+                "reference": "19224d92fe27ab8ef501d77d4891e7660bc023c1",
+                "shasum": ""
+            },
+            "require": {
+                "adbario/php-dot-notation": "^2.2",
+                "clagiordano/weblibs-configmanager": "^1.0",
+                "danielstjules/stringy": "^3.1",
+                "ext-curl": "*",
+                "ext-json": "*",
+                "ext-libxml": "*",
+                "ext-mbstring": "*",
+                "ext-openssl": "*",
+                "ext-simplexml": "*",
+                "ext-xmlwriter": "*",
+                "guzzlehttp/guzzle": "^6.3|^7.0",
+                "mtdowling/jmespath.php": "^2.5",
+                "php": ">=5.5"
+            },
+            "require-dev": {
+                "composer/composer": "^1.8",
+                "drupal/coder": "^8.3",
+                "ext-dom": "*",
+                "ext-pcre": "*",
+                "ext-sockets": "*",
+                "ext-spl": "*",
+                "league/climate": "^3.2.4",
+                "mikey179/vfsstream": "^1.6",
+                "monolog/monolog": "^1.24",
+                "phpunit/phpunit": "^5.7.27|^6.1",
+                "psr/cache": "^1.0",
+                "symfony/dotenv": "^3.4",
+                "symfony/var-dumper": "^3.4"
+            },
+            "suggest": {
+                "ext-sockets": "To use client-side monitoring"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "src/Functions.php"
+                ],
+                "psr-4": {
+                    "AlibabaCloud\\Client\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "Alibaba Cloud SDK",
+                    "email": "sdk-team@alibabacloud.com",
+                    "homepage": "http://www.alibabacloud.com"
+                }
+            ],
+            "description": "Alibaba Cloud Client for PHP - Use Alibaba Cloud in your PHP project",
+            "homepage": "https://www.alibabacloud.com/",
+            "keywords": [
+                "alibaba",
+                "alibabacloud",
+                "aliyun",
+                "client",
+                "cloud",
+                "library",
+                "sdk",
+                "tool"
+            ],
+            "support": {
+                "issues": "https://github.com/aliyun/openapi-sdk-php-client/issues",
+                "source": "https://github.com/aliyun/openapi-sdk-php-client"
+            },
+            "time": "2021-05-13T06:26:38+00:00"
+        },
+        {
+            "name": "alibabacloud/sdk",
+            "version": "1.8.1471",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/aliyun/openapi-sdk-php.git",
+                "reference": "e70053be0d2bbf1a2dfaa1335faab55024b01df0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/aliyun/openapi-sdk-php/zipball/e70053be0d2bbf1a2dfaa1335faab55024b01df0",
+                "reference": "e70053be0d2bbf1a2dfaa1335faab55024b01df0",
+                "shasum": ""
+            },
+            "require": {
+                "alibabacloud/client": "^1.5",
+                "ext-curl": "*",
+                "ext-json": "*",
+                "ext-libxml": "*",
+                "ext-mbstring": "*",
+                "ext-openssl": "*",
+                "ext-simplexml": "*",
+                "ext-xmlwriter": "*",
+                "php": ">=5.5"
+            },
+            "replace": {
+                "alibabacloud/aas": "self.version",
+                "alibabacloud/actiontrail": "self.version",
+                "alibabacloud/adb": "self.version",
+                "alibabacloud/aegis": "self.version",
+                "alibabacloud/afs": "self.version",
+                "alibabacloud/airec": "self.version",
+                "alibabacloud/alidns": "self.version",
+                "alibabacloud/alikafka": "self.version",
+                "alibabacloud/alimt": "self.version",
+                "alibabacloud/aliprobe": "self.version",
+                "alibabacloud/aliyuncvc": "self.version",
+                "alibabacloud/appmallsservice": "self.version",
+                "alibabacloud/arms": "self.version",
+                "alibabacloud/arms4finance": "self.version",
+                "alibabacloud/baas": "self.version",
+                "alibabacloud/batchcompute": "self.version",
+                "alibabacloud/bss": "self.version",
+                "alibabacloud/bssopenapi": "self.version",
+                "alibabacloud/cas": "self.version",
+                "alibabacloud/cbn": "self.version",
+                "alibabacloud/ccc": "self.version",
+                "alibabacloud/ccs": "self.version",
+                "alibabacloud/cdn": "self.version",
+                "alibabacloud/cds": "self.version",
+                "alibabacloud/cf": "self.version",
+                "alibabacloud/chatbot": "self.version",
+                "alibabacloud/cloudapi": "self.version",
+                "alibabacloud/cloudauth": "self.version",
+                "alibabacloud/cloudesl": "self.version",
+                "alibabacloud/cloudmarketing": "self.version",
+                "alibabacloud/cloudphoto": "self.version",
+                "alibabacloud/cloudwf": "self.version",
+                "alibabacloud/cms": "self.version",
+                "alibabacloud/commondriver": "self.version",
+                "alibabacloud/companyreg": "self.version",
+                "alibabacloud/cr": "self.version",
+                "alibabacloud/crm": "self.version",
+                "alibabacloud/cs": "self.version",
+                "alibabacloud/csb": "self.version",
+                "alibabacloud/cusanalyticsconline": "self.version",
+                "alibabacloud/dataworkspublic": "self.version",
+                "alibabacloud/dbs": "self.version",
+                "alibabacloud/dcdn": "self.version",
+                "alibabacloud/dds": "self.version",
+                "alibabacloud/democenter": "self.version",
+                "alibabacloud/dm": "self.version",
+                "alibabacloud/dmsenterprise": "self.version",
+                "alibabacloud/domain": "self.version",
+                "alibabacloud/domainintl": "self.version",
+                "alibabacloud/drcloud": "self.version",
+                "alibabacloud/drds": "self.version",
+                "alibabacloud/dts": "self.version",
+                "alibabacloud/dybaseapi": "self.version",
+                "alibabacloud/dyplsapi": "self.version",
+                "alibabacloud/dypnsapi": "self.version",
+                "alibabacloud/dysmsapi": "self.version",
+                "alibabacloud/dyvmsapi": "self.version",
+                "alibabacloud/eci": "self.version",
+                "alibabacloud/ecs": "self.version",
+                "alibabacloud/ecsinc": "self.version",
+                "alibabacloud/edas": "self.version",
+                "alibabacloud/ehpc": "self.version",
+                "alibabacloud/elasticsearch": "self.version",
+                "alibabacloud/emr": "self.version",
+                "alibabacloud/ess": "self.version",
+                "alibabacloud/facebody": "self.version",
+                "alibabacloud/fnf": "self.version",
+                "alibabacloud/foas": "self.version",
+                "alibabacloud/ft": "self.version",
+                "alibabacloud/goodstech": "self.version",
+                "alibabacloud/gpdb": "self.version",
+                "alibabacloud/green": "self.version",
+                "alibabacloud/hbase": "self.version",
+                "alibabacloud/hiknoengine": "self.version",
+                "alibabacloud/hpc": "self.version",
+                "alibabacloud/hsm": "self.version",
+                "alibabacloud/httpdns": "self.version",
+                "alibabacloud/idst": "self.version",
+                "alibabacloud/imageaudit": "self.version",
+                "alibabacloud/imageenhan": "self.version",
+                "alibabacloud/imagerecog": "self.version",
+                "alibabacloud/imagesearch": "self.version",
+                "alibabacloud/imageseg": "self.version",
+                "alibabacloud/imm": "self.version",
+                "alibabacloud/industrybrain": "self.version",
+                "alibabacloud/iot": "self.version",
+                "alibabacloud/iqa": "self.version",
+                "alibabacloud/itaas": "self.version",
+                "alibabacloud/ivision": "self.version",
+                "alibabacloud/ivpd": "self.version",
+                "alibabacloud/jaq": "self.version",
+                "alibabacloud/jarvis": "self.version",
+                "alibabacloud/jarvispublic": "self.version",
+                "alibabacloud/kms": "self.version",
+                "alibabacloud/linkedmall": "self.version",
+                "alibabacloud/linkface": "self.version",
+                "alibabacloud/linkwan": "self.version",
+                "alibabacloud/live": "self.version",
+                "alibabacloud/lubancloud": "self.version",
+                "alibabacloud/lubanruler": "self.version",
+                "alibabacloud/market": "self.version",
+                "alibabacloud/mopen": "self.version",
+                "alibabacloud/mpserverless": "self.version",
+                "alibabacloud/mts": "self.version",
+                "alibabacloud/multimediaai": "self.version",
+                "alibabacloud/nas": "self.version",
+                "alibabacloud/netana": "self.version",
+                "alibabacloud/nlp": "self.version",
+                "alibabacloud/nlpautoml": "self.version",
+                "alibabacloud/nlscloudmeta": "self.version",
+                "alibabacloud/nlsfiletrans": "self.version",
+                "alibabacloud/objectdet": "self.version",
+                "alibabacloud/ocr": "self.version",
+                "alibabacloud/ocs": "self.version",
+                "alibabacloud/oms": "self.version",
+                "alibabacloud/ons": "self.version",
+                "alibabacloud/onsmqtt": "self.version",
+                "alibabacloud/oos": "self.version",
+                "alibabacloud/openanalytics": "self.version",
+                "alibabacloud/ossadmin": "self.version",
+                "alibabacloud/ots": "self.version",
+                "alibabacloud/outboundbot": "self.version",
+                "alibabacloud/petadata": "self.version",
+                "alibabacloud/polardb": "self.version",
+                "alibabacloud/productcatalog": "self.version",
+                "alibabacloud/pts": "self.version",
+                "alibabacloud/push": "self.version",
+                "alibabacloud/pvtz": "self.version",
+                "alibabacloud/qualitycheck": "self.version",
+                "alibabacloud/ram": "self.version",
+                "alibabacloud/rds": "self.version",
+                "alibabacloud/reid": "self.version",
+                "alibabacloud/retailcloud": "self.version",
+                "alibabacloud/rkvstore": "self.version",
+                "alibabacloud/ros": "self.version",
+                "alibabacloud/rtc": "self.version",
+                "alibabacloud/saf": "self.version",
+                "alibabacloud/sas": "self.version",
+                "alibabacloud/sasapi": "self.version",
+                "alibabacloud/scdn": "self.version",
+                "alibabacloud/schedulerx2": "self.version",
+                "alibabacloud/skyeye": "self.version",
+                "alibabacloud/slb": "self.version",
+                "alibabacloud/smartag": "self.version",
+                "alibabacloud/smc": "self.version",
+                "alibabacloud/sms": "self.version",
+                "alibabacloud/smsintl": "self.version",
+                "alibabacloud/snsuapi": "self.version",
+                "alibabacloud/sts": "self.version",
+                "alibabacloud/taginner": "self.version",
+                "alibabacloud/tesladam": "self.version",
+                "alibabacloud/teslamaxcompute": "self.version",
+                "alibabacloud/teslastream": "self.version",
+                "alibabacloud/ubsms": "self.version",
+                "alibabacloud/ubsmsinner": "self.version",
+                "alibabacloud/uis": "self.version",
+                "alibabacloud/unimkt": "self.version",
+                "alibabacloud/visionai": "self.version",
+                "alibabacloud/vod": "self.version",
+                "alibabacloud/voicenavigator": "self.version",
+                "alibabacloud/vpc": "self.version",
+                "alibabacloud/vs": "self.version",
+                "alibabacloud/wafopenapi": "self.version",
+                "alibabacloud/welfareinner": "self.version",
+                "alibabacloud/xspace": "self.version",
+                "alibabacloud/xtrace": "self.version",
+                "alibabacloud/yqbridge": "self.version",
+                "alibabacloud/yundun": "self.version"
+            },
+            "require-dev": {
+                "composer/composer": "^1.8",
+                "league/climate": "^3.2.4",
+                "phpunit/phpunit": "^4.8",
+                "symfony/dotenv": "^3.4",
+                "symfony/var-dumper": "^3.4"
+            },
+            "suggest": {
+                "ext-sockets": "To use client-side monitoring"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "AlibabaCloud\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "Alibaba Cloud SDK",
+                    "email": "sdk-team@alibabacloud.com",
+                    "homepage": "http://www.alibabacloud.com"
+                }
+            ],
+            "description": "Alibaba Cloud SDK for PHP - Easier to Use Alibaba Cloud in your PHP project",
+            "homepage": "https://www.alibabacloud.com/",
+            "keywords": [
+                "alibaba",
+                "alibabacloud",
+                "aliyun",
+                "cloud",
+                "library",
+                "sdk"
+            ],
+            "support": {
+                "issues": "https://github.com/aliyun/openapi-sdk-php/issues",
+                "source": "https://github.com/aliyun/openapi-sdk-php"
+            },
+            "time": "2022-09-08T13:27:25+00:00"
+        },
         {
             "name": "asm89/stack-cors",
             "version": "v2.1.1",
@@ -122,6 +498,118 @@
             ],
             "time": "2021-08-15T20:50:18+00:00"
         },
+        {
+            "name": "clagiordano/weblibs-configmanager",
+            "version": "v1.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/clagiordano/weblibs-configmanager.git",
+                "reference": "5c8ebcc62782313b1278afe802b120d18c07a059"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/clagiordano/weblibs-configmanager/zipball/5c8ebcc62782313b1278afe802b120d18c07a059",
+                "reference": "5c8ebcc62782313b1278afe802b120d18c07a059",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.4"
+            },
+            "require-dev": {
+                "clagiordano/phpunit-result-printer": "^1",
+                "phpunit/phpunit": "^4.8"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "clagiordano\\weblibs\\configmanager\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-3.0-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "Claudio Giordano",
+                    "email": "claudio.giordano@autistici.org",
+                    "role": "Developer"
+                }
+            ],
+            "description": "weblibs-configmanager is a tool library for easily read and access to php config array file and direct read/write configuration file / object",
+            "keywords": [
+                "clagiordano",
+                "configuration",
+                "manager",
+                "tool",
+                "weblibs"
+            ],
+            "support": {
+                "issues": "https://github.com/clagiordano/weblibs-configmanager/issues",
+                "source": "https://github.com/clagiordano/weblibs-configmanager/tree/v1.2.0"
+            },
+            "time": "2021-05-18T17:55:57+00:00"
+        },
+        {
+            "name": "danielstjules/stringy",
+            "version": "3.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/danielstjules/Stringy.git",
+                "reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e",
+                "reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.4.0",
+                "symfony/polyfill-mbstring": "~1.1"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "src/Create.php"
+                ],
+                "psr-4": {
+                    "Stringy\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Daniel St. Jules",
+                    "email": "danielst.jules@gmail.com",
+                    "homepage": "http://www.danielstjules.com"
+                }
+            ],
+            "description": "A string manipulation library with multibyte support",
+            "homepage": "https://github.com/danielstjules/Stringy",
+            "keywords": [
+                "UTF",
+                "helpers",
+                "manipulation",
+                "methods",
+                "multibyte",
+                "string",
+                "utf-8",
+                "utility",
+                "utils"
+            ],
+            "support": {
+                "issues": "https://github.com/danielstjules/Stringy/issues",
+                "source": "https://github.com/danielstjules/Stringy"
+            },
+            "time": "2017-06-12T01:10:27+00:00"
+        },
         {
             "name": "dflydev/dot-access-data",
             "version": "v3.0.1",
@@ -366,16 +854,16 @@
         },
         {
             "name": "dragonmantank/cron-expression",
-            "version": "v3.3.1",
+            "version": "v3.3.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/dragonmantank/cron-expression.git",
-                "reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa"
+                "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/be85b3f05b46c39bbc0d95f6c071ddff669510fa",
-                "reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa",
+                "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8",
+                "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8",
                 "shasum": ""
             },
             "require": {
@@ -415,7 +903,7 @@
             ],
             "support": {
                 "issues": "https://github.com/dragonmantank/cron-expression/issues",
-                "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.1"
+                "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2"
             },
             "funding": [
                 {
@@ -423,7 +911,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2022-01-18T15:43:28+00:00"
+            "time": "2022-09-10T18:51:20+00:00"
         },
         {
             "name": "egulias/email-validator",
@@ -1205,16 +1693,16 @@
         },
         {
             "name": "laravel/serializable-closure",
-            "version": "v1.2.1",
+            "version": "v1.2.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laravel/serializable-closure.git",
-                "reference": "d78fd36ba031a1a695ea5a406f29996948d7011b"
+                "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/d78fd36ba031a1a695ea5a406f29996948d7011b",
-                "reference": "d78fd36ba031a1a695ea5a406f29996948d7011b",
+                "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/47afb7fae28ed29057fdca37e16a84f90cc62fae",
+                "reference": "47afb7fae28ed29057fdca37e16a84f90cc62fae",
                 "shasum": ""
             },
             "require": {
@@ -1261,7 +1749,7 @@
                 "issues": "https://github.com/laravel/serializable-closure/issues",
                 "source": "https://github.com/laravel/serializable-closure"
             },
-            "time": "2022-08-26T15:25:27+00:00"
+            "time": "2022-09-08T13:45:54+00:00"
         },
         {
             "name": "laravel/tinker",
@@ -1771,6 +2259,67 @@
             ],
             "time": "2022-07-24T11:55:47+00:00"
         },
+        {
+            "name": "mtdowling/jmespath.php",
+            "version": "2.6.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/jmespath/jmespath.php.git",
+                "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb",
+                "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.4 || ^7.0 || ^8.0",
+                "symfony/polyfill-mbstring": "^1.17"
+            },
+            "require-dev": {
+                "composer/xdebug-handler": "^1.4 || ^2.0",
+                "phpunit/phpunit": "^4.8.36 || ^7.5.15"
+            },
+            "bin": [
+                "bin/jp.php"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.6-dev"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/JmesPath.php"
+                ],
+                "psr-4": {
+                    "JmesPath\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                }
+            ],
+            "description": "Declaratively specify how to extract elements from a JSON document",
+            "keywords": [
+                "json",
+                "jsonpath"
+            ],
+            "support": {
+                "issues": "https://github.com/jmespath/jmespath.php/issues",
+                "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1"
+            },
+            "time": "2021-06-14T00:11:39+00:00"
+        },
         {
             "name": "nesbot/carbon",
             "version": "2.62.1",
@@ -1937,20 +2486,20 @@
         },
         {
             "name": "nette/utils",
-            "version": "v3.2.7",
+            "version": "v3.2.8",
             "source": {
                 "type": "git",
                 "url": "https://github.com/nette/utils.git",
-                "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99"
+                "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/nette/utils/zipball/0af4e3de4df9f1543534beab255ccf459e7a2c99",
-                "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99",
+                "url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
+                "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
                 "shasum": ""
             },
             "require": {
-                "php": ">=7.2 <8.2"
+                "php": ">=7.2 <8.3"
             },
             "conflict": {
                 "nette/di": "<3.0.6"
@@ -2016,9 +2565,9 @@
             ],
             "support": {
                 "issues": "https://github.com/nette/utils/issues",
-                "source": "https://github.com/nette/utils/tree/v3.2.7"
+                "source": "https://github.com/nette/utils/tree/v3.2.8"
             },
-            "time": "2022-01-24T11:29:14+00:00"
+            "time": "2022-09-12T23:36:20+00:00"
         },
         {
             "name": "nikic/php-parser",
@@ -5153,16 +5702,16 @@
         },
         {
             "name": "tijsverkoyen/css-to-inline-styles",
-            "version": "2.2.4",
+            "version": "2.2.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git",
-                "reference": "da444caae6aca7a19c0c140f68c6182e337d5b1c"
+                "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/da444caae6aca7a19c0c140f68c6182e337d5b1c",
-                "reference": "da444caae6aca7a19c0c140f68c6182e337d5b1c",
+                "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/4348a3a06651827a27d989ad1d13efec6bb49b19",
+                "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19",
                 "shasum": ""
             },
             "require": {
@@ -5200,9 +5749,9 @@
             "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles",
             "support": {
                 "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues",
-                "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.4"
+                "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.5"
             },
-            "time": "2021-12-08T09:12:39+00:00"
+            "time": "2022-09-12T13:28:28+00:00"
         },
         {
             "name": "vlucas/phpdotenv",
@@ -7535,16 +8084,16 @@
         },
         {
             "name": "sebastian/type",
-            "version": "3.1.0",
+            "version": "3.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/type.git",
-                "reference": "fb44e1cc6e557418387ad815780360057e40753e"
+                "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e",
-                "reference": "fb44e1cc6e557418387ad815780360057e40753e",
+                "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e",
+                "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e",
                 "shasum": ""
             },
             "require": {
@@ -7556,7 +8105,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "3.1-dev"
+                    "dev-master": "3.2-dev"
                 }
             },
             "autoload": {
@@ -7579,7 +8128,7 @@
             "homepage": "https://github.com/sebastianbergmann/type",
             "support": {
                 "issues": "https://github.com/sebastianbergmann/type/issues",
-                "source": "https://github.com/sebastianbergmann/type/tree/3.1.0"
+                "source": "https://github.com/sebastianbergmann/type/tree/3.2.0"
             },
             "funding": [
                 {
@@ -7587,7 +8136,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2022-08-29T06:55:37+00:00"
+            "time": "2022-09-12T14:47:03+00:00"
         },
         {
             "name": "sebastian/version",

+ 1 - 1
config/database.php

@@ -54,7 +54,7 @@ return [
             'unix_socket' => env('DB_SOCKET', ''),
             'charset' => 'utf8mb4',
             'collation' => 'utf8mb4_unicode_ci',
-            'prefix' => '',
+            'prefix' => 'x_',
             'prefix_indexes' => true,
             'strict' => true,
             'engine' => null,

+ 11 - 0
routes/adminApi/common.php

@@ -0,0 +1,11 @@
+<?php
+
+use Illuminate\Support\Facades\Route;
+
+Route::group(['domain' => env('APP_HOST'), 'prefix' => 'adminApi/common'],function(){
+
+    Route::match(['post','get'],'sts', 'CommonController@getAliSts')->name('common.sts');//获取阿里oss的sts
+
+});
+
+

+ 12 - 0
routes/adminApi/login.php

@@ -0,0 +1,12 @@
+<?php
+
+use Illuminate\Support\Facades\Route;
+
+
+Route::group( ['domain' => env('APP_HOST'), 'prefix' => 'adminApi'],function($router){
+    Route::match(['get','post'],'login', 'LoginController@login')->name('adminApi.login');// 登录
+    Route::match(['get','post'],'logout', 'LoginController@logout')->name('adminApi.logout');//退出
+
+});
+
+

+ 11 - 0
routes/api/index.php

@@ -0,0 +1,11 @@
+<?php
+
+use Illuminate\Support\Facades\Route;
+
+
+
+Route::group(['domain' => env('APP_HOST_WEB'), 'prefix' => 'index'],function (){
+    Route::match(['get','post'],'website', 'IndexController@getWebsite')->name('index.website');//获取网站基础信息
+
+
+});