对接数据

This commit is contained in:
2025-10-24 15:45:38 +08:00
parent 672a2f4c90
commit d3375a347f
138 changed files with 16904 additions and 1026 deletions

View File

@ -1,10 +1,12 @@
import homeApi from '~/api/home'
import aboutApi from '~/api/about'
import userApi from '~/api/user'
import aboutApi from '~/api/about';
import toolApi from '@/api/tools';
import CommentApi from '~/api/comment';
import articleApi from '~/api/article';
import configApi from '~/api/config';
/**
* 将api注入到全局
*
*
* 在页面或组件里使用
* async mounted() {
const games = await this.$api.game.getGameList({ page: 1 })
@ -17,9 +19,11 @@ import userApi from '~/api/user'
*/
export default ({ $axios }, inject) => {
const api = {
home: homeApi($axios),
tool: toolApi($axios),
about: aboutApi($axios),
user: userApi($axios),
comment: CommentApi($axios),
article: articleApi($axios),
config: configApi($axios),
}
inject('api', api) // 将api注入到全局