share rules

This commit is contained in:
Gabe Yuan
2023-08-20 23:30:08 +08:00
parent 7ec43a1d3f
commit 232e9a47a2
9 changed files with 178 additions and 21 deletions

View File

@@ -8,9 +8,10 @@ import {
OPT_LANGS_SPECIAL,
PROMPT_PLACE_FROM,
PROMPT_PLACE_TO,
KV_HEADER_KEY,
KV_SALT_SYNC,
} from "../config";
import { getSetting, detectLang } from "../libs";
import { sha256 } from "../libs/utils";
/**
* 同步数据
@@ -25,7 +26,7 @@ export const apiSyncData = async (url, key, data) =>
{
headers: {
"Content-type": "application/json",
[KV_HEADER_KEY]: key,
Authorization: `Bearer ${await sha256(key, KV_SALT_SYNC)}`,
},
method: "POST",
body: JSON.stringify(data),