public function login($params, $oauth, $appInfo) { $type = $params['oauth_type'] ? $params['oauth_type'] : 'seller'; $username = $params['loginname']; $password = $params['password']; switch ($type) { case 'seller': $userinfo = app::get('sysopen')->rpcCall('account.shop.oauth.login', ['loginname' => $username, 'password' => $password]); $userinfo['data']['accountid'] = $userinfo['data']['sellerId']; $userinfo['data']['shop_id'] = app::get('sysopen')->rpcCall('shop.get.loginId', ['seller_id' => $userinfo['data']['sellerId']]); //checkout key和develop模式 kernel::single('sysopen_shop_check')->checkLogin($userinfo['data']['shop_id'], $appInfo['client_id']); sysopen_oauth::checkShopLogin($userinfo); break; case 'costomer': case 'admin': throw new LogicException('不支持的用户类型!当前仅支持seller。'); break; } return $userinfo; }
public function get($params, $oauth) { sysopen_oauth::checkShopOauth($oauth); $params['shop_id'] = $oauth['shop_id']; return app::get('sysopen')->rpcCall('trade.get.list', $params); }