feat: translate

This commit is contained in:
2025-10-15 10:34:22 +08:00
parent 32b4a7e624
commit ee96c5feb8
11 changed files with 231 additions and 75 deletions

View File

@@ -0,0 +1,39 @@
import useAxios from "axios-hooks";
import { Result } from "@/types/http";
export interface MockResult {
id: number;
}
export interface MockPage {
id: number;
}
/**
* fetch the data
* 详细使用可以查看 useAxios 的文档
*/
export const useGetDialog = () => {
const url = `/app-api/ai/dialog/getDialog`;
const [{ data, loading, error }, execute] = useAxios<Result<any>>(
{
url,
method: "GET",
headers: {
"Content-Type": "application/json",
},
},
{ manual: true } // 手动触发
);
const getDialog = () => {
return execute({
headers: {
"Content-Type": "application/json",
},
});
};
return { data, loading, error, getDialog };
};