Commit 1e2333eb authored by cc's avatar cc

登录修改

parent d2f7fa0f
......@@ -11,6 +11,18 @@ export default [
}
},
},
{
url: '/customActivity/kww/custom/kwwBaseInfo',
method: 'get',
response: ({ query }) => {
return {
"success": true,
"data": {
"boolLogin": false,
}
}
},
},
{
url: '/coop_frontVariable.query',
method: 'get',
......
......@@ -84,7 +84,7 @@ const API = generateAPI({
receiveBubble: "main/receiveBubble.do",
startVideo: "main/startVideo.do",
getLoginInfo: `/customActivity/kww/custom/kwwBaseInfo`,
})
// console.log('======', API)
......
......@@ -23,6 +23,7 @@ class HomePage extends React.Component<any, any> {
if (store.frontVariable?.homeTip?.length > 0) {
store.changeHomeTip()
}
store.getLoginInfo();
// store.queryTask()
// if (getUrlParam('inviteCode')) {
// store.doAssist()
......
......@@ -4,6 +4,7 @@ import { Ease, Tween } from "@/core/tween";
import { _asyncThrottle, prefixInteger } from "@/utils/utils.ts";
import { reactor, observer } from "@/pages/HomePage/Top/mobx/decorators.ts";
import { handleLogClick, handleLogExposure } from "@/MD.ts";
import store from "@/store/store";
@observer
......@@ -29,6 +30,7 @@ export class PlantGameBubble extends Container implements IBase {
}
onPointerUp = _asyncThrottle(async () => {
if (!store.checkLoginStatus()) return;
location.href = location.origin + "/projectx/p124e3402/index.html?appID=89420"
});
......
......@@ -140,13 +140,19 @@ class Store {
}
}
loginInfo:any = {};
async getLoginInfo() {
const { success, data } = await API.getLoginInfo();
if (!success) return;
this.loginInfo = data;
}
/**
* 校验登录状态
*/
checkLoginStatus() {
const { login } = this.indexData || {};
const { boolLogin } = this.loginInfo || {};
if (login === false) {
if (boolLogin === false) {
// 可能会有助力参数啥的 或者打开的是落地页 所以直接把当前href传过去吧
let midUrl = location.origin + CFG.loginMidUrl + encodeURIComponent(location.href);
if (getUrlParam('version')) midUrl += `&version=${getUrlParam('version')}`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment