base加解密

courseware
dinglink 5 years ago
parent c4d2394f66
commit fc72c8c92a

@ -14,6 +14,7 @@ import './video.css';
import '../../user/usersInfo/video/InfosVideo.css' import '../../user/usersInfo/video/InfosVideo.css'
import axios from 'axios'; import axios from 'axios';
import { logWatchHistory } from "../../../services/video-service"; import { logWatchHistory } from "../../../services/video-service";
import { Base64 } from 'js-base64';
const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400 const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400 const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
@ -33,7 +34,8 @@ class Video extends Component {
visible: false, visible: false,
moveVisible: false, moveVisible: false,
moveVideoId: undefined moveVideoId: undefined,
videourl:null
} }
} }
@ -64,6 +66,7 @@ class Video extends Component {
if (!_clipboard) { if (!_clipboard) {
_clipboard = new ClipboardJS('.copybtn'); _clipboard = new ClipboardJS('.copybtn');
_clipboard.on('success', (e) => { _clipboard.on('success', (e) => {
this.props.showNotification('复制成功'); this.props.showNotification('复制成功');
}); });
} }
@ -110,6 +113,7 @@ class Video extends Component {
videoVisible: flag videoVisible: flag
}) })
if (flag === false) { if (flag === false) {
if (_clipboard) { if (_clipboard) {
this.setState({ this.setState({
videoId: undefined videoId: undefined
@ -119,8 +123,12 @@ class Video extends Component {
} }
} else { } else {
setTimeout(() => { setTimeout(() => {
this.setState({
videourl:'12321'
})
if (!_clipboard) { if (!_clipboard) {
_clipboard = new ClipboardJS('.copybtn'); _clipboard = new ClipboardJS('.copybtn');
_clipboard.on('success', (e) => { _clipboard.on('success', (e) => {
this.props.showNotification('复制成功'); this.props.showNotification('复制成功');
}); });
@ -131,7 +139,7 @@ class Video extends Component {
} }
getCopyText = (file_url, cover_url) => { getCopyText = (file_url, cover_url) => {
return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>` return `<video src="${Base64.decode(file_url)}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
} }
// 删除事件 // 删除事件
@ -228,9 +236,9 @@ class Video extends Component {
className="showVideoModal" className="showVideoModal"
width={800 - 1} width={800 - 1}
> >
{videoId && <VideoPanel src={videoId.file_url} videoId={videoId.videoId} courseId={CourseId} logWatchHistory={logWatchHistory} />} {videoId && <VideoPanel src={this.state.videourl===null?videoId.file_url:Base64.decode(videoId.file_url)} videoId={videoId.videoId} courseId={CourseId} logWatchHistory={logWatchHistory} />}
<div className="df copyLine"> <div className="df copyLine" style={{}}>
<Input value={_inputValue} <Input value={_inputValue}
className="dark" className="dark"
></Input> ></Input>

@ -404,7 +404,7 @@ class CoursesBanner extends Component {
exitclass=()=>{ exitclass=()=>{
this.setState({ this.setState({
modalsType: true, modalsType: true,
modalsTopval: "退出后您将不再是本课堂的成员,作品将全部被删除,", modalsTopval: "退出后您将不再是本课题的成员,作品将全部被删除,",
modalsBottomval:"确定要退出该课堂吗?", modalsBottomval:"确定要退出该课堂吗?",
metype:6 metype:6
}) })
@ -766,12 +766,12 @@ background:rgba(204,204,204,0.2) !important;
placement="topLeft" placement="topLeft"
title={<pre className="antsoancss"> title={<pre className="antsoancss">
{coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0? {coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?
<span>新收到{coursedata.teacher_applies_count}加入课堂的申请 <span >您有{coursedata.teacher_applies_count}新的加入申请
<a className={"daishenp ml5"} onClick={excellent === true && this.props.isAdminOrStudent() === false ?"":()=>this.setHistoryFun("/classrooms/"+this.props.match.params.coursesId+"/teachers?tab=2")}> <a className={"daishenp"} onClick={excellent === true && this.props.isAdminOrStudent() === false ?"":()=>this.setHistoryFun("/classrooms/"+this.props.match.params.coursesId+"/teachers?tab=2")}>
<span style={{ <span style={{
color:"#FFA804" color:"#FFA804"
}}> }}>
审批 审批
</span></a></span>:""}</pre>}> </span></a></span>:""}</pre>}>
<span className="color-grey-c font-16" onClick={excellent === true && this.props.isAdminOrStudent() === false ?"":()=>this.setHistoryFun("/classrooms/"+this.props.match.params.coursesId+"/teachers")}> <span className="color-grey-c font-16" onClick={excellent === true && this.props.isAdminOrStudent() === false ?"":()=>this.setHistoryFun("/classrooms/"+this.props.match.params.coursesId+"/teachers")}>
<span className={"mr10"}>教师</span> <span className={"mr10"}>教师</span>

Loading…
Cancel
Save