2025-03-19 18:01:04 +08:00

81 lines
2.0 KiB
Vue

<template>
<AppHeader />
<NuxtPage />
</template>
<script lang="ts" setup>
import $api from '@/service/webRequest'
import { useStore } from '~/store'
import { useI18n } from 'vue-i18n'
const { locale } = useI18n()
useSeoMeta({
title: '河南纳威格特商贸有限公司',
ogTitle: '河南纳威格特商贸有限公司',
description: '河南纳威格特商贸有限公司',
ogDescription: '河南纳威格特商贸有限公司',
ogImage: 'https://example.com/image.png',
twitterCard: 'summary_large_image',
})
const store = useStore()
onMounted(() => {
//判断store.是否是英文
if(localStorage.getItem('isEnglish') === 'en') {
locale.value = 'en'
}else{
locale.value = 'zh'
}
getCompany()
getSerList();
})
const getCompany = async () => {
try {
const response = await $api.get('/api/sys_config?name=official_website');
console.log(response);
// 保存 API 返回的数据到 store 中
store.saveTempApiData(response.data.data.config)
// 现在数据已经保存到 store 中,可以在任何组件中访问
console.log('数据已保存到临时存储')
} catch (error) {
console.error('获取数据失败', error)
}
}
const getSerList = async () => {
try {
const response = await $api.get('/api/share_list?page=1&limit=100');
console.log(response);
// 保存 API 返回的数据到 store 中
store.saveSerApiData(response.data.data.list)
// 现在数据已经保存到 store 中,可以在任何组件中访问
console.log('数据已保存到临时存储')
} catch (error) {
console.error('获取数据失败', error)
}
}
</script>
<style>
#__nuxt{
height: 100%;
width: 100%;
}
html,
body {
position: relative;
height: 100%;
}
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0;
padding: 0;
}
</style>