From 089bf5d2378b3c4a61d795b2a92bede2c193b771 Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Tue, 06 Jan 2026 11:22:58 +0800
Subject: [PATCH] 1
---
src/store/modules/user.js | 48 ++++++++----------------------------------------
1 files changed, 8 insertions(+), 40 deletions(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 6ee53b0..9f64d1a 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,50 +1,18 @@
-// import { getStorage, setStorage, getBrowserLang } from "@/utils/utis";
-import { _userInfo } from '@/service/user.api'
-import { SET_USERINFO, GET_USERINFO, SET_OUT, SET_STATUS } from "@/store/const.store";
-import { _getBalance } from '@/service/user.api.js'
export default {
namespaced: true,
state: {
- status: 0, // 状态
- gasObj: {}, //
- userInfo: {
- usercode: '', //
- token: '', // 登录token
- username: ''
- }
- },
- getters: {
- mingStatus: state => state.status,
- isToken: state => state.token,
- userInfo: state => state.userInfo
+ id: 0,
+ name: "",
},
mutations: {
- // SET_GAS_OBJ(state,gasObj){
- // state.gasObj=gasObj
- // },
- [SET_STATUS](state, status) { // 质押状态
- state.status = status;
+ updateId(state, id) {
+ state.id = id;
},
- [SET_USERINFO](state, info) {
- state.userInfo = { ...state.userInfo, ...info }
+ updateName(state, name) {
+ state.name = name;
},
- [SET_OUT](state) { // 退出
- state.userInfo = {}
- }
- },
- actions: {
- // actionsGasObj({commit},data){
- // commit("SET_GAS_OBJ", data);
- // },
- // actionsLogin({ commit }, data) {
- // commit("SET_UESR_OBJ", data);
- // },
- async [GET_USERINFO]({ commit }, accounts) { // 发送请求获取信息
- commit(SET_USERINFO, accounts) // 登陆
- let data = await _userInfo()
- commit(SET_USERINFO, data) // 用户信息
- data = await _getBalance()
- commit(SET_USERINFO, { balance: data.money }) // 余额
+ googleAuthBind(state, googleAuthBind) {
+ state.googleAuthBind = googleAuthBind;
},
},
};
--
Gitblit v1.9.3