上线修改
This commit is contained in:
parent
041a9dd8b2
commit
6c3710cf84
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import {ref, onMounted} from 'vue'
|
||||||
import { useArticleApi } from '~/composables/useArticleApi'
|
import {useArticleApi} from '~/composables/useArticleApi'
|
||||||
|
|
||||||
// 类型定义
|
// 类型定义
|
||||||
interface Article {
|
interface Article {
|
||||||
|
|
@ -26,9 +26,9 @@ const error = ref('')
|
||||||
|
|
||||||
// 文章类型配置
|
// 文章类型配置
|
||||||
const articleTypes = [
|
const articleTypes = [
|
||||||
{ name: '解决方案', code: 'solution' },
|
{name: '解决方案', code: 'solution'},
|
||||||
{ name: '开发知识', code: 'developKnowledge' },
|
{name: '开发知识', code: 'developKnowledge'},
|
||||||
{ name: '行业动态', code: 'industryTrend' }
|
{name: '行业动态', code: 'industryTrend'}
|
||||||
]
|
]
|
||||||
|
|
||||||
// 格式化时间
|
// 格式化时间
|
||||||
|
|
@ -82,7 +82,11 @@ const fetchNewsData = async (): Promise<void> => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const results = await Promise.all(promises)
|
const results = await Promise.all(promises)
|
||||||
newsData.value = results.filter(category => category.articleList.length > 0)
|
console.log(results, 'results')
|
||||||
|
// newsData.value = results.filter(category => category.articleList.length > 0)
|
||||||
|
newsData.value = results
|
||||||
|
console.log(newsData.value, 'newsData')
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
error.value = err instanceof Error ? err.message : '获取新闻数据失败'
|
error.value = err instanceof Error ? err.message : '获取新闻数据失败'
|
||||||
console.error('Error fetching news data:', err)
|
console.error('Error fetching news data:', err)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
// API基础地址配置
|
// API基础地址配置
|
||||||
export const API_CONFIG = {
|
export const API_CONFIG = {
|
||||||
// 开发环境API地址
|
// 开发环境API地址
|
||||||
BASE_URL: 'http://192.168.1.4:4101',
|
BASE_URL: 'https://ele.ccttiot.com/prod-api',
|
||||||
|
|
||||||
// API端点配置
|
// API端点配置
|
||||||
ENDPOINTS: {
|
ENDPOINTS: {
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 1.6 MiB |
Loading…
Reference in New Issue
Block a user