Add toy form values
增加手办表单信息
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Generated
+3488
-2868
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user