diff --git a/app/Controller/Admin/Login.php b/app/Controller/Admin/Login.php index bd43291..c52c3ec 100644 --- a/app/Controller/Admin/Login.php +++ b/app/Controller/Admin/Login.php @@ -21,32 +21,12 @@ use Hyperf\HttpServer\Annotation\PostMapping; use MathCaptcha\Captcha; use App\Request\Account as aRequest; use function Hyperf\Config\config; -use Hyperf\Swagger\Annotation as SA; #[Controller(prefix: "admin")] -#[SA\HyperfServer('admin')] class Login extends Base { #[GetMapping(path: "captcha")] #[Auth(needLogin: false)] - #[SA\Post(path: '/captcha', summary: '登录接口', tags: ['登录接口'])] - #[SA\RequestBody( - description: '请求参数', - content: [ - new SA\MediaType( - mediaType: 'application/json', - schema: new SA\Schema( - required: ['username', 'age'], - properties: [ - new SA\Property(property: 'username', description: '用户名字段描述', type: 'string'), - new SA\Property(property: 'age', description: '年龄字段描述', type: 'string'), - new SA\Property(property: 'city', description: '城市字段描述', type: 'string'), - ] - ), - ), - ], - )] - #[SA\Response(response: 200, description: '返回值的描述')] public function captcha() { // 获取uuid diff --git a/app/Controller/Admin/System.php b/app/Controller/Admin/System.php index 5f33ad6..a4522cd 100644 --- a/app/Controller/Admin/System.php +++ b/app/Controller/Admin/System.php @@ -34,32 +34,12 @@ use Hyperf\HttpServer\Annotation\DeleteMapping; use Hyperf\HttpServer\Annotation\GetMapping; use Hyperf\HttpServer\Annotation\PostMapping; use Hyperf\HttpServer\Annotation\PutMapping; -use Hyperf\Swagger\Annotation as SA; #[Controller(prefix: "admin")] -#[SA\HyperfServer('user')] class System extends Base { #[GetMapping(path: "menu/list")] #[Auth(needAuth: false, auth: "menu:list")] - #[SA\Post(path: '/menu/list', summary: '菜单接口', tags: ['菜单接口'])] - #[SA\RequestBody( - description: '请求参数', - content: [ - new SA\MediaType( - mediaType: 'application/json', - schema: new SA\Schema( - required: ['username', 'age'], - properties: [ - new SA\Property(property: 'username', description: '用户名字段描述', type: 'string'), - new SA\Property(property: 'age', description: '年龄字段描述', type: 'string'), - new SA\Property(property: 'city', description: '城市字段描述', type: 'string'), - ] - ), - ), - ], - )] - #[SA\Response(response: 200, description: '返回值的描述')] public function menuList() { return $this->success("菜单列表", mModel::getMenus(1)); @@ -421,8 +401,6 @@ class System extends Base #[Auth(needAuth: false)] public function crontabOption() { - var_dump(cModel::options()); - return $this->success("任务列表", cModel::options()); } diff --git a/app/Model/Account.php b/app/Model/Account.php index 1b74dbe..fa11872 100644 --- a/app/Model/Account.php +++ b/app/Model/Account.php @@ -76,12 +76,11 @@ class Account extends Model public static function getMenu(array $account) { // 总后台账号 - $field = ['m.title', 'm.path', 'm.pid', 'm.name', 'm.menu_id', 'm.icon', 'm.hidden']; + $field = ['m.title', 'm.path', 'm.pid', 'm.name', 'm.menu_id', 'm.icon', 'm.hidden', 'm.type']; // 获取角色 $roles = match ($account['account_type']) { - 1 => ["ADMIN"], - 2 => ["ORG"], - 3 => ["MERCHANT"], + 0 => ["ADMIN"], + 21 => ["ORG"], default => [] }; // 标识 diff --git a/app/Model/Menu.php b/app/Model/Menu.php index 46cd73d..34a1f7a 100644 --- a/app/Model/Menu.php +++ b/app/Model/Menu.php @@ -142,7 +142,7 @@ class Menu extends Model return (new self())->setTable('m') ->from("menu as m") ->where("m.account_type", $account_type) - ->where("m.type", 0) + ->whereIn("m.type", [0, 3]) ->orderByDesc("m.rank") ->select($field) ->get() @@ -177,7 +177,7 @@ class Menu extends Model ->leftJoin("menu as m", "m.menu_id", "=", "rm.menu_id") ->where("ar.account_id", $account_id) ->where("m.account_type", $account_type) - ->where("m.type", 0) + ->whereIn("m.type", [0, 3]) ->orderByDesc("m.rank") ->select($field) ->get() diff --git a/config/autoload/swagger.php b/config/autoload/swagger.php deleted file mode 100644 index 6841328..0000000 --- a/config/autoload/swagger.php +++ /dev/null @@ -1,45 +0,0 @@ - true, - 'port' => (int)env("SWAGGER_PORT", 9500), - 'json_dir' => BASE_PATH . '/static/swagger', - 'auto_generate' => true, - 'scan' => [ - 'paths' => [ - BASE_PATH . '/app/Controller/Admin' - ], - ], - 'server' => [ - 'admin' => [ - 'servers' => [ - [ - 'url' => env('DOMAIN') . '/admin', - 'description' => '后台接口', - ], - ], - 'info' => [ - 'title' => '里派基础接口', - 'description' => '管理端接口', - 'version' => '1.0.0', - ], - ], - 'user' => [ - 'servers' => [ - [ - 'url' => env('DOMAIN') . '/user', - 'description' => '用户接口', - ], - ], - 'info' => [ - 'title' => '里派基础接口', - 'description' => '用户端接口', - 'version' => '1.0.0', - ], - ], - ], -];