加入点击发布 点赞 评论等打开弹窗
This commit is contained in:
42
app.vue
42
app.vue
@@ -511,7 +511,10 @@ import axios from "axios";
|
||||
export default {
|
||||
name: "#answer-app",
|
||||
async setup() {
|
||||
const author = "034d01f3ab7e7c248d7cfdf8fdb96915";
|
||||
const author = "a37009134499cce160254db1bc9ccb94";
|
||||
|
||||
if (process.env.NODE_ENV !== "production" && document) document.cookie = "miucms_session=" + author;
|
||||
|
||||
const $ajax = (url, data) => {
|
||||
url = url.indexOf("//") > -1 ? url : baseURL + url;
|
||||
return new Promise(function (resolve, reject) {
|
||||
@@ -647,8 +650,41 @@ export default {
|
||||
setTimeout(() => {
|
||||
if (params["ispublish"]) questionsInit();
|
||||
}, 500);
|
||||
|
||||
const isLoginValue = params["islogin"];
|
||||
if (isLoginValue == 1) getUserInfoWin();
|
||||
else realname.value = 1;
|
||||
});
|
||||
|
||||
let realname = ref(0); // 是否已经实名
|
||||
|
||||
const getUserInfoWin = () => {
|
||||
const checkUser = () => {
|
||||
const user = window.userInfoWin;
|
||||
if (!user) {
|
||||
setTimeout(checkUser, 100);
|
||||
return;
|
||||
}
|
||||
userInfoWin.value = user;
|
||||
realname.value = user.realname || 0;
|
||||
};
|
||||
|
||||
setTimeout(checkUser, 100);
|
||||
};
|
||||
|
||||
const openAttest = () => {
|
||||
const handleAttestClose = () => {
|
||||
document.removeEventListener("closeAttest", handleAttestClose);
|
||||
realname.value = window.userInfoWin?.realname || 0;
|
||||
};
|
||||
// 启动认证流程时添加监听
|
||||
document.addEventListener("closeAttest", handleAttestClose);
|
||||
loadAttest(2);
|
||||
};
|
||||
|
||||
provide("realname", realname);
|
||||
provide("openAttest", openAttest);
|
||||
|
||||
// 处理在服务端已经请求了详情接口 数据
|
||||
const hanleServerRequestData = () => {
|
||||
const params = route.query;
|
||||
@@ -1051,6 +1087,10 @@ export default {
|
||||
|
||||
// 操作 - 点赞
|
||||
const operateLike = () => {
|
||||
if (realname.value == 0 && user.value.uin > 0) {
|
||||
openAttest();
|
||||
return;
|
||||
}
|
||||
if (isNeedLogin.value) {
|
||||
goLogin();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user