添加api文件
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import AppFooter from "@/components/AppFooter.vue";
|
||||
import AppBackground from "@/components/AppBackground.vue";
|
||||
import UserHeader from "@/components/UserHeader.vue";
|
||||
import { getAppConfig } from '@/apis'
|
||||
|
||||
const userInfo = ref({
|
||||
name: "打酱油·路过",
|
||||
@@ -38,6 +39,22 @@ const toQquipmentPage = () => {
|
||||
url: "/pages/equipment-debug",
|
||||
});
|
||||
};
|
||||
|
||||
// 获取全局配置
|
||||
const getConfig = async () => {
|
||||
try {
|
||||
const config = await getAppConfig()
|
||||
console.log('全局配置:', config)
|
||||
// 这里可以处理配置数据
|
||||
} catch (error) {
|
||||
console.error('获取配置失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 页面加载完成后检查本地存储的用户信息并获取配置
|
||||
onMounted(() => {
|
||||
getConfig();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user