Commit 1e2333eb authored by cc's avatar cc

登录修改

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