Add toy form values

增加手办表单信息
This commit is contained in:
奇趣保罗 2025-02-01 14:32:00 +08:00
parent 3733461807
commit c252ceafb2
6 changed files with 3546 additions and 2905 deletions

View File

@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => { const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]); const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
if (!token || !siteUrl) {
throw new Error("未指定 Token 或站点地址");
}
// 更新追番进度 // 更新追番进度
if (req.body.action === "updateBangumiProgress") { if (req.body.action === "updateBangumiProgress") {
const { values } = req.body; const { values } = req.body;

View File

@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => { const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]); const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
if (!token || !siteUrl) {
throw new Error("未指定 Token 或站点地址");
}
if (req.body.action === "addRead") { if (req.body.action === "addRead") {
const { values } = req.body; const { values } = req.body;
const formData = new FormData(); const formData = new FormData();

View File

@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => { const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]); const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
if (!token || !siteUrl) {
throw new Error("未指定 Token 或站点地址");
}
if (req.body.action === "addSay") { if (req.body.action === "addSay") {
const { values } = req.body; const { values } = req.body;
const formData = new FormData(); const formData = new FormData();

View File

@ -3,6 +3,10 @@ import type { PlasmoMessaging } from "@plasmohq/messaging";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => { const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]); const { token, siteUrl } = await chrome.storage.local.get(["token", "siteUrl"]);
if (!token || !siteUrl) {
throw new Error("未指定 Token 或站点地址");
}
// 添加手办 // 添加手办
if (req.body.action === "addToy") { if (req.body.action === "addToy") {
const { values } = req.body; const { values } = req.body;

View File

@ -17,6 +17,7 @@ interface FormValue {
type: number; type: number;
desc: string; desc: string;
productId: string; productId: string;
link: string;
} }
const getInfo = async () => { const getInfo = async () => {
@ -127,6 +128,10 @@ function Toy() {
<label htmlFor="productId">B ID</label> <label htmlFor="productId">B ID</label>
<input {...bindInput("productId")} placeholder="B 站产品 ID" /> <input {...bindInput("productId")} placeholder="B 站产品 ID" />
</div> </div>
<div>
<label htmlFor="link"></label>
<input {...bindInput("link")} placeholder="https://www.hpoi.net/hobby/xxxxx" />
</div>
<div> <div>
<label htmlFor="desc"></label> <label htmlFor="desc"></label>
<textarea {...bindInput("desc")} rows={5} placeholder="描述"></textarea> <textarea {...bindInput("desc")} rows={5} placeholder="描述"></textarea>

File diff suppressed because it is too large Load Diff