PM25000/dsh-ths-holdings ↗★ 3

dsh-ths-holdings

DSH 持仓盈亏悬浮卡片(同花顺投资账本)— 自动同步真实持仓数据,显示今日盈亏、上证指数和当日走势图,无需手动添加股票。Real portfolio holdings overlay for the DSH web GUI — automatically syncs your positions from the Tonghuashun investment-ledger API. 适合需要实时监控同花顺投资账本持仓和今日盈亏的DSH Web端用户。

패키지
dsh-ths-holdings
호환성
미검증
Harness peer 범위
^0.1.1-rc.2
Cordis peer 범위
^4.0.1
버전
0.2.0
라이선스
MIT
최근 업데이트
2026. 9. 23.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:PM25000/dsh-ths-holdings

Usage

Recommended — auto-acquire:

  1. Open the DSH web GUI — click ⚙ on the card.
  2. Click 🖥 自动获取 Cookie(推荐) — a system browser window opens (Edge / Chrome — the first installed one wins).
  3. Sign in to the Tonghuashun investment ledger in that window (QR code / account).
  4. When the sign-in succeeds the window closes itself, the Cookie is saved automatically, and the card refreshes with your portfolio.
  5. The plugin auto-discovers your portfolio — if you have several, pick one from the dropdown. Done.

Auto-acquire uses a temporary browser profile and reads cookies through browser-level commands. It does not attach a page debugger, inject scripts, or emulate viewport dimensions. Only cookies for 10jqka.com.cn and its subdomains are saved; the temporary profile is deleted after the browser exits. You do not need to open developer tools during sign-in.

If closing the window times out, profile cleanup continues when the browser actually exits. Cleanup failures remain visible in settings with a retry button. Cookie saves wait up to 30 seconds; a timeout or cancellation closes the login window, but an already submitted storage operation may still complete. The card shows that the result is unconfirmed and blocks additional saves until that operation settles, preventing an older request from overwriting a newer Cookie.

Manual saves are unavailable while automatic login is starting or running; cancel automatic login and wait for it to end before saving manually. Pending writes continue to block new writes to the same credential reference after the plugin reloads within the same DSH process, until the old operation settles.

Manual (backup):

  1. Open https://tzzb.10jqka.com.cn and log in.
  2. Click the browser's top-right menu → More tools → Developer tools (… in Edge, ⋮ in Chrome). F12 may have no effect on this page; open the tools through the browser menu.
  3. Keep developer tools open, select Network, then refresh the ledger page to record requests.
  4. Select a page or ledger API request to tzzb.10jqka.com.cn. Under Headers → Request Headers, copy the complete Cookie value. Copy only the name=value; name2=value2 portion, without the Cookie: prefix; do not copy a response's Set-Cookie header.
  5. Return to the DSH web GUI — click ⚙, paste the cookie into STOCK_PNL_COOKIE → save.
  6. The card validates the saved cookie immediately — it shows ✓ valid or ✗ invalid (with the reason/hint).

If the page reports that developer tools are unsupported, first check whether Network has already recorded a ledger request with a Cookie header. If no usable Cookie is available, use auto-acquire above. Keep developer tools open while inspecting cookies manually.

The session cookie expires eventually — when it does, the card shows a Token 已过期 banner; re-open ⚙ and click auto-acquire (or repeat manual steps 1–5) with a fresh cookie.

💡 After completing a new trade, re-upload your data from the investment-ledger app to the web version so your holdings stay consistent between the two.

Data upload tutorial