chore: add cross-domain configuration for web component (#921)

* chore: add cross-domain configuration for web component

* docs: add release note
This commit is contained in:
BiggerRain
2025-10-13 15:45:28 +08:00
committed by GitHub
parent ca71f07f3a
commit 9652a54f08
3 changed files with 14 additions and 5 deletions

View File

@@ -29,6 +29,7 @@ fix: WM ext does not work when operating focused win from another display #919
refactor: improve sorting logic of search results #910
style: add dark drop shadow to images #912
chore: add cross-domain configuration for web component #921
## 0.8.0 (2025-09-28)

View File

@@ -1,5 +1,7 @@
import axios from "axios";
axios.defaults.withCredentials = true;
import { useAppStore } from "@/stores/appStore";
import {
@@ -78,7 +80,7 @@ export const Get = <T>(
}
axios
.get(baseURL + url, { params })
.get(baseURL + url, { params, withCredentials: true })
.then((result) => {
let res: FcResponse<T>;
if (clearFn !== undefined) {
@@ -110,10 +112,15 @@ export const Post = <T>(
}
axios
.post(baseURL + url, data, {
params,
headers,
} as any)
.post(
baseURL + url,
data,
{
params,
headers,
withCredentials: true,
} as any
)
.then((result) => {
resolve([null, result.data as FcResponse<T>]);
})

View File

@@ -34,6 +34,7 @@ export async function streamPost({
...(headersStorage),
...(headers || {}),
},
credentials: "include",
body: JSON.stringify(body),
});