This commit is contained in:
@@ -887,6 +887,8 @@
|
|||||||
列表卡片(悬停出现)和阅读页动作行各有一个入口。删完详情也回 `7001`,
|
列表卡片(悬停出现)和阅读页动作行各有一个入口。删完详情也回 `7001`,
|
||||||
否则收藏的链接还能打开一篇"已经删掉的知识"。
|
否则收藏的链接还能打开一篇"已经删掉的知识"。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### 13.10 还没做
|
### 13.10 还没做
|
||||||
|
|
||||||
- 只做了"进"(收消息建事项),没做"出"(任务有进展回一条微信通知)。
|
- 只做了"进"(收消息建事项),没做"出"(任务有进展回一条微信通知)。
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
@@ -0,0 +1,45 @@
|
|||||||
|
/**
|
||||||
|
* 知识页侧栏(分类 + 标签)的截图,给设计文档用。
|
||||||
|
* 视口拉高一点,让侧栏底部的标签清单完整入画。
|
||||||
|
*/
|
||||||
|
import { readFile } from "node:fs/promises";
|
||||||
|
import { chromium } from "playwright-core";
|
||||||
|
|
||||||
|
const WEB = process.env.WEB ?? "http://192.168.8.188:8200";
|
||||||
|
const API = process.env.API ?? `${WEB}/api/v1`;
|
||||||
|
const PHONE = process.env.PHONE ?? "13605513683";
|
||||||
|
const PASSWORD = process.env.PASSWORD ?? "Tata&0912";
|
||||||
|
const CHROME =
|
||||||
|
process.env.CHROME ??
|
||||||
|
`${process.env.LOCALAPPDATA}\\ms-playwright\\chromium-1223\\chrome-win64\\chrome.exe`;
|
||||||
|
|
||||||
|
const login = await fetch(`${API}/auth/login/password`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ phone: PHONE, password: PASSWORD }),
|
||||||
|
}).then((r) => r.json());
|
||||||
|
if (login.code !== 0) throw new Error(`登录失败:${login.message}`);
|
||||||
|
|
||||||
|
const ws = (
|
||||||
|
await fetch(`${API}/workspaces`, {
|
||||||
|
headers: { Authorization: `Bearer ${login.data.tokens.access_token}` },
|
||||||
|
}).then((r) => r.json())
|
||||||
|
).data.items[0];
|
||||||
|
|
||||||
|
const browser = await chromium.launch({ executablePath: CHROME });
|
||||||
|
const context = await browser.newContext({ viewport: { width: 1440, height: 1180 } });
|
||||||
|
await context.addInitScript(
|
||||||
|
([access, refresh]) => {
|
||||||
|
localStorage.setItem("dadao.access", access);
|
||||||
|
localStorage.setItem("dadao.refresh", refresh);
|
||||||
|
},
|
||||||
|
[login.data.tokens.access_token, login.data.tokens.refresh_token],
|
||||||
|
);
|
||||||
|
const page = await context.newPage();
|
||||||
|
await page.goto(`${WEB}/w/${ws.id}/knowledge`, { waitUntil: "networkidle" });
|
||||||
|
await page.waitForTimeout(800);
|
||||||
|
const out = process.env.OUT ?? "e2e/artifacts/knowledge-tags-tall.png";
|
||||||
|
await page.screenshot({ path: out });
|
||||||
|
console.log("saved", out);
|
||||||
|
await browser.close();
|
||||||
|
void readFile;
|
||||||
Reference in New Issue
Block a user