From 864caf9a5495984641d8fe25c306bad757083953 Mon Sep 17 00:00:00 2001 From: theluyuan <1162963624@qq.com> Date: Fri, 11 Dec 2020 10:12:31 +0800 Subject: [PATCH 1/2] yibufen --- src/App.vue | 1 + src/store/index.ts | 13 +++++++++++-- src/views/login/Login.vue | 13 ++++++++----- src/views/mine/Aboutus.vue | 11 ++++++----- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9cc09d1..b8662dc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -56,6 +56,7 @@ export default defineComponent({ store.commit("setWlan"); toindex() } + store.dispatch("getinfotext"); const zh = zhCN; const en = enUS; diff --git a/src/store/index.ts b/src/store/index.ts index 977d1a9..237772e 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,4 +1,4 @@ -import { getaddr, userinfo } from '@/api'; +import { getaddr, getarticle, userinfo } from '@/api'; import { setLanvuage } from '@/api/base'; import { getValue, saveValue } from '@/utils/common'; import { geti18n } from '@/utils/i18n'; @@ -72,7 +72,8 @@ export default createStore({ code: "", ename: "", name: "", - } + }, + infotext:[{title:"",content:""},{title:"",content:""}] }, mutations: { setseting(state, info){ @@ -120,6 +121,9 @@ export default createStore({ state.userinfo.languageValue = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage"); state.userinfo.language = (!getValue("Lanvuage") ? 'zh' : getValue("Lanvuage")) == 'zh' ? '中文' : 'English'; } + }, + setinfotext(state, data){ + state.infotext = data; } }, actions: { @@ -143,6 +147,11 @@ export default createStore({ const info = await getaddr(); console.log(info,11256445); commit("setquhao", info) + }, + async getinfotext({ commit }){ + const info = await getarticle(); + commit("setinfotext", info) + } }, modules: { diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue index c52504b..08e21e4 100644 --- a/src/views/login/Login.vue +++ b/src/views/login/Login.vue @@ -100,8 +100,9 @@