diff --git a/app/controller/admin/ApiController.php b/app/controller/admin/ApiController.php new file mode 100644 index 0000000..4016184 --- /dev/null +++ b/app/controller/admin/ApiController.php @@ -0,0 +1,13 @@ +syncResource()); + } +} \ No newline at end of file diff --git a/app/controller/AiCommandController.php b/app/controller/user/AiCommandController.php similarity index 96% rename from app/controller/AiCommandController.php rename to app/controller/user/AiCommandController.php index 30e2d51..edb9c64 100644 --- a/app/controller/AiCommandController.php +++ b/app/controller/user/AiCommandController.php @@ -1,7 +1,7 @@ setParams(['perm' => ['meijiequanSyncResource']]); + }); + +})->middleware([ + AdminAuthorizationMiddleware::class, +// PermissionsMiddleware::class +]); \ No newline at end of file diff --git a/app/route/proxy.php b/app/route/proxy.php new file mode 100644 index 0000000..4829e7a --- /dev/null +++ b/app/route/proxy.php @@ -0,0 +1,14 @@ +middleware([ + ProxyUserAuthorizationMiddleware::class +]); \ No newline at end of file diff --git a/app/route/route.php b/app/route/route.php index 46121d5..12fdf32 100644 --- a/app/route/route.php +++ b/app/route/route.php @@ -1,20 +1,23 @@ "35075", + "model_id"=>"1", + "limit"=>"300", + "page"=>"1" + ); + //加密 + $app_key = "de06270f3515bad109aa1fd2c023dd41"; + $data_info = serialize($data ); + $time_out = 60; + $iv = random_bytes(16); + $info['iv'] = base64_encode($iv); + $info['value'] = openssl_encrypt($data_info, 'AES-256-CBC', $app_key, 0, + base64_decode($info['iv'])); + $encrypt = base64_encode(json_encode($info)); + $sign = md5($encrypt); + $result = ['response' => $encrypt, 'sign' => $sign, 'app_key' => $app_key]; + //curl + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); + curl_setopt($ch, CURLOPT_TIMEOUT, $time_out); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $result); + $output = curl_exec($ch); + curl_close($ch); + return $output; + } +} \ No newline at end of file diff --git a/app/service/AiCommandService.php b/app/service/user/AiCommandService.php similarity index 98% rename from app/service/AiCommandService.php rename to app/service/user/AiCommandService.php index 65ffb2b..6fbb3a1 100644 --- a/app/service/AiCommandService.php +++ b/app/service/user/AiCommandService.php @@ -1,8 +1,8 @@ =8.1", "ext-simplexml": "*", "ext-dom": "*", - "ext-curl": "*" + "ext-curl": "*", + "ext-openssl": "*" }, "platform-dev": {}, "plugin-api-version": "2.6.0" diff --git a/config/route.php b/config/route.php index 6fb573a..8bd9d4a 100644 --- a/config/route.php +++ b/config/route.php @@ -16,6 +16,8 @@ use Webman\Route; // 引入业务 require_once base_path() . '/app/route/route.php'; +require_once base_path() . '/app/route/admin.php'; +require_once base_path() . '/app/route/proxy.php'; // 处理404路由 Route::fallback(function(){ diff --git a/plugin/piadmin/app/model/SystemDept.php b/plugin/piadmin/app/model/SystemDept.php index 89ff78a..30a876c 100644 --- a/plugin/piadmin/app/model/SystemDept.php +++ b/plugin/piadmin/app/model/SystemDept.php @@ -2,7 +2,6 @@ namespace plugin\piadmin\app\model; -use app\model\DistillationWord; use plugin\piadmin\app\base\BaseModel; use think\model\concern\SoftDelete;