diff --git a/src/api/index.ts b/src/api/index.ts index 16b6b0c..ebd766f 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -31,7 +31,7 @@ export async function loginpass(phone: string, password: string,type?: number,sm }else{ setToken(); store.commit("login", true); - store.dispatch("setUserInfo"); + await store.dispatch("setUserInfo"); await router.push("/mine/archives") location.reload(); } diff --git a/src/store/index.ts b/src/store/index.ts index e0241a9..3f300b6 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -97,6 +97,7 @@ export default createStore({ async setUserInfo({ commit }){ const user = await userinfo(); if(user != '未登录'){ + saveValue("Lanvuage", user.languageValue); commit('setUserInfo', user); } else { const info = await getaddr(); diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 8c9ac7c..d90fcd0 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -58,7 +58,7 @@ export interface UserInfo { video: string; desc: string; money: string; - + languageValue: number; }