<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Web\Controller; use Illuminate\Support\Facades\View; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use ModStart\Module\ModuleBaseController; use Module\Member\Auth\MemberUser; use Module\Member\Config\MemberOauth; use Module\Member\Support\MemberLoginCheck; use Module\Member\Util\MemberUtil; class MemberProfileController extends ModuleBaseController implements MemberLoginCheck { private $api; private $viewMemberFrame; public function __construct() { goto kzaTY; sETb7: $this->api = app(\Module\Member\Api\Controller\MemberProfileController::class); goto Fio2X; Im3Xd: View::share('_viewMemberFrame', $this->viewMemberFrame); goto sETb7; kzaTY: list($this->viewMemberFrame, $FViDa) = $this->viewPaths('member.frame'); goto Im3Xd; Fio2X: } public function password() { if (Request::isPost()) { return Response::jsonFromGenerate($this->api->password()); } return $this->view('memberProfile.password', array('pageTitle' => '密码设定')); } public function nickname() { if (Request::isPost()) { return Response::jsonFromGenerate($this->api->nickname()); } return $this->view('memberProfile.nickname', array('pageTitle' => '昵称修改')); } public function avatar() { if (Request::isPost()) { return Response::jsonFromGenerate($this->api->avatar()); } return $this->view('memberProfile.avatar', array('pageTitle' => '修改头像')); } public function captcha() { return $this->api->captchaRaw(); } public function bind() { return Response::redirect(modstart_web_url('member_profile/email')); } public function security() { return Response::redirect(modstart_web_url('member_profile/password')); } public function profile() { return Response::redirect(modstart_web_url('member_profile/avatar')); } public function oauth($g_4iP) { goto g6Prc; g6Prc: $pArCr = MemberOauth::getOrFail($g_4iP); goto JiMjU; LbNjL: $x043a = MemberUtil::getOauth(MemberUser::id(), $pArCr->oauthKey()); goto bQK_f; JiMjU: BizException::throwsIfEmpty('授权登录不存在', $pArCr); goto LbNjL; QUpw8: return $this->view('memberProfile.oauth', $v844n); goto MmrLH; bQK_f: $v844n = array('pageTitle' => $pArCr->title(), 'oauth' => $pArCr, 'oauthRecord' => $x043a); goto QUpw8; MmrLH: } public function email() { if (Request::isPost()) { return Response::jsonFromGenerate($this->api->email()); } return $this->view('memberProfile.email', array('pageTitle' => '邮箱绑定')); } public function emailVerify() { return Response::sendFromGenerate($this->api->emailVerify()); } public function phone() { if (Request::isPost()) { return Response::jsonFromGenerate($this->api->phone()); } return $this->view('memberProfile.phone', array('pageTitle' => '手机绑定')); } public function phoneVerify() { return Response::sendFromGenerate($this->api->phoneVerify()); } public function delete() { if (Request::isPost()) { return Response::jsonFromGenerate($this->api->delete()); } return $this->view('memberProfile.delete', array('pageTitle' => '注销账号')); } }