diff --git a/src/store/stock-quote/index.js b/src/store/stock-quote/index.js index d4d514d..b8a423f 100644 --- a/src/store/stock-quote/index.js +++ b/src/store/stock-quote/index.js @@ -1,17 +1,22 @@ import { ref } from 'vue' import { createGlobalState, useLocalStorage } from '@vueuse/core' import axios from 'axios' + export const useStockQuote = createGlobalState(() => { - const stockQuote = useLocalStorage('stockQuote', {}) + const stockQuote = useLocalStorage('stockQuote', { + "Open": "", + "Volume": "", + "DayRange": "", + "WeekRange": "", + "MarketCap": "", + "change": [ + "", + "" + ] + }) const getStockQuate= async()=>{ - const res = await axios.post('http://saas-test.szjixun.cn/api/chart/forward/test') - console.log('res',res); - stockQuote.value.Open=res.data.nodes?.[2]?.data?.[10] - stockQuote.value.Volume=res.data.nodes?.[1]?.data?.[21] - stockQuote.value.DayRange=[res.data.nodes?.[2]?.data?.[10],res.data.nodes?.[2]?.data?.[11]] - stockQuote.value.WeekRange=[res.data.nodes?.[2]?.data?.[31],res.data.nodes?.[1]?.data?.[30]] - - console.log('stockQuote.value',stockQuote.value); + const res = await axios.get('http://localhost:3213/api/minm/open') + stockQuote.value=res.data } return { getStockQuate, diff --git a/src/views/index/size1920/index.vue b/src/views/index/size1920/index.vue index f0298c4..eca403d 100644 --- a/src/views/index/size1920/index.vue +++ b/src/views/index/size1920/index.vue @@ -7,11 +7,13 @@ import customFooter from '@/components/customFooter/index.vue'