This commit is contained in:
Ubuntu
2026-07-03 16:58:28 +08:00
commit 32b43f85bd
6240 changed files with 1987678 additions and 0 deletions
@@ -0,0 +1,69 @@
/**
* API配置
* 统一管理所有API接口地址
*/
// 基础URL
export const BASE_URL = 'https://www.wanandroid.com'
// API接口配置
export const API_CONFIG = {
// 首页相关
HOME: {
// Banner轮播图
BANNER: `${BASE_URL}/banner/json`,
// 首页文章列表
ARTICLE_LIST: `${BASE_URL}/article/list/{page}/json`,
// 置顶文章
TOP_ARTICLE: `${BASE_URL}/article/top/json`,
// 搜索文章
SEARCH_ARTICLE: `${BASE_URL}/article/query/{page}/json`
},
// 项目相关
PROJECT: {
// 项目分类
TREE: `${BASE_URL}/project/tree/json`,
// 项目列表
LIST: `${BASE_URL}/project/list/{page}/json`,
// 项目详情
DETAIL: `${BASE_URL}/project/detail/{id}/json`
},
// 公众号相关
WXARTICLE: {
// 公众号列表
CHAPTERS: `${BASE_URL}/wxarticle/chapters/json`,
// 公众号文章
ARTICLES: `${BASE_URL}/wxarticle/list/{id}/{page}/json`
},
// 体系相关
TREE: {
// 知识体系
SYSTEM_TREE: `${BASE_URL}/tree/json`,
// 体系下的文章
SYSTEM_ARTICLES: `${BASE_URL}/article/list/{page}/json`
},
// 用户相关
USER: {
// 登录
LOGIN: `${BASE_URL}/user/login`,
// 注册
REGISTER: `${BASE_URL}/user/register`,
// 退出登录
LOGOUT: `${BASE_URL}/user/logout/json`,
// 收藏列表
COLLECT_LIST: `${BASE_URL}/lg/collect/list/{page}/json`
}
}
// 请求超时时间(毫秒)
export const TIMEOUT = 10000
// 请求头配置
export const HEADERS = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}