mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-05-06 13:58:43 +00:00
feat: dashboard link
This commit is contained in:
+10
-1
@@ -1,4 +1,4 @@
|
||||
import { ServerGroupResponse } from "@/types/nezha-api";
|
||||
import { LoginUserResponse, ServerGroupResponse } from "@/types/nezha-api";
|
||||
|
||||
export const fetchServerGroup = async (): Promise<ServerGroupResponse> => {
|
||||
const response = await fetch("/api/v1/server-group");
|
||||
@@ -8,3 +8,12 @@ export const fetchServerGroup = async (): Promise<ServerGroupResponse> => {
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
export const fetchLoginUser = async (): Promise<LoginUserResponse> => {
|
||||
const response = await fetch("/api/v1/profile");
|
||||
const data = await response.json();
|
||||
if (data.error) {
|
||||
throw new Error(data.error);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user