mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
Update stats.ts
解决api跨域报错问题
This commit is contained in:
parent
bce70c1034
commit
68af480cca
1 changed files with 5 additions and 0 deletions
|
|
@ -60,6 +60,11 @@ export default async (
|
||||||
|
|
||||||
const { websiteId, compare } = req.query;
|
const { websiteId, compare } = req.query;
|
||||||
|
|
||||||
|
// 处理 OPTIONS 请求
|
||||||
|
if (req.method === 'OPTIONS') {
|
||||||
|
return res.status(200).end(); // 返回 200 OK 表示允许跨域
|
||||||
|
}
|
||||||
|
|
||||||
if (req.method === 'GET') {
|
if (req.method === 'GET') {
|
||||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||||
return unauthorized(res);
|
return unauthorized(res);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue