emailService = $emailService; $this->companyService = $companyService; $this->memberInfoService = $memberInfoService; $this->authService = $authService; $this->taskService = $taskService; $this->organizationService = $organizationService; } public function checkEmail($token, $tag = 'none') { $message = $this->emailService->checkAuthEmail($token); if (is_null($message)) { // return "地址已失效";//token不对 return $this->showMessage("地址已失效", route('home'), true, "首页"); } //token验证是对的 if ($message['alias']==EmailService::TEMPLATE_VALIDATION) { //验证邮箱逻辑 if ($tag == 'company') { if ($this->companyService->verifyEmail($message['email'])) { $this->taskService->doTask(23); return $this->showMessage("邮箱认证成功!", route('home'), false, "首页"); } } if ($tag == 'organization') { if ($this->organizationService->verifyEmail($message['email'])) { //$this->taskService->doTask(23); return $this->showMessage("邮箱认证成功!", route('home'), false, "首页"); } } if ($tag == 'personal') { if ($this->memberInfoService->verifyEmail($message['email'])) { return $this->showMessage("邮箱认证成功!", route('home'), false, "首页"); } } } if ($message['alias']==EmailService::TEMPLATE_PASSWORD_RESET) { //重置密码逻辑 $token=$this->authService->getTokenByEmail($message['email']); return view('app.auth.password_reset', ['token'=>$token]); } return $this->showMessage("地址已失效", route('home'), true, "首页"); } }