<?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 FJ4BC; FJ4BC: list($this->viewMemberFrame, $NMB1l) = $this->viewPaths('member.frame'); goto iMsop; iMsop: View::share('_viewMemberFrame', $this->viewMemberFrame); goto tTBgW; tTBgW: $this->api = app(\Module\Member\Api\Controller\MemberProfileController::class); goto HSaab; HSaab: } 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($HWA34) { goto dtJ82; IbwDJ: return $this->view('memberProfile.oauth', $i5RkB); goto KcLCB; dtJ82: $SRIGb = MemberOauth::getOrFail($HWA34); goto QkBKP; Iwok9: $i5RkB = array('pageTitle' => $SRIGb->title(), 'oauth' => $SRIGb, 'oauthRecord' => $AaFBy); goto IbwDJ; QkBKP: BizException::throwsIfEmpty('授权登录不存在', $SRIGb); goto xSQy1; xSQy1: $AaFBy = MemberUtil::getOauth(MemberUser::id(), $SRIGb->oauthKey()); goto Iwok9; KcLCB: } 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' => '注销账号')); } }