mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 09:40:13 +00:00
implement setting page (#12)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { ModelSettingForm, ModelConfig } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const updateSettings = async (data: ModelSettingForm): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.PATCH, `/api/v1/setting`, data);
|
||||
}
|
||||
|
||||
export const getSettings = async (): Promise<ModelConfig> => {
|
||||
return fetcher<ModelConfig>(FetcherMethod.GET, '/api/v1/setting', null);
|
||||
}
|
||||
+11
-3
@@ -1,10 +1,18 @@
|
||||
import { ModelUser } from "@/types"
|
||||
import { ModelProfile, ModelUserForm } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const getProfile = async (): Promise<ModelUser> => {
|
||||
return fetcher<ModelUser>(FetcherMethod.GET, '/api/v1/profile', null);
|
||||
export const getProfile = async (): Promise<ModelProfile> => {
|
||||
return fetcher<ModelProfile>(FetcherMethod.GET, '/api/v1/profile', null);
|
||||
}
|
||||
|
||||
export const login = async (username: string, password: string): Promise<any> => {
|
||||
return fetcher<any>(FetcherMethod.POST, '/api/v1/login', { username, password });
|
||||
}
|
||||
|
||||
export const createUser = async (data: ModelUserForm): Promise<number> => {
|
||||
return fetcher<number>(FetcherMethod.POST, '/api/v1/user', data);
|
||||
}
|
||||
|
||||
export const deleteUser = async (id: number[]): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.POST, '/api/v1/batch-delete/user', id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { ModelWAF } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const deleteWAF = async (ip: string[]): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.POST, '/api/v1/batch-delete/waf', ip);
|
||||
}
|
||||
|
||||
export const getWAFList = async (): Promise<ModelWAF[]> => {
|
||||
return fetcher<ModelWAF[]>(FetcherMethod.GET, '/api/v1/waf', null);
|
||||
}
|
||||
Reference in New Issue
Block a user