fix(用户认证): 更新实名认证状态默认值为1并优化用户信息获取逻辑
修复实名认证状态默认值为0的问题,改为1以匹配业务需求 优化用户信息获取逻辑,使用事件监听替代轮询方式 更新相关构建文件和静态资源版本
This commit is contained in:
16
app.vue
16
app.vue
@@ -511,7 +511,7 @@ import axios from "axios";
|
||||
export default {
|
||||
name: "#answer-app",
|
||||
async setup() {
|
||||
const author = "a37009134499cce160254db1bc9ccb94";
|
||||
const author = "d5645b2afb14eb6e62763901ff977059";
|
||||
|
||||
if (process.env.NODE_ENV !== "production" && document) document.cookie = "miucms_session=" + author;
|
||||
|
||||
@@ -654,20 +654,18 @@ export default {
|
||||
getUserInfoWin();
|
||||
});
|
||||
|
||||
let realname = ref(0); // 是否已经实名
|
||||
let realname = ref(1); // 是否已经实名
|
||||
|
||||
const getUserInfoWin = () => {
|
||||
const checkUser = () => {
|
||||
const user = window.userInfoWin;
|
||||
if (!user) {
|
||||
setTimeout(checkUser, 100);
|
||||
return;
|
||||
}
|
||||
if (!user) return;
|
||||
document.removeEventListener("getUser", checkUser);
|
||||
userInfoWin.value = user;
|
||||
realname.value = user.realname || 0;
|
||||
realname.value = user.realname;
|
||||
};
|
||||
|
||||
setTimeout(checkUser, 100);
|
||||
document.addEventListener("getUser", checkUser);
|
||||
};
|
||||
|
||||
const openAttest = () => {
|
||||
@@ -737,7 +735,7 @@ export default {
|
||||
let timer = setInterval(() => {
|
||||
if (window["userInfoWin"] && Object.keys(window["userInfoWin"]).length !== 0) {
|
||||
clearInterval(timer);
|
||||
user.value = window["userInfoWin"];
|
||||
user.value = window["userInfoWin"];
|
||||
if (window["userInfoWin"]["uid"] || window["userInfoWin"]["uin"]) isNeedLogin.value = false;
|
||||
}
|
||||
count++;
|
||||
|
||||
Reference in New Issue
Block a user