config = WeChatServer::getOaConfig(); // $this->app = Factory::officialAccount($this->config); // $this->app->template_message->sendSubscription([ // 'touser' => 'user-openid', // 'template_id' => 'template-id', // 'url' => 'https://easywechat.com', // 'scene' => 1000, // 'data' => [ // 'key1' => 'VALUE', // 'key2' => 'VALUE2', // ... // ], // ]); // dump($this->config); // dump($this->app); // die; if ($this->request->isAjax()) { $post = request()->post(); (new LoginValidate())->goCheck(); if (LoginLogic::login($post)){ return JsonServer::success('登录成功'); } $error = LoginLogic::getError() ?: '登录失败'; return JsonServer::error($error); } return view('', [ 'account' => cookie('account'), 'config' => LoginLogic::config(), ]); } /** * Notes: 退出登录 * @author FZR(2021/1/28 18:44) */ public function logout() { LoginLogic::logout(); $this->redirect(url('login/login')); } }