parent
3733461807
commit
c252ceafb2
|
|
@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
|
|||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
|
||||
|
||||
if (!token || !siteUrl) {
|
||||
throw new Error("未指定 Token 或站点地址");
|
||||
}
|
||||
|
||||
// 更新追番进度
|
||||
if (req.body.action === "updateBangumiProgress") {
|
||||
const { values } = req.body;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
|
|||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
|
||||
|
||||
if (!token || !siteUrl) {
|
||||
throw new Error("未指定 Token 或站点地址");
|
||||
}
|
||||
|
||||
if (req.body.action === "addRead") {
|
||||
const { values } = req.body;
|
||||
const formData = new FormData();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
|
|||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
|
||||
|
||||
if (!token || !siteUrl) {
|
||||
throw new Error("未指定 Token 或站点地址");
|
||||
}
|
||||
|
||||
if (req.body.action === "addSay") {
|
||||
const { values } = req.body;
|
||||
const formData = new FormData();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
|
|||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
|
||||
|
||||
if (!token || !siteUrl) {
|
||||
throw new Error("未指定 Token 或站点地址");
|
||||
}
|
||||
|
||||
// 添加手办
|
||||
if (req.body.action === "addToy") {
|
||||
const { values } = req.body;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ interface FormValue {
|
|||
type: number;
|
||||
desc: string;
|
||||
productId: string;
|
||||
link: string;
|
||||
}
|
||||
|
||||
const getInfo = async () => {
|
||||
|
|
@ -127,6 +128,10 @@ function Toy() {
|
|||
<label htmlFor="productId">B 站产品 ID</label>
|
||||
<input {...bindInput("productId")} placeholder="B 站产品 ID" />
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="link">手办维基链接</label>
|
||||
<input {...bindInput("link")} placeholder="https://www.hpoi.net/hobby/xxxxx" />
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="desc">描述</label>
|
||||
<textarea {...bindInput("desc")} rows={5} placeholder="描述"></textarea>
|
||||
|
|
|
|||
6356
pnpm-lock.yaml
6356
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue