find()) throw new AuthException('请登录', 410000); try { [$user, $type] = User::parseToken($token); } catch (\Throwable $e) { $tokenData->delete(); throw new AuthException('登录已过期,请重新登录', 410001); } if (!$user || $user->uid != $tokenData->uid) { $tokenData->delete(); throw new AuthException('登录状态有误,请重新登录', 410002); } $tokenData->type = $type; return compact('user', 'tokenData'); } /** * 订单创建成功后 * @param $order * @param $group */ public static function storeProductOrderCreateEbApi($order,$group) { if(!UserAddress::be(['is_default'=>1,'uid'=>$order['uid']])) UserAddress::setDefaultAddress($group['addressId'],$order['uid']); } }