|
@@ -2,12 +2,17 @@ import { login } from "@/api/path/login.api";
|
|
|
|
|
|
import { imLogin } from "@/api/path/im.api";
|
|
import { imLogin } from "@/api/path/im.api";
|
|
import { userInfo } from "@/api/path/jdfh.api";
|
|
import { userInfo } from "@/api/path/jdfh.api";
|
|
|
|
+import { useWalletStore } from "@/stores/modules/walletStore";
|
|
import { useSystemStore } from "@/stores/modules/systemStore";
|
|
import { useSystemStore } from "@/stores/modules/systemStore";
|
|
|
|
|
|
const imgHost = import.meta.env.VITE_PRO_IM_PATH + "/api/v1/file/";
|
|
const imgHost = import.meta.env.VITE_PRO_IM_PATH + "/api/v1/file/";
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
export async function sysLogin(address) {
|
|
export async function sysLogin(address) {
|
|
|
|
+ const walletStore = useWalletStore();
|
|
const systemStore = useSystemStore();
|
|
const systemStore = useSystemStore();
|
|
|
|
+
|
|
const results = await Promise.allSettled([
|
|
const results = await Promise.allSettled([
|
|
login({ wallet_address: address }),
|
|
login({ wallet_address: address }),
|
|
imLogin({ uuid: address }),
|
|
imLogin({ uuid: address }),
|
|
@@ -17,10 +22,10 @@ export async function sysLogin(address) {
|
|
const imLoginResult = results[1].value;
|
|
const imLoginResult = results[1].value;
|
|
|
|
|
|
systemStore.token = loginResult.data.access_token;
|
|
systemStore.token = loginResult.data.access_token;
|
|
- systemStore.avatar = imgHost + imLoginResult.data.avatar;
|
|
|
|
- systemStore.nickname = imLoginResult.data.nickname;
|
|
|
|
|
|
|
|
- console.log(systemStore)
|
|
|
|
|
|
+ walletStore.avatar = imgHost + imLoginResult.data.avatar;
|
|
|
|
+ walletStore.username = imLoginResult.data.nickname;
|
|
|
|
+
|
|
// 节点分红---获取用户是否为管理员以及是否加入了白名单
|
|
// 节点分红---获取用户是否为管理员以及是否加入了白名单
|
|
const res = await userInfo({ address });
|
|
const res = await userInfo({ address });
|
|
if (res.ret) {
|
|
if (res.ret) {
|
|
@@ -38,8 +43,10 @@ export async function sysLogin(address) {
|
|
|
|
|
|
// 更新用户信息
|
|
// 更新用户信息
|
|
export async function updateUserInfo(address) {
|
|
export async function updateUserInfo(address) {
|
|
- const systemStore = useSystemStore();
|
|
|
|
|
|
+ const walletStore = useWalletStore();
|
|
|
|
+
|
|
|
|
+
|
|
const res = await imLogin({ uuid: address });
|
|
const res = await imLogin({ uuid: address });
|
|
- systemStore.avatar = imgHost + res.data.avatar;
|
|
|
|
- systemStore.nickname = res.data.nickname;
|
|
|
|
|
|
+ walletStore.avatar = imgHost + res.data.avatar;
|
|
|
|
+ walletStore.username = res.data.nickname;
|
|
}
|
|
}
|