首页龙虾技能列表 › Vipshop User Login — 唯品会用户登录

Vipshop User Login — 唯品会用户登录

v1.0.8

唯品会用户登录工具。

0· 167·0 当前·0 累计
by @viphgta (vip)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/10
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
可疑
medium confidence
The skill's code and instructions largely match its stated purpose (VIPShop QR login), but there are notable surprises — telemetry/remote reporting and an automatic update step that downloads code (npx) — that you should understand before installing.
评估建议
What to consider before installing: - Functionality fit: The code implements the claimed QR-login flow and saves authentication cookies to ~/.vipshop-user-login/tokens.json. If you trust this functionality, that part is coherent. - Persistent secrets: The skill stores session cookies (including PASSPORT_ACCESS_TOKEN) on disk. Anyone with access to that file may be able to reuse the login; treat it like credentials. Consider file system permissions and rotating credentials if needed. - Telemetry:...
详细分析 ▾
用途与能力
Name/description (唯品会扫码登录) match the code: it obtains qrToken, fetches QR image, polls status, and persists cookies to ~/.vipshop-user-login/tokens.json. Required files and functionality align with a QR-login helper and no unrelated credentials or system binaries are requested.
指令范围
SKILL.md restricts runtime behavior to the QR login flow and requires the agent to extract and display the QR image URL as a Markdown image. That is consistent with the purpose, but the SKILL.md also mandates that the AI 'must' display the image and report version information. The required display of a public QR URL in chat may expose the qrToken in the conversation history (privacy risk). The flow also instructs/assumes automatic update behavior after login (see below).
安装机制
This is instruction-only (no install spec). Python code and a requirements.txt are included; nothing is downloaded at install time. However, the skill's text and code indicate it can automatically run an updater (npx clawhub update vipshop-skills --force) when a version mismatch is detected — that implies runtime download/execution from npm/GitHub without an explicit install step, which increases risk compared with a purely static, local script.
凭证需求
The skill requests no environment variables or external credentials. It does read OPENCLAW_SESSION to decide OpenClaw behavior. It stores cookies and device id in ~/.vipshop-user-login (tokens.json, device.json) — this is expected for a login helper but does mean persistent authentication material is kept on disk. Telemetry is sent to vipstatic/vip domains (logger module) and includes masked qr_token, mars_cid and environment metadata; telemetry is plausible but worth noting.
持久化与权限
always is false and the skill does not request system-wide privileges. It persists tokens and a device id under the user's home directory (~/.vipshop-user-login). It sets restrictive file permissions for storage (0o700/0o600). There is no evidence it modifies other skills or global agent settings.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.82026/3/30

vipshop-user-login v1.0.8 - 明确规范 AI 必须从 stdout 提取二维码链接,并使用 Markdown 图片语法直接展示二维码图片给用户,而非仅输出链接或文字描述。 - 新增对 AI 智能体和 OpenClaw 场景下二维码展示流程的详细约束说明。 - 文档中补充二维码展示的多种方式和 stdout 格式要求,强调必须展示图片。 - 其他说明、工作流程及集成方式未变。

● 可疑

安装命令 点击复制

官方npx clawhub@latest install vipshop-user-login
镜像加速npx clawhub@latest install vipshop-user-login --registry https://cn.clawhub-mirror.com

技能文档

⚠️ 重要规范:AI 必须先加载本 skill 规范(use_skill),再执行任何脚本或返回结果,不得绕过 skill 规范自行处理数据。
>
二维码展示规范:执行登录脚本后,AI 智能体 必须 从 stdout 中提取 二维码链接 后面的 URL(格式为 https://passport.vip.com/qrLogin/getQrImage?qrToken=xxx),并以 Markdown 图片语法 !唯品会登录二维码 直接展示给用户。不要仅输出链接或文字描述,必须展示图片

此Skill提供唯品会扫码登录的完整解决方案,用于AI助手自动化完成唯品会账号登录流程。

使用场景

  • AI助手需要访问唯品会用户数据
  • 自动化脚本需要模拟用户登录
  • 集成测试需要真实用户身份
  • 数据采集需要登录态

工作流程

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│  初始化二维码  │ ──→ │  展示二维码   │ ──→ │  轮询状态    │
└──────────────┘     └──────────────┘     └──────────────┘
       │                                          │
       │ 2. 返回qrToken                           │
       │←─────────────────────────────────────────┤
       │                                          │
       ▼                                          │
┌──────────────┐                                 │
│  用户扫码     │←────────────────────────────────┤
│  确认登录     │                                 │
└──────────────┘                                 │
       │                                         │
       │ 3. CONFIRMED                            │
       │─────────────────────────────────────────→│
       │                                         │
       ▼                                         ▼
┌──────────────┐                       ┌──────────────┐
│  登录成功     │                       │  保存Cookie   │
└──────────────┘                       └──────────────┘
  • 初始化二维码 - 调用API获取qrToken(自动校验格式,格式错误自动重试)
  • 获取二维码图片 - 使用qrToken获取二维码图片并展示
  • 轮询状态 - 定时检查扫码状态(NOT_SCANNED/SCANNED/CONFIRMED/无效)
  • 登录成功 - 状态为CONFIRMED时,Cookie中已包含登录凭证

核心功能

1. 获取登录二维码

from scripts.vip_login import VIPLoginManager

manager = VIPLoginManager() result = manager.login()

2. 展示二维码

支持多种展示方式:

  • 终端显示 - 使用ASCII字符在终端显示(适合SSH环境)
  • 打开图片 - 生成图片文件并用系统默认程序打开
  • AI智能体展示 - 脚本输出二维码链接 URL,AI 智能体应提取该 URL 并以 !唯品会登录二维码 展示图片
  • OpenClaw展示 - 检测 OPENCLAW_SESSION=1 时输出 [OPENCLAW_SEND_FILE]路径[/OPENCLAW_SEND_FILE]

3. 轮询登录状态

自动轮询二维码状态,检测:

  • NOT_SCANNED - 未扫码
  • SCANNED - 已扫码(等待确认)
  • CONFIRMED - 已确认登录(成功)
  • 无效 - 二维码过期/失效

4. Cookie管理

  • 登录凭证自动保存到 ~/.vipshop-用户-登录/tokens.json
  • 单用户模式,自动覆盖旧登录态
  • 基于Cookie的会话保持
  • 登录态有效期与 PASSPORT_ACCESS_TOKEN Cookie 一致

5. 版本检测与自动更新

登录成功后,脚本会自动输出版本信息并检测版本变化:

  • 登录成功后会输出当前版本号(如 当前版本: 1.0.0
  • tokens.json 中保存当前版本号 version
  • 如果检测到新版本,会自动执行 npx clawhub 更新 vipshop-skills --force 更新

AI 助手职责

  • 登录成功后,必须将脚本输出的当前版本号告知用户(如"当前登录版本为 1.0.0")
  • 版本更新由脚本自动完成(clawhub → GitHub 兜底),如果两种方式都失败,AI 必须提示用户手动从 https://github.com/vipshop/vipshop-ai-skills 更新

使用方法

命令行使用

默认非阻塞模式(获取二维码后立即结束,不等待扫码):

# 执行扫码登录(非阻塞模式,获取二维码后结束)
python scripts/vip_login.py

# 使用阻塞模式(获取二维码后等待扫码完成) python scripts/vip_login.py --blocking

# 在终端显示二维码(不打开图片) python scripts/vip_login.py --terminal

# 指定请求来源 python scripts/vip_login.py --where-from xxx

# 查看已登录记录 python scripts/vip_login.py --list

# 查看登录状态 python scripts/vip_login.py --status

# 注销登录记录 python scripts/vip_login.py --logout TOKEN_ID

# 使用指定qrToken继续登录(非阻塞模式后) python scripts/vip_login.py --poll

# 继续上次未完成的登录 python scripts/vip_login.py --continue

Python API使用

from scripts.vip_login import VIPLoginManager, Config

# 方式1: 使用默认配置 manager = VIPLoginManager() result = manager.quick_login()

if result.success: print(f"登录成功!") print(f"qrToken: {result.qr_token}") if result.redirect_url: print(f"跳转URL: {result.redirect_url}") else: print(f"登录失败: {result.message}")

# 方式2: 自定义配置 class MyConfig(Config): SHOW_IN_TERMINAL = True # 在终端显示二维码 POLL_INTERVAL = 1 # 轮询间隔1秒 POLL_TIMEOUT = 180 # 超时3分钟

manager = VIPLoginManager(MyConfig()) result = manager.login(where_from="my_app")

# 获取已保存的登录凭证 token_info = manager.get_stored_token("current_user") if token_info: print(f"用户ID: {token_info.user_id}") print(f"Cookies: {token_info.cookies}")

非阻塞交互式登录(AI助手/OpenClaw场景)

适用于AI助手或OpenClaw场景:发送二维码给用户后立即结束脚本,不阻塞主会话。用户扫码确认后,通过后续命令继续完成登录。

AI 智能体二维码展示: 脚本执行后会在 stdout 中输出二维码链接(格式 https://passport.vip.com/qrLogin/getQrImage?qrToken=xxx)。AI 智能体应提取该链接,以 Markdown 图片语法 !唯品会登录二维码 直接展示二维码图片。该链接为公网可访问 URL,无需依赖本地文件。

OpenClaw 自动识别: 当检测到 OPENCLAW_SESSION=1 环境变量时,脚本会自动输出 [OPENCLAW_SEND_FILE]路径[/OPENCLAW_SEND_FILE],OpenClaw 可直接在会话中展示图片。

from scripts.vip_login import VIPLoginManager

manager = VIPLoginManager()

# 定义发送二维码给用户的回调 def send_qr_to_user(image_bytes: bytes, image_format: str): """将二维码图片发送给用户""" # 实现你的发送逻辑,例如通过消息平台发送图片 print(f"[发送二维码给用户] 格式: {image_format}, 大小: {len(image_bytes)} bytes") # 这里可以调用你的消息发送API

# 执行非阻塞登录 result = manager.login( where_from="my_app", send_qr_to_user_callback=send_qr_to_user )

if result.success and result.qr_token: if result.message == "二维码已发送,请扫码确认后使用 --poll 参数继续": print(f"二维码已发送,qrToken: {result.qr_token}") print(f"如果二维码展示失败,请点击 {result.qr_url} 查看二维码") print("用户扫码确认后,调用 manager.login(qr_token_to_poll=qr_token) 继续") else: print("登录成功!") else: print(f"登录失败: {result.message}")

后续继续登录流程:

# 用户扫码确认后,使用之前保存的 qrToken 继续
result = manager.login(qr_token_to_poll="之前保存的qrToken")

if result.success: print("登录成功!") else: print(f"登录失败: {result.message}")

分步骤使用

from scripts.qr_code_client import QRCodeClient
from scripts.status_poller import StatusPoller, LoginStatus
from scripts.token_manager import TokenManager, TokenInfo
import time

# 1. 获取二维码 qr_client = QRCodeClient( base_url="https://passport.vip.com", init_endpoint="/qrLogin/initQrLogin", image_endpoint="/qrLogin/getQrImage" )

success, qr_token, data = qr_client.init_qr_code(where_from="xxx") if success: # 2. 展示二维码 success, image_bytes, fmt = qr_client.get_qr_image(qr_token) qr_client.open_qr_image(image_bytes, fmt) # 3. 轮询状态 poller = StatusPoller( base_url="https://passport.vip.com", check_endpoint="/qrLogin/checkStatus" ) result = poller.poll_until_complete(qr_token) if result.status == LoginStatus.CONFIRMED: print("登录成功!") # 4. 保存凭证(从响应中提取 cookies) token_mgr = TokenManager() token_info = TokenInfo( cookies={"session": "xxx"}, # 从 result.raw_http_response 中提取 user_id="user_id", nickname="nickname", expires_at=time.time() + 7 24 3600 ) token_mgr.save_token("current_user", token_info)

配置说明

scripts/vip_login.pyConfig 类中可以自定义以下参数:

class Config:
    # API 配置
    BASE_URL = "https://passport.vip.com"
    INIT_QR_ENDPOINT = "/qrLogin/initQrLogin"
    GET_QR_IMAGE_ENDPOINT = "/qrLogin/getQrImage"
    CHECK_STATUS_ENDPOINT = "/qrLogin/checkStatus"

# 轮询配置 POLL_INTERVAL = 1 # 轮询间隔(秒),建议每秒轮询一次 POLL_TIMEOUT = 180 # 超时时间(秒),二维码有效期约3分钟

# 二维码配置 SHOW_IN_TERMINAL = False # False=打开图片, True=终端显示

# 交互模式配置(默认非阻塞模式) NON_BLOCKING_MODE = True # True=非阻塞(获取二维码后结束), False=阻塞(等待扫码完成)

API接口文档

详细的API接口规范请参考 references/api_reference.md

主要接口:

  • POST /qrLogin/initQrLogin - 初始化二维码(返回qrToken)
  • 获取 /qrLogin/getQrImage?qrToken=xxx - 获取二维码图片
  • POST /qrLogin/checkStatus - 轮询状态

状态值说明:

状态说明
NOT_SCANNED未扫描
SCANNED已扫描
CONFIRMED已确认登录(成功)
INVALID已失效

依赖安装

pip install requests qrcode Pillow

目录结构

vipshop-user-login/
├── SKILL.md                      # 此文档
├── scripts/
│   ├── vip_login.py              # 主登录脚本(入口)
│   ├── qr_code_client.py         # 二维码处理
│   ├── status_poller.py          # 状态轮询
│   ├── token_manager.py          # Token管理
│   ├── mars_cid_generator.py     # 设备ID生成器
│   └── logger.py                 # 日志上报(问题排查)
└── references/
    └── api_reference.md          # API接口文档

其他技能集成

本 Skill 登录成功后,会在 ~/.vipshop-user-login/tokens.json 中保存登录态。

其他技能可以通过以下方式获取登录态:

import json
from pathlib import Path

# 读取 cookies token_file = Path.home() / ".vipshop-user-login" / "tokens.json"

if token_file.exists(): with open(token_file, 'r') as f: data = json.load(f) cookies = data.get("cookies", {}) else: cookies = {}

详见:集成指南

注意事项

  • 二维码有效期: 二维码默认3分钟过期,超时后状态变为无效,需重新获取
  • 轮询频率: 建议每秒轮询一次,避免频繁请求导致IP被封
  • Cookie保持: 登录成功后,Cookie会自动包含登录凭证,无需额外获取令牌
  • 令牌安全: 凭证文件存储在用户目录~/.vipshop-用户-登录/下,权限设置为仅所有者可读写
  • 依赖项: 需要安装 requests、qrcode、Pillow
  • qrToken格式: 系统会自动校验qrToken格式(如10000-xxx),格式错误会重试或报错,不会生成无效二维码
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务