Commit e5c819e7 by wangshuo

登录功能和APP进行交互

parent dd481c7f
......@@ -41,7 +41,7 @@ class LiveRoom extends Component {
// 检查是否已登录
const {hasError, data = {}} = this.props.user;
if(hasError) {
this.props.history.push('/passport/login');
this.toLogin();
}else{
http.get(`${API['base-api']}/sys/createLiveQrcode/${id}`).then(res => {
let { errno, data, msg } = res.data;
......@@ -67,7 +67,7 @@ class LiveRoom extends Component {
toLivingRoom = (id) => {
const {hasError, data = {}} = this.props.user;
if(hasError) {
this.props.history.push('/passport/login');
this.toLogin();
}else{
window.location.href = `${window.location.protocol}//www.julyedu.com/live/m_room/${id}`
}
......@@ -76,7 +76,7 @@ class LiveRoom extends Component {
checkVideo = (url) => {
const {hasError, data = {}} = this.props.user;
if(hasError) {
this.props.history.push('/passport/login');
this.toLogin();
}else{
const vCourseId = url.split('/')[0];
history.push(`/play/video?id=${vCourseId}`)
......@@ -103,6 +103,15 @@ class LiveRoom extends Component {
}
}
// 去登录
toLogin = () => {
if (!getParam('version')) {
this.props.history.push('/passport/login')
} else {
SendMessageToApp("toLogin")
}
}
render() {
const { list,showMark,subUrl } = this.state;
return (
......
import React, { Component } from 'react';
import './team.scss'
import { getParam, http, SendMessageToApp, browser } from "@/utils"
import { getParam, http, SendMessageToApp } from "@/utils"
import { Toast } from 'antd-mobile';
import {withRouter} from 'react-router-dom';
import {compose} from "redux"
......@@ -54,7 +54,7 @@ class TeamInfo extends Component {
// 跳转到我的宝箱页
toYearTreasure = (close) => {
if(this.props.user.hasError) {
this.props.history.push('/passport/login');
this.toLogin();
} else {
let search = '';
if(close) {
......@@ -69,10 +69,19 @@ class TeamInfo extends Component {
}
// 去登录
toLogin = () => {
if (!getParam('version')) {
this.props.history.push('/passport/login')
} else {
SendMessageToApp("toLogin")
}
}
// 邀请好友组队
createTeam = () => {
if(this.props.user.hasError) {
this.props.history.push('/passport/login');
this.toLogin();
} else {
const {is_my_team, my_team: {treasure_code}} = this.state;
if(is_my_team) { // 有自己的队伍
......
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