Commit 2dc02c4e by zhujian

fix

parent 54fbf0e0
...@@ -20,7 +20,7 @@ class LiveCourseOpt extends React.Component { ...@@ -20,7 +20,7 @@ class LiveCourseOpt extends React.Component {
} }
} }
handleCreateLiveCouese = ()=>{ handleCreateLiveCouese = () => {
window.RCHistory.push({ window.RCHistory.push({
pathname: '/create-live-course?type=add', pathname: '/create-live-course?type=add',
}) })
...@@ -28,15 +28,29 @@ class LiveCourseOpt extends React.Component { ...@@ -28,15 +28,29 @@ class LiveCourseOpt extends React.Component {
// 下载直播客户端 // 下载直播客户端
handleDownloadClient = () => { handleDownloadClient = () => {
const { isMac } = this.state; const { isMac } = this.state;
const BRAND = process.env.BRAND;
// 判断学员系统 // 判断学员系统
if (BRAND == 'syoo') {
var url;
if (!isMac) {
url = 'https://cdn.xiaomai5.com/ykt-win.exe'
} else {
url = 'https://cdn.xiaomai5.com/ykt-mac.dmg'
}
const a = document.createElement("a");
document.body.appendChild(a);
a.href = url;
a.click();
document.body.removeChild(a);
} else {
let platform; let platform;
if(!isMac){ if (!isMac) {
platform = 1 platform = 1
} else { } else {
platform = 4 platform = 4
} }
BaseService BaseService
.getLastedVersion({ model: 5, platform}) .getLastedVersion({ model: 5, platform })
.then((res) => { .then((res) => {
const a = document.createElement("a"); const a = document.createElement("a");
document.body.appendChild(a); document.body.appendChild(a);
...@@ -45,12 +59,14 @@ class LiveCourseOpt extends React.Component { ...@@ -45,12 +59,14 @@ class LiveCourseOpt extends React.Component {
document.body.removeChild(a); document.body.removeChild(a);
}) })
} }
}
render() { render() {
const userRole = User.getUserRole(); const userRole = User.getUserRole();
return ( return (
<div className="live-course-opt"> <div className="live-course-opt">
<div className="opt__left"> <div className="opt__left">
{ userRole !== "CloudLecturer" && {userRole !== "CloudLecturer" &&
<Button type="primary" onClick={this.handleCreateLiveCouese}>新建直播课</Button> <Button type="primary" onClick={this.handleCreateLiveCouese}>新建直播课</Button>
} }
<Button onClick={this.handleDownloadClient}>下载直播客户端</Button> <Button onClick={this.handleDownloadClient}>下载直播客户端</Button>
......
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