Xpersona
唯

唯品会用户登录

CLAWHUB · Unverified

唯品会账号扫码登录技能。当用户说"登录唯品会"、"唯品会登录"、"扫码登录唯品会"、 "我要登录唯品会账号",或其他技能检测到未登录需要引导登录时,应立即触发此技能。 执行完整的二维码登录流程:获取二维码 → 展示给用户扫码 → 轮询确认 → 保存登录态到 ~/.vipshop-user-login/tokens...

62
Rank
84
Safety
974
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 974 downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17f62f71n2edqxt7yt2cbd9md83ks51:vipshop-user-login
  1. Install using `clawhub skill install s17f62f71n2edqxt7yt2cbd9md83ks51:vipshop-user-login` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/viphgta/vipshop-user-login before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-viphgta-vipshop-user-login/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

148,407 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: vipshop-user-login
description: >
  唯品会账号扫码登录技能。当用户说"登录唯品会"、"唯品会登录"、"扫码登录唯品会"、
  "我要登录唯品会账号",或其他技能检测到未登录需要引导登录时,应立即触发此技能。
  执行完整的二维码登录流程:获取二维码 → 展示给用户扫码 → 轮询确认 → 保存登录态到
  ~/.vipshop-user-login/tokens.json,供其他唯品会技能使用。
---

# 唯品会扫码登录 Skill

> ⚠️ **重要规范**:AI 必须先加载本 skill 规范(use_skill),再执行任何脚本或返回结果,不得绕过 skill 规范自行处理数据。
>
> **二维码展示规范**:执行登录脚本后,AI 智能体 **必须优先** 从 stdout 中提取机器可读标记:`[VIPSHOP_QR_PAYLOAD_BEGIN]` 与 `[VIPSHOP_QR_PAYLOAD_END]` 之间的 JSON,读取其中的 `qrImageUrl` 字段,并以 Markdown 图片语法 `![唯品会登录二维码](URL)` 直接展示给用户。仅当该标记不存在时,才允许回退到提取 `二维码链接` 后面的 URL。**不要仅输出链接或文字描述,必须展示图片**。

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

## 使用场景

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

## 工作流程

```
┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│  初始化二维码  │ ──→ │  展示二维码   │ ──→ │  轮询状态    │
└──────────────┘     └──────────────┘     └──────────────┘
       │                                          │
       │ 2. 返回qrToken                           │
       │←─────────────────────────────────────────┤
       │                                          │
       ▼                                          │
┌──────────────┐                                 │
│  用户扫码     │←────────────────────────────────┤
│  确认登录     │                                 │
└──────────────┘                                 │
       │                                         │
       │ 3. CONFIRMED                            │
       │─────────────────────────────────────────→│
       │                                         │
       ▼                                         ▼
┌──────────────┐                       ┌──────────────┐
│  登录成功     │                       │  保存Cookie   │
└──────────────┘                       └──────────────┘
```

1. **初始化二维码** - 调用API获取qrToken(自动校验格式,格式错误自动重试)
2. **获取二维码图片** - 使用qrToken获取二维码图片并展示
3. **轮询状态** - 定时检查扫码状态(NOT_SCANNED/SCANNED/CONFIRMED/INVALID)
4. **登录成功** - 状态为CONFIRMED时,Cookie中已包含登录凭证

## 核心功能

### 1. 获取登录二维码

```python
from scripts.vip_login import VIPLoginManager

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

### 2. 展示二维码

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

### 3. 轮询登录状态

自动轮询二维码状态,检测:
- `NOT_SCANNED` - 未扫码
- `SCANNED` - 已扫码(等待确认)
- `CONFIRMED` - 已确认登录(成功)
- `INVALID` - 二维码过期/失效

### 4. Cookie管理

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

### 5. 版本检测与更新提示

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

- 登录成功后会输出当前版本号(如 `当前版本: 1.0.0`)
- `tokens.json` 中保存当前版本号 `version`
- 如果检测到新版本,脚本只会提示用户按受控发布流程手动更新,不会自动执行更新命令,也不会远程下载并覆盖本地文件;提示信息中会给出可手动执行的命令 `npx clawhub update vipshop-skills --force`

**AI 助手职责**:

1. 登录成功后,**必须将脚本输出的当前版本号告知用户**(如"当前登录版本为 1.0.0")
2. 如果脚本提示有新版本,**AI 必须提示用户按受控发布流程手动更新**,并可转述脚本给出的手动命令 `npx clawhub update vipshop-skills --force`;

_meta.json

{
  "ownerId": "kn7aq88ew5s9a9wzxd3qhyb8dd83kwgm",
  "slug": "vipshop-user-login",
  "version": "1.0.11",
  "publishedAt": 1777000647390
}

references/api_reference.md

# 唯品会扫码登录 API 接口文档

> 本文档包含唯品会扫码登录相关的 API 接口说明。

## 接口列表

### 1. 初始化二维码登录信息 (/qrLogin/initQrLogin)

获取二维码登录的 TOKEN。

| 项目 | 说明 |
|------|------|
| **接口地址** | `https://passport.vip.com/qrLogin/initQrLogin` |
| **请求方法** | POST |
| **Content-Type** | application/x-www-form-urlencoded |
| **前置条件** | 已登录/未登录,均能访问 |

#### 请求参数

| 参数名 | 类型 | 必需 | 说明 |
|--------|------|------|------|
| whereFrom | string | 否 | 请求来源标识(联登请求来源标识,取页面URL的whereFrom参数值透传) |

#### 响应参数

| 参数名 | 类型 | 说明 |
|--------|------|------|
| code | int | 结果码,200 表示成功,500 表示失败 |
| msg | string | 结果描述 |
| qrToken | string | 二维码登录 TOKEN,如 `10000-ab04ec99a724418385445f6e73fd19a4` |

#### 响应示例 - 成功

```json
{
  "qrToken": "10000-ab04ec99a724418385445f6e73fd19a4",
  "msg": "",
  "code": 200
}
```

#### 响应示例 - 失败

```json
{
  "qrToken": null,
  "msg": "",
  "code": 500
}
```

---

### 2. 获取二维码图片 (/qrLogin/getQrImage)

根据 qrToken 获取二维码图片。

| 项目 | 说明 |
|------|------|
| **接口地址** | `https://passport.vip.com/qrLogin/getQrImage` |
| **请求方法** | GET |
| **响应格式** | 图片流 |
| **前置条件** | 已登录/未登录,均能访问 |

#### 请求参数

| 参数名 | 类型 | 必需 | 说明 |
|--------|------|------|------|
| qrToken | string | 是 | 二维码登录 TOKEN |

#### 响应结果

返回二维码图片流(PNG/JPG 格式)

#### 请求示例

```
https://passport.vip.com/qrLogin/getQrImage?qrToken=10000-5fc39232c4924137831d9d9bec72393b
```

---

### 3. 轮询检测二维码状态 (/qrLogin/checkStatus)

轮询检测二维码的扫码状态。

| 项目 | 说明 |
|------|------|
| **接口地址** | `https://passport.vip.com/qrLogin/checkStatus` |
| **请求方法** | POST |
| **Content-Type** | application/x-www-form-urlencoded |
| **前置条件** | 已登录/未登录,均能访问 |

#### 请求参数

| 参数名 | 类型 | 必需 | 说明 |
|--------|------|------|------|
| qrToken | string | 是 | 二维码登录 TOKEN |
| whereFrom | string | 否 | 请求来源标识 |

#### 响应参数

| 参数名 | 类型 | 说明 |
|--------|------|------|
| code | int | 结果码,200 表示成功,500 表示失败 |
| msg | string | 结果描述 |
| status | string | 二维码状态(code=200时有值) |
| redirectUrl | string | 登录成功后跳转路径 |

#### 状态码说明

| 状态值 | 说明 |
|--------|------|
| NOT_SCANNED | 未扫描 |
| SCANNED | 已扫描 |
| CONFIRMED | 已确认(即已登录成功,需要跳转回来源页面) |
| INVALID | 已失效(需提示更新二维码) |

#### 响应示例 - 成功

```json
{
  "status": "CONFIRMED",
  "code": 200,
  "msg": "",
  "redirectUrl": null
}
```

#### 响应示例 - 失败

```json
{
  "msg": "",
  "code": 500,
  "status": null,
  "redirectUrl": null
}
```

---

## 扫码登录流程

```
┌─────────────┐     1. initQrLogin      ┌──────────────┐
│   智能体    │ ───────────────────────> │   登录前端    │
│   (Claw)    │                          │ (passport)   │
└─────────────┘                          └──────────────┘
       │                                        │
       │ 2. 返回 qrToken                        │
       │ <──────────────────────────────────────┤
       │                                        │
       │ 3. getQrImage(qrToken)                 │
       │ ──────────────────────────────────────>│
       │                                        │
       │ 4. 返回二维码图片                       │
       │ <──────────────────────────────────────┤
       │                                        │
 

references/integration_guide.md

# 唯品会扫码登录 - 其他技能集成指南

本文档说明如何在其他 Skill 中使用本登录功能的登录结果。

## 登录态存储位置

登录成功后,会在用户目录下保存登录态:

```
~/.vipshop-user-login/tokens.json
```

存储格式:

```json
{
  "cookies": {
    "PASSPORT_ACCESS_TOKEN": "xxx",
    "VipRUID": "123456789",
    "VipRNAME": "nickname",
    "mars_cid": "..."
  },
  "user_id": "123456789",
  "nickname": "用户昵称",
  "created_at": 1699123456.789,
  "expires_at": 1699715256.789
}
```

## 使用方式

### 方式1: 直接读取 Cookie 文件

```python
import json
from pathlib import Path
import requests

# 读取保存的登录态
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", {})
    
    # 使用 cookies 访问唯品会 API
    session = requests.Session()
    session.headers.update({
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36',
        'Referer': 'https://www.vip.com/',
    })
    
    # 设置 cookies
    for name, value in cookies.items():
        session.cookies.set(name, value, domain='.vip.com')
    
    # 发起请求
    response = session.get("https://www.vip.com/user/info")
    print(response.text)
else:
    print("未找到登录态,请先执行扫码登录")
```

### 方式2: 通过 TokenManager 获取

如果你的 Skill 可以访问本 Skill 的 `scripts` 目录,推荐使用 TokenManager:

```python
from scripts.token_manager import TokenManager

manager = TokenManager()
token_info = manager.get_token()

if token_info:
    cookies = token_info.cookies
    user_id = token_info.user_id
    nickname = token_info.nickname
    
    # 使用 cookies 发起请求
    import requests
    session = requests.Session()
    session.headers.update({
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36',
        'Referer': 'https://www.vip.com/',
    })
    
    # 设置 cookies
    for name, value in cookies.items():
        session.cookies.set(name, value, domain='.vip.com')
    
    # 发起请求
    response = session.get("https://www.vip.com/user/info")
    print(response.text)
else:
    print("登录态已过期,需要重新登录")
```

## 关键 Cookie 说明

| Cookie 名称 | 说明 |
|------------|------|
| `PASSPORT_ACCESS_TOKEN` | 访问令牌,用于身份验证 |
| `VipRUID` | 用户ID |
| `VipRNAME` | 用户昵称(URL编码) |
| `mars_cid` | 设备ID |

## 检查登录态是否有效

```python
from scripts.token_manager import TokenManager

manager = TokenManager()

# 获取登录态(get_token 内部已处理过期逻辑)
token_info = manager.get_token()

if token_info:
    print("登录态有效")
    cookies = manager.get_cookies()
else:
    print("未登录或登录态已过期,请先执行扫码登录")
```

## 完整示例:获取用户信息

```python
import json
from pathlib import Path
import requests

def get_vip_user_info():
    """获取唯品会用户信息"""
    # 读取登录态
    token_file = Path.home() / ".vipshop-user-login" / "tokens.json"
    
    if not token_file.exists():
        return {"error": "未登录,请先执行扫码登录"}
    
    with open(token_file, 'r') as f:
        data = json.load(f)
    
    cookies = data.get("cookies", {})
    
    if not cookies:
        return {"error": "登录态无效"}
    
    # 检查是否过期(简单检查 PASSPORT_ACCESS_TOKEN 是否存在)
    if "P

skill-card.md

## Description:

Enables agents to start a Vipshop QR-code login flow, show the QR code to the user, poll for confirmation, and save the resulting login cookies for other Vipshop skills.

This skill is ready for commercial/non-commercial use.

## Publisher:

[viphgta](https://clawhub.ai/user/viphgta)

### License/Terms of Use:

MIT-0

## Use Case:

External users, agents, and developers use this skill to authenticate a Vipshop account by QR scan so downstream Vipshop skills can reuse the saved cookies for account-specific workflows.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Saved Vipshop cookies in ~/.vipshop-user-login/tokens.json can be reused to access the user's account.

Mitigation: Keep the token file private, treat it like a password, and use logout or removal when the login state is no longer needed.

Risk: QR tokens or QR image URLs may appear in terminal output or logs during login.

Mitigation: Avoid sharing terminal logs or screenshots from login sessions, especially while a QR code is active.

Risk: Dependencies are declared without a reviewed lockfile.

Mitigation: Prefer pinned dependencies or a reviewed lockfile before installing in a controlled environment.

## Reference(s):

- [Vipshop QR Login API Reference](references/api_reference.md)
- [Vipshop QR Login Integration Guide](references/integration_guide.md)
- [Vipshop Login Skill Release Page](https://clawhub.ai/viphgta/skills/vipshop-user-login)

## Skill Output:

**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration]

**Output Format:** [Markdown and text with CLI commands, Python snippets, machine-readable QR payload JSON, and a saved local JSON credential file.]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Creates or updates ~/.vipshop-user-login/tokens.json with reusable Vipshop cookies after a successful login.]

## Skill Version(s):

1.0.11 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to 唯品会用户登录 and adjacent AI workflows.