['except' => ['login'] ], ]; use ResponseJson; public function index() { return '

:)

ThinkPHP V' . \think\facade\App::version() . '
16载初心不改 - 你值得信赖的PHP框架

[ V6.0 版本由 亿速云 独家赞助发布 ]
'; } public function hello($name = 'ThinkPHP6') { return 'hello,' . $name; } /** * @throws ModelNotFoundException * @throws DataNotFoundException * @throws DbException * @Route("login") * @Middleware({}) */ public function login():Json{ $loginInfo = $this->request->get(); $userInfo=RyService::selectLoginInfo($loginInfo); if ($userInfo){ $token = JWTAuth::builder(['qydm' => $userInfo["qydm"]]);//参数为用户认证的信息,请自行添加 return $this->JsonSucess(["token"=>$token,"userInfo"=>$userInfo],1001); }else{ return $this->JsonError(1002); } } /** * @throws ModelNotFoundException * @throws DataNotFoundException * @throws DbException * @Route("/getQyBasicList") * @Middleware({"jwt"}) */ public function getQyBasicList(): Json { getQydm(); return $this->JsonSucess(QyBasicService::selectQyBasic()); } /** * @throws ModelNotFoundException * @throws DataNotFoundException * @throws DbException * @Route("getNszyByQydm") * @Middleware({"jwt"}) */ public function getNszyByQydm():Json{ return $this->JsonSucess(NszyService::selectNszyByQydm(getQydm())); } }