<?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 Z39F_; Z39F_: list($this->viewMemberFrame, $plloB) = $this->viewPaths('member.frame'); goto H7ic_; H7ic_: View::share('_viewMemberFrame', $this->viewMemberFrame); goto VhpOI; VhpOI: $this->api = app(\Module\Member\Api\Controller\MemberProfileController::class); goto FPCEd; FPCEd: } 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($EpKdG) { goto eZuUW; RlA9G: $sr5M7 = array('pageTitle' => $J2o_m->title(), 'oauth' => $J2o_m, 'oauthRecord' => $hpFhm); goto fOkZF; ZHogH: $hpFhm = MemberUtil::getOauth(MemberUser::id(), $J2o_m->oauthKey()); goto RlA9G; fOkZF: return $this->view('memberProfile.oauth', $sr5M7); goto R53VR; eZuUW: $J2o_m = MemberOauth::getOrFail($EpKdG); goto SvUWu; SvUWu: BizException::throwsIfEmpty('授权登录不存在', $J2o_m); goto ZHogH; R53VR: } 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' => '注销账号')); } }