input('scope'); $is_pc_qrcode = request()->input('is_pc_qrcode') ?: 0;//1-PC扫码登录 0-否 if (empty($type) || $type == 'undefined') { $type = Client::getType(); } switch ($scope) { case 'tfb': return new MemberTFBService(); case 'freelogin': return new FreeloginService(); case 'tjpcps': if (request()->app_token && app('plugins')->isEnabled('aggregation-cps') && (!request()->appid || \Yunshop\AggregationCps\services\SettingManageService::getTrueKey() == request()->appid)) { return new MemberTjpCpsService(); } break; case 'yearendbox': if (app('plugins')->isEnabled('year-end-box')) { // 插件: 年末礼盒 return new \Yunshop\YearEndBox\services\YearEndBoxLoginService(); } break; case 'jinepay': if (app('plugins')->isEnabled('jinepay')) { // 插件: 锦银E付 return new \Yunshop\Jinepay\services\LoginService(); } break; case 'yzx_pay': if (app('plugins')->isEnabled('code-science-pay') && \Setting::get('code-science-pay.set.plugin_enable')) { // 插件: 豫章行代金券支付 return new \Yunshop\CodeSciencePay\services\CodeSciencePayLogin(); } break; } if (Client::setWechatByMobileLogin($type)) { $type = self::LOGIN_MOBILE; } $registerSet = \Setting::get('shop.register'); if ((!$registerSet['login_mode'] || in_array('mobile_code', $registerSet['login_mode'])) && request()->input('is_sms') == 1) { // todo 待优化,需要考虑其他很多种情况 $type = self::LOGIN_MOBILE_CODE; } // 小程序-智能相册webview加载 if ($type == self::LOGIN_MINI_APP && request()->input('webview') == 1) { $type = self::LOGIN_OFFICE_ACCOUNT; } switch ($type) { case self::LOGIN_OFFICE_ACCOUNT: $className = new MemberOfficeAccountService(); break; case self::LOGIN_MINI_APP: $className = new MemberMiniAppService(); break; case self::LOGIN_APP_WECHAT: $className = new MemberAppWechatService(); break; case self::LOGIN_WECHAT: $className = new MemberWechatService(); break; case self::LOGIN_MOBILE: if ((int)$is_pc_qrcode == 1) { $className = new MemberWechatQrcodeService(); break; } else { $className = new MemberMobileService(); break; } case self::LOGIN_QQ: $className = new MemberQQService(); break; case self::LOGIN_APP_YDB: $className = new MemberAppYdbService(); break; case self::LOGIN_ALIPAY: $className = new MemberAlipayService(); break; case self::LOGIN_Native: $className = new MemberNativeAppService(); break; case self::LOGIN_MOBILE_CODE: $className = new SmsCodeService(); break; case self::LOGIN_DOUYIN: $className = new MemberDouyinService(); break; case self::LOGIN_MINI_APP_FACE: $className = new MemberMiniAppFaceService(); break; case self::LOGIN_APP_ANCHOR: $className = new MemberAnchorAppService(); break; case self::LOGIN_APP_CPS: $className = new MemberCpsAppService(); break; case self::LOGIN_PC_OFFICE_ACCOUNT: $className = new MemberPcOfficeAccountService(); break; case self::LOGIN_WORK: $query_string = $_SERVER['QUERY_STRING']; if (strpos($query_string, 'client=work')) { $className = new MemberWorkService(); } else { $className = new MemberOfficeAccountService(); } break; case self::LOGIN_APP_LSP_WALLET: $className = new MemberAppLspWalletService(); break; case self::LOGIN_BUSINESS_SCAN_CODE: $className = new MemberBusinessScanCodeService(); break; default: throw new ShopException('应用登录授权失败', ['login_status' => -4]); } return $className; } }