💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ /** * 设置昵称 * @param Request $request * @return \think\response\Json */ public function setNickname(Request $request){ $data = $request->param(); $validate = app(NickNameValidate::class); $check = $validate->check($data); if($check != true){ return Response::fail($validate->getError()); } $result = app(UserService::class)->setNickname($data); if($result){ $userInfo = app(UserService::class)->findUserById($data['userId']); return Response::success($userInfo); }else{ return Response::fail('设置昵称失败'); } } ~~~