<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Oauth; use ModStart\Core\Input\Response; use Module\Member\Util\MemberUtil; abstract class AbstractOauth { public function hasRender() { return true; } public function isSupport() { return true; } public function color() { return null; } public function title() { return $this->name(); } public function oauthKey() { return $this->name(); } public abstract function name(); public abstract function render(); public function bindRender() { return null; } public abstract function processRedirect($uxJUJ); public abstract function processLogin($uxJUJ); public function processTryLogin($uxJUJ) { goto AJbG5; uz7Qn: return Response::generateSuccessData(array('memberUserId' => 0)); goto kmYZx; cAcI0: $BvdrQ = $M3MKX['openid']; goto IFQNv; IFQNv: $nlOSA = MemberUtil::getIdByOauthAndCheck($this->name(), $BvdrQ); goto k1M4N; k1M4N: if ($nlOSA) { return Response::generateSuccessData(array('memberUserId' => $nlOSA)); } goto uz7Qn; AJbG5: $M3MKX = $uxJUJ['userInfo']; goto cAcI0; kmYZx: } public function processBindToUser($uxJUJ) { goto BJ2Qp; BJ2Qp: $nlOSA = $uxJUJ['memberUserId']; goto TYnIG; mny8n: $bOB_A = array(); goto rcnnU; rcnnU: if (!empty($M3MKX['username'])) { $bOB_A['infoUsername'] = $M3MKX['username']; } goto ExyG3; ExyG3: if (!empty($M3MKX['avatar'])) { $bOB_A['infoAvatar'] = $M3MKX['avatar']; } goto VTkFb; s_35R: $StE5h = MemberUtil::getIdByOauthAndCheck($this->name(), $M3MKX['openid']); goto YCVH1; YCVH1: if ($StE5h && $nlOSA != $StE5h) { MemberUtil::forgetOauth($this->name(), $M3MKX['openid']); } goto mny8n; yNd6R: return Response::generateSuccess(); goto eUFli; VTkFb: MemberUtil::putOauth($nlOSA, $this->name(), $M3MKX['openid'], $bOB_A); goto yNd6R; TYnIG: $M3MKX = $uxJUJ['userInfo']; goto s_35R; eUFli: } }