Merge branch 'dev' of http://47.244.231.31:8099/zhl/globalso-v6 into dev
正在显示
11 个修改的文件
包含
178 行增加
和
74 行删除
| @@ -5,12 +5,10 @@ namespace App\Exceptions; | @@ -5,12 +5,10 @@ namespace App\Exceptions; | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Enums\Common\Common; | 6 | use App\Enums\Common\Common; |
| 7 | use App\Services\DingService; | 7 | use App\Services\DingService; |
| 8 | -use App\Traits\RedisTrait; | ||
| 9 | use App\Utils\EncryptUtils; | 8 | use App\Utils\EncryptUtils; |
| 10 | use App\Utils\LogUtils; | 9 | use App\Utils\LogUtils; |
| 11 | use Illuminate\Database\Eloquent\ModelNotFoundException; | 10 | use Illuminate\Database\Eloquent\ModelNotFoundException; |
| 12 | use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | 11 | use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
| 13 | -use Illuminate\Support\Arr; | ||
| 14 | use Illuminate\Support\Facades\Route; | 12 | use Illuminate\Support\Facades\Route; |
| 15 | use Illuminate\Validation\ValidationException; | 13 | use Illuminate\Validation\ValidationException; |
| 16 | use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; | 14 | use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; |
| @@ -60,5 +58,86 @@ class Handler extends ExceptionHandler | @@ -60,5 +58,86 @@ class Handler extends ExceptionHandler | ||
| 60 | */ | 58 | */ |
| 61 | public function report(Throwable $exception) | 59 | public function report(Throwable $exception) |
| 62 | { | 60 | { |
| 61 | + | ||
| 62 | + //日志记录 | ||
| 63 | + $exceptionMessage = "错误CODE:" . $exception->getCode() . | ||
| 64 | + "-----错误message:" . $exception->getMessage() . | ||
| 65 | + '------错误文件:' . $exception->getFile() . | ||
| 66 | + '-------错误行数:' . $exception->getLine(); | ||
| 67 | + //A端错误 | ||
| 68 | + if ($exception instanceof AsideGlobalException) { | ||
| 69 | + LogUtils::error("AsideGlobalException", [], $exceptionMessage); | ||
| 70 | + } | ||
| 71 | + //B端错误 | ||
| 72 | + elseif($exception instanceof BsideGlobalException) { | ||
| 73 | + LogUtils::error("BsideGlobalException", [], $exceptionMessage); | ||
| 74 | + } | ||
| 75 | + //验证错误(非手动抛出) | ||
| 76 | + elseif ($exception instanceof ValidationException) { | ||
| 77 | + LogUtils::error("参数验证失败", [], $exceptionMessage); | ||
| 78 | + } | ||
| 79 | + //Redis错误(非手动抛出) | ||
| 80 | + elseif ($exception instanceof \RedisException) { | ||
| 81 | + LogUtils::error("Redis服务异常", [], $exceptionMessage); | ||
| 82 | + } | ||
| 83 | + //Mysql错误(非手动抛出) | ||
| 84 | + elseif ($exception instanceof \PDOException) { | ||
| 85 | + LogUtils::error("数据库服务异常", [], $exceptionMessage); | ||
| 86 | + } | ||
| 87 | + //模型未找到错误(非手动抛出) | ||
| 88 | + elseif ($exception instanceof ModelNotFoundException) { | ||
| 89 | + LogUtils::error("模型资源未找到", [], $exceptionMessage); | ||
| 90 | + } | ||
| 91 | + //其他 | ||
| 92 | + else { | ||
| 93 | + LogUtils::error("全局系统异常", [], $exceptionMessage); | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + /** | ||
| 97 | + * Render an exception into an HTTP response. | ||
| 98 | + * | ||
| 99 | + * @param \Illuminate\Http\Request $request | ||
| 100 | + * @param \Throwable $exception | ||
| 101 | + * @return \Symfony\Component\HttpFoundation\Response | ||
| 102 | + * | ||
| 103 | + * @throws \Throwable | ||
| 104 | + */ | ||
| 105 | + public function render($request, Throwable $exception) | ||
| 106 | + { | ||
| 107 | + $message = $exception->getMessage(); | ||
| 108 | + | ||
| 109 | + if ($exception instanceof AsideGlobalException) { | ||
| 110 | + $code = $exception->getCode(); | ||
| 111 | + }elseif ($exception instanceof BsideGlobalException) { | ||
| 112 | + $code = $exception->getCode(); | ||
| 113 | + } elseif ($exception instanceof NotFoundHttpException || $exception instanceof MethodNotAllowedHttpException) { | ||
| 114 | + return response('404 Not Found', 404); | ||
| 115 | + } else { | ||
| 116 | + $code = Code::SYSTEM_ERROR(); | ||
| 117 | + } | ||
| 118 | + //钉钉通知错误信息 | ||
| 119 | + if (in_array(config('app.env'), ['test', 'production']) && (in_array(substr($code, 0, 1), ['B', 'C']))) { | ||
| 120 | + $exceptionMessage = "路由:" . Route::current()->uri . | ||
| 121 | + "-----错误CODE:" . $exception->getCode() . | ||
| 122 | + "-----错误message:" . $exception->getMessage() . | ||
| 123 | + '------错误文件:' . $exception->getFile() . '-------错误行数:' . | ||
| 124 | + $exception->getLine(); | ||
| 125 | + (new DingService())->handle(['keyword' => "ERROR", 'msg' => config('app.env') . '环境报错:' . $exceptionMessage, 'isAtAll' => false]); | ||
| 126 | + } | ||
| 127 | + //开启debug 错误原样输出 | ||
| 128 | + $debub = config('app.debug'); | ||
| 129 | + $message = $debub ? $message : ($code->description ?? $message); | ||
| 130 | + $response = [ | ||
| 131 | + 'code' => $code, | ||
| 132 | + 'message' => $message | ||
| 133 | + ]; | ||
| 134 | + //加密返回 | ||
| 135 | + if (config('app.params_encrypt')) { | ||
| 136 | + $k = config('app.params_encrypt_key'); | ||
| 137 | + $i = config('app.params_encrypt_iv'); | ||
| 138 | + $response = [ | ||
| 139 | + 'p' => (new EncryptUtils())->openssl_en($response, $k, $i)]; | ||
| 140 | + } | ||
| 141 | + return response($response); | ||
| 63 | } | 142 | } |
| 64 | } | 143 | } |
| @@ -31,24 +31,12 @@ class BaseController extends Controller | @@ -31,24 +31,12 @@ class BaseController extends Controller | ||
| 31 | $this->request = $request; | 31 | $this->request = $request; |
| 32 | $this->param = $this->request->all(); | 32 | $this->param = $this->request->all(); |
| 33 | $this->token = $this->request->header('token'); | 33 | $this->token = $this->request->header('token'); |
| 34 | - $this->get_param(); | ||
| 35 | - $this->auth_token(); | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * @name | ||
| 40 | - * @return void | ||
| 41 | - * @author :liyuhang | ||
| 42 | - * @method | ||
| 43 | - */ | ||
| 44 | - public function auth_token(){ | ||
| 45 | - $this->token = '810f28c1d80d0ccf27509816bf44b329'; | ||
| 46 | - $info = Cache::get($this->token); | ||
| 47 | - if(!empty($info)){ | 34 | + if(!empty($this->token) && !empty(Cache::get($this->token))){ |
| 35 | + $info = Cache::get($this->token); | ||
| 48 | $this->user = $info; | 36 | $this->user = $info; |
| 49 | $this->uid = $info['id']; | 37 | $this->uid = $info['id']; |
| 50 | } | 38 | } |
| 51 | - | 39 | + $this->get_param(); |
| 52 | } | 40 | } |
| 53 | /** | 41 | /** |
| 54 | * 成功返回 | 42 | * 成功返回 |
| @@ -133,7 +121,23 @@ class BaseController extends Controller | @@ -133,7 +121,23 @@ class BaseController extends Controller | ||
| 133 | } | 121 | } |
| 134 | 122 | ||
| 135 | 123 | ||
| 136 | - | 124 | + /** |
| 125 | + * 菜单权限->得到子级数组 | ||
| 126 | + * @param int | ||
| 127 | + * @return array | ||
| 128 | + */ | ||
| 129 | + public function _get_child($my_id, $arr) | ||
| 130 | + { | ||
| 131 | + $new_arr = array(); | ||
| 132 | + foreach ($arr as $k => $v) { | ||
| 133 | + $v = (array)$v; | ||
| 134 | + if ($v['pid'] == $my_id) { | ||
| 135 | + $v['sub'] = $this->_get_child($v['id'],$arr); | ||
| 136 | + $new_arr[] = $v; | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + return $new_arr ? $new_arr : false; | ||
| 140 | + } | ||
| 137 | 141 | ||
| 138 | /** | 142 | /** |
| 139 | * @name :上传图片 | 143 | * @name :上传图片 |
| @@ -60,7 +60,7 @@ class ComController extends BaseController | @@ -60,7 +60,7 @@ class ComController extends BaseController | ||
| 60 | $info = $projectRoleModel->read(['id'=>$this->user['role_id']]); | 60 | $info = $projectRoleModel->read(['id'=>$this->user['role_id']]); |
| 61 | $projectMenuModel = new ProjectMenuModel(); | 61 | $projectMenuModel = new ProjectMenuModel(); |
| 62 | $info['role_menu'] = trim($info['role_menu'],','); | 62 | $info['role_menu'] = trim($info['role_menu'],','); |
| 63 | - $lists = $this->where(['status'=>0,'is_role'=>0])->whereIn('id',explode(',',$info['role_menu']))->get(); | 63 | + $lists = $projectMenuModel->where(['status'=>0,'is_role'=>0])->whereIn('id',explode(',',$info['role_menu']))->get(); |
| 64 | $lists = $lists->toArray(); | 64 | $lists = $lists->toArray(); |
| 65 | $menu = array(); | 65 | $menu = array(); |
| 66 | foreach ($lists as $k => $v){ | 66 | foreach ($lists as $k => $v){ |
| @@ -74,24 +74,6 @@ class ComController extends BaseController | @@ -74,24 +74,6 @@ class ComController extends BaseController | ||
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | /** | 76 | /** |
| 77 | - * 菜单权限->得到子级数组 | ||
| 78 | - * @param int | ||
| 79 | - * @return array | ||
| 80 | - */ | ||
| 81 | - public function _get_child($my_id, $arr) | ||
| 82 | - { | ||
| 83 | - $new_arr = array(); | ||
| 84 | - foreach ($arr as $k => $v) { | ||
| 85 | - $v = (array)$v; | ||
| 86 | - if ($v['pid'] == $my_id) { | ||
| 87 | - $v['sub'] = $this->_get_child($v['id'],$arr); | ||
| 88 | - $new_arr[] = $v; | ||
| 89 | - | ||
| 90 | - } | ||
| 91 | - } | ||
| 92 | - return $new_arr ? $new_arr : false; | ||
| 93 | - } | ||
| 94 | - /** | ||
| 95 | * @name :获取当前项目详情 | 77 | * @name :获取当前项目详情 |
| 96 | * @return void | 78 | * @return void |
| 97 | * @author :liyuhang | 79 | * @author :liyuhang |
| @@ -114,17 +96,11 @@ class ComController extends BaseController | @@ -114,17 +96,11 @@ class ComController extends BaseController | ||
| 114 | */ | 96 | */ |
| 115 | public function edit_info(){ | 97 | public function edit_info(){ |
| 116 | $rules = [ | 98 | $rules = [ |
| 117 | - 'id'=>'required', | ||
| 118 | - 'mobile'=>'required|string|max:11', | ||
| 119 | 'password'=>'required|string|min:5', | 99 | 'password'=>'required|string|min:5', |
| 120 | 'name'=>'required|max:20', | 100 | 'name'=>'required|max:20', |
| 121 | ]; | 101 | ]; |
| 122 | //验证的提示信息 | 102 | //验证的提示信息 |
| 123 | $message = [ | 103 | $message = [ |
| 124 | - 'id.required'=>'主键不能为空', | ||
| 125 | - 'mobile.required'=>'号码必须填写', | ||
| 126 | - 'mobile.string'=>'号码中含有非法文字', | ||
| 127 | - 'mobile.max' => '号码不大于11字符.', | ||
| 128 | 'password.required'=>'密码必须填写', | 104 | 'password.required'=>'密码必须填写', |
| 129 | 'password.string'=>'密码中含有非法文字', | 105 | 'password.string'=>'密码中含有非法文字', |
| 130 | 'password.min' => '密码不小于5字符.', | 106 | 'password.min' => '密码不小于5字符.', |
| @@ -135,8 +111,13 @@ class ComController extends BaseController | @@ -135,8 +111,13 @@ class ComController extends BaseController | ||
| 135 | if($validate->fails()){ | 111 | if($validate->fails()){ |
| 136 | return $this->response($validate->errors()->first(),Code::USER_PARAMS_ERROE,$this->param); | 112 | return $this->response($validate->errors()->first(),Code::USER_PARAMS_ERROE,$this->param); |
| 137 | } | 113 | } |
| 138 | - $user = new UserModel(); | ||
| 139 | - | 114 | + $userModel = new UserModel(); |
| 115 | + $this->param['id'] = $this->uid; | ||
| 116 | + $rs = $userModel->edits($this->param); | ||
| 117 | + if($rs === false){ | ||
| 118 | + $this->response('参数错误或其他服务器原因,编辑失败',Code::USER_ERROR); | ||
| 119 | + } | ||
| 120 | + $this->response('编辑成功'); | ||
| 140 | } | 121 | } |
| 141 | 122 | ||
| 142 | /** | 123 | /** |
| @@ -146,6 +127,10 @@ class ComController extends BaseController | @@ -146,6 +127,10 @@ class ComController extends BaseController | ||
| 146 | * @method :post | 127 | * @method :post |
| 147 | */ | 128 | */ |
| 148 | public function logout(){ | 129 | public function logout(){ |
| 149 | - | 130 | + $rs = Cache::pull($this->token); |
| 131 | + if($rs === false){ | ||
| 132 | + $this->response('error',Code::USER_ERROR); | ||
| 133 | + } | ||
| 134 | + $this->response('success'); | ||
| 150 | } | 135 | } |
| 151 | } | 136 | } |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Controllers\Bside; | 3 | namespace App\Http\Controllers\Bside; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | +use App\Models\ProjectMenu as ProjectMenuModel; | ||
| 6 | use App\Models\ProjectRole as ProjectRoleModel; | 7 | use App\Models\ProjectRole as ProjectRoleModel; |
| 7 | use App\Models\User as UserModel; | 8 | use App\Models\User as UserModel; |
| 8 | use Illuminate\Support\Facades\Validator; | 9 | use Illuminate\Support\Facades\Validator; |
| @@ -25,6 +26,31 @@ class ProjectRoleController extends BaseController | @@ -25,6 +26,31 @@ class ProjectRoleController extends BaseController | ||
| 25 | $this->allCount = $projectRoleModel->allCount; | 26 | $this->allCount = $projectRoleModel->allCount; |
| 26 | $this->result($lists); | 27 | $this->result($lists); |
| 27 | } | 28 | } |
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * @name :添加/编辑角色时获取菜单列表 | ||
| 32 | + * @return void | ||
| 33 | + * @author :liyuhang | ||
| 34 | + * @method | ||
| 35 | + */ | ||
| 36 | + public function get_role_menu(){ | ||
| 37 | + //根据当前登录用户角色返回用户菜单列表 | ||
| 38 | + $projectRoleModel = new ProjectRoleModel(); | ||
| 39 | + $info = $projectRoleModel->read(['id'=>$this->user['role_id']]); | ||
| 40 | + $projectMenuModel = new ProjectMenuModel(); | ||
| 41 | + $info['role_menu'] = trim($info['role_menu'],','); | ||
| 42 | + $lists = $projectMenuModel->where(['status'=>0])->whereIn('id',explode(',',$info['role_menu']))->get(); | ||
| 43 | + $lists = $lists->toArray(); | ||
| 44 | + $menu = array(); | ||
| 45 | + foreach ($lists as $k => $v){ | ||
| 46 | + $v = (array)$v; | ||
| 47 | + if ($v['pid'] == 0) { | ||
| 48 | + $v['sub'] = $this->_get_child($v['id'], $lists); | ||
| 49 | + $menu[] = $v; | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + $this->response('当前用户菜单列表',Code::SUCCESS,$menu); | ||
| 53 | + } | ||
| 28 | /** | 54 | /** |
| 29 | * @name :添加角色 | 55 | * @name :添加角色 |
| 30 | * @return void | 56 | * @return void |
| @@ -60,7 +86,7 @@ class ProjectRoleController extends BaseController | @@ -60,7 +86,7 @@ class ProjectRoleController extends BaseController | ||
| 60 | if($rs === false){ | 86 | if($rs === false){ |
| 61 | $this->response('添加失败',Code::USER_PARAMS_ERROE); | 87 | $this->response('添加失败',Code::USER_PARAMS_ERROE); |
| 62 | } | 88 | } |
| 63 | - $this->response('添加成功',Code::SUCCESS); | 89 | + $this->response('添加成功'); |
| 64 | } | 90 | } |
| 65 | 91 | ||
| 66 | /** | 92 | /** |
| @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bside; | @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bside; | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Http\Logic\Bside\UserLogic; | 6 | use App\Http\Logic\Bside\UserLogic; |
| 7 | use App\Models\User as UserModel; | 7 | use App\Models\User as UserModel; |
| 8 | +use Illuminate\Support\Facades\Cache; | ||
| 8 | use Illuminate\Support\Facades\Response; | 9 | use Illuminate\Support\Facades\Response; |
| 9 | use Illuminate\Support\Facades\Validator; | 10 | use Illuminate\Support\Facades\Validator; |
| 10 | use Symfony\Component\HttpFoundation; | 11 | use Symfony\Component\HttpFoundation; |
| @@ -25,8 +26,7 @@ class UserController extends BaseController | @@ -25,8 +26,7 @@ class UserController extends BaseController | ||
| 25 | if(empty($lists)){ | 26 | if(empty($lists)){ |
| 26 | $this->response('请求失败',Code::USER_ERROR,[]); | 27 | $this->response('请求失败',Code::USER_ERROR,[]); |
| 27 | } | 28 | } |
| 28 | - $this->allCount = $userModel->allCount; | ||
| 29 | - $this->result($lists); | 29 | + $this->response('列表',Code::SUCCESS,$lists); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
app/Http/Logic/Bside/UserLogic.php
0 → 100644
| @@ -22,14 +22,16 @@ class LoginAuthMiddleware | @@ -22,14 +22,16 @@ class LoginAuthMiddleware | ||
| 22 | public function handle(Request $request, Closure $next) | 22 | public function handle(Request $request, Closure $next) |
| 23 | { | 23 | { |
| 24 | $token = $request->header('token'); | 24 | $token = $request->header('token'); |
| 25 | - var_dump(Cache::get($token)); | ||
| 26 | - die(); | ||
| 27 | if(!isset($token) || empty($token)){ | 25 | if(!isset($token) || empty($token)){ |
| 28 | - $this->response('当前用户未登录',Code::USER_ERROR); | 26 | + $res = [ |
| 27 | + 'code'=>'A00010', | ||
| 28 | + 'msg' =>'当前用户未登录' | ||
| 29 | + ]; | ||
| 30 | + return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']); | ||
| 29 | } | 31 | } |
| 30 | $info = Cache::get($token); | 32 | $info = Cache::get($token); |
| 31 | if(empty($info)){ | 33 | if(empty($info)){ |
| 32 | - $this->response('当前用户未登录',Code::USER_ERROR); | 34 | + return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']); |
| 33 | } | 35 | } |
| 34 | //操作权限设置 | 36 | //操作权限设置 |
| 35 | $projectRoleModel = new ProjectRoleModel(); | 37 | $projectRoleModel = new ProjectRoleModel(); |
| @@ -39,27 +41,12 @@ class LoginAuthMiddleware | @@ -39,27 +41,12 @@ class LoginAuthMiddleware | ||
| 39 | //查询当前用户是否拥有权限操作 | 41 | //查询当前用户是否拥有权限操作 |
| 40 | $projectMenuModel = new ProjectMenu(); | 42 | $projectMenuModel = new ProjectMenu(); |
| 41 | $menu_id = $projectMenuModel->read(['action'=>$action['as']],['id']); | 43 | $menu_id = $projectMenuModel->read(['action'=>$action['as']],['id']); |
| 42 | - if(strpos($role_info['role_menu'], $menu_id['id']) < 0){ | ||
| 43 | - $this->response('当前用户没有权限',Code::USER_ERROR); | 44 | + if($menu_id !== false){ |
| 45 | + if(strpos($role_info['role_menu'], $menu_id['id']) < 0){ | ||
| 46 | + return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户没有权限']); | ||
| 47 | + } | ||
| 44 | } | 48 | } |
| 45 | return $next($request); | 49 | return $next($request); |
| 46 | } | 50 | } |
| 47 | - /** | ||
| 48 | - * @name 统一返回参数 | ||
| 49 | - * @return void | ||
| 50 | - * @author :liyuhang | ||
| 51 | - * @method | ||
| 52 | - */ | ||
| 53 | - public function response($msg,$code,$data = [],$result_code = 200,$type = 'application/json'){ | ||
| 54 | - $code === null && $code = $result_code; | ||
| 55 | - $result = [ | ||
| 56 | - 'msg' =>$msg, | ||
| 57 | - 'code'=>$code, | ||
| 58 | - 'data'=>$data | ||
| 59 | - ]; | ||
| 60 | - $header['token'] = $type; | ||
| 61 | - $response = response($result,$result_code,$header); | ||
| 62 | - throw new HttpResponseException($response); | ||
| 63 | - } | ||
| 64 | 51 | ||
| 65 | } | 52 | } |
| @@ -37,7 +37,7 @@ class Base extends Model | @@ -37,7 +37,7 @@ class Base extends Model | ||
| 37 | */ | 37 | */ |
| 38 | public function lists($map, $p, $row, $order = 'id', $fields = ['*']){ | 38 | public function lists($map, $p, $row, $order = 'id', $fields = ['*']){ |
| 39 | //TODO::where(['id'=>'','name'=>'']) | 39 | //TODO::where(['id'=>'','name'=>'']) |
| 40 | - $lists = $this->select($fields)->where($map)->forPage($p,$row)->orderBy($order)->get(); | 40 | + $lists = DB::table($this->table)->select($fields)->where($map)->orderBy($order)->paginate($row, ['*'], 'page', $p); |
| 41 | if (empty($lists)) { | 41 | if (empty($lists)) { |
| 42 | return false; | 42 | return false; |
| 43 | } | 43 | } |
| @@ -83,6 +83,7 @@ class User extends Base | @@ -83,6 +83,7 @@ class User extends Base | ||
| 83 | //生成新token | 83 | //生成新token |
| 84 | $token = md5(uniqid().$info['id']); | 84 | $token = md5(uniqid().$info['id']); |
| 85 | //存储缓存 | 85 | //存储缓存 |
| 86 | + $info['token'] = $token; | ||
| 86 | Cache::add($token,$info); | 87 | Cache::add($token,$info); |
| 87 | $rs = $this->edit(['token'=>$token],['id'=>$info['id']]); | 88 | $rs = $this->edit(['token'=>$token],['id'=>$info['id']]); |
| 88 | if($rs === false){ | 89 | if($rs === false){ |
| @@ -6,7 +6,12 @@ use \Illuminate\Support\Facades\Route; | @@ -6,7 +6,12 @@ use \Illuminate\Support\Facades\Route; | ||
| 6 | 6 | ||
| 7 | //必须登录验证的路由组 | 7 | //必须登录验证的路由组 |
| 8 | Route::middleware(['bloginauth'])->group(function () { | 8 | Route::middleware(['bloginauth'])->group(function () { |
| 9 | + //登录用户编辑个人资料 | ||
| 10 | + Route::any('/edit_info', [\App\Http\Controllers\Bside\ComController::class, 'edit_info'])->name('edit_info'); | ||
| 11 | + Route::any('/logout', [\App\Http\Controllers\Bside\ComController::class, 'logout'])->name('logout'); | ||
| 12 | + //获取当前登录用户菜单 | ||
| 9 | Route::any('/get_menu', [\App\Http\Controllers\Bside\ComController::class, 'get_menu'])->name('get_menu'); | 13 | Route::any('/get_menu', [\App\Http\Controllers\Bside\ComController::class, 'get_menu'])->name('get_menu'); |
| 14 | + //获取当前登录用户项目详情 | ||
| 10 | Route::any('/get_project', [\App\Http\Controllers\Bside\ComController::class, 'get_project'])->name('get_project'); | 15 | Route::any('/get_project', [\App\Http\Controllers\Bside\ComController::class, 'get_project'])->name('get_project'); |
| 11 | //用户相关路由 | 16 | //用户相关路由 |
| 12 | Route::any('/user/add', [\App\Http\Controllers\Bside\UserController::class, 'add'])->name('user_add'); | 17 | Route::any('/user/add', [\App\Http\Controllers\Bside\UserController::class, 'add'])->name('user_add'); |
| @@ -16,6 +21,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -16,6 +21,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 16 | Route::any('/user/del', [\App\Http\Controllers\Bside\UserController::class, 'del'])->name('user_del'); | 21 | Route::any('/user/del', [\App\Http\Controllers\Bside\UserController::class, 'del'])->name('user_del'); |
| 17 | //用户角色相关路由 | 22 | //用户角色相关路由 |
| 18 | Route::any('/project_role/lists', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'lists'])->name('project_role_lists'); | 23 | Route::any('/project_role/lists', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'lists'])->name('project_role_lists'); |
| 24 | + Route::any('/project_role/get_role_menu', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'get_role_menu'])->name('project_get_role_add'); | ||
| 19 | Route::any('/project_role/add', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'add'])->name('project_role_add'); | 25 | Route::any('/project_role/add', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'add'])->name('project_role_add'); |
| 20 | Route::any('/project_role/edit', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'edit'])->name('project_role_edit'); | 26 | Route::any('/project_role/edit', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'edit'])->name('project_role_edit'); |
| 21 | Route::any('/project_role/status', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'status'])->name('project_role_status'); | 27 | Route::any('/project_role/status', [\App\Http\Controllers\Bside\ProjectRoleController::class, 'status'])->name('project_role_status'); |
-
请 注册 或 登录 后发表评论