Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_aliyun_beta
杨树明 5 years ago
commit 838bace07c

@ -1,7 +1,10 @@
class Wechats::JsSdkSignaturesController < ApplicationController
def create
signature = Util::Wechat.js_sdk_signature(params[:url], params[:noncestr], params[:timestamp])
render_ok(signature: signature)
timestamp = (Time.now.to_f * 1000).to_i
noncestr = ('A'..'z').to_a.sample(8).join
signature = Util::Wechat.js_sdk_signature(params[:url], noncestr, timestamp)
render_ok(appid: Util::Wechat.appid, timestamp: timestamp, noncestr: noncestr, signature: signature)
rescue Util::Wechat::Error => ex
render_error(ex.message)
end

@ -383,12 +383,12 @@ class Comments extends Component {
{/* <span className="ml5 mr5 color-grey-8">|</span>*/}
<a href={`javascript:void(0)`} className="color-grey-8"
{(this.props.showReply == undefined || this.props.showReply == true) && <a href={`javascript:void(0)`} className="color-grey-8"
onClick={() => this.initReply(item) } >
<Tooltip title={ "回复" }>
<i className="iconfont icon-huifu1 mr5"></i>
</Tooltip>
</a>
</a>}
{/* <span className="ml5 mr5 color-grey-8">|</span>*/}

@ -527,6 +527,7 @@ class TopicDetail extends Component {
// TODO 图片上传地址
const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId
const isCourseEnd = this.props.isCourseEnd()
return (
<div className="edu-back-white edu-class-container edu-position course-message topicDetail" id="yslforum_index_list"> {/* fl with100 */}
<style>{`
@ -678,8 +679,8 @@ class TopicDetail extends Component {
}
</div>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>
{!isCourseEnd && <MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} buttonText={'发表'} className={comments && comments.length && 'borderBottom'}></MemoDetailMDEditor>}
{/* onClick={ this.createNewComment }
enableReplyTo={true}
@ -704,6 +705,7 @@ class TopicDetail extends Component {
loadMoreChildComments={this.loadMoreChildComments}
initReply={this.initReply}
showRewardButton={false}
showReply={!isCourseEnd}
onlySuperAdminCouldHide={true}
></Comments>
@ -720,7 +722,7 @@ class TopicDetail extends Component {
{ total_count > REPLY_PAGE_COUNT &&
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
}
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
{!isCourseEnd && <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>}
</div>
</div>

@ -327,6 +327,7 @@ class Boards extends Component{
}
render(){
const isAdmin = this.props.isAdmin()
const isCourseEnd = this.props.isCourseEnd()
const isAdminOrStudent = this.props.isAdminOrStudent()
let { boardName, searchValue, boards, messages, checkBoxValues,
checkAllValue, pagination, sort_type, parent_id } = this.state;
@ -350,9 +351,9 @@ class Boards extends Component{
searchPlaceholder={ '请输入帖子名称进行搜索' }
firstRowRight={
<React.Fragment>
{ isAdmin && !parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加目录</WordsBtn> }
{ !isCourseEnd && isAdmin && !parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加目录</WordsBtn> }
{ isAdmin && !!parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>目录重命名</WordsBtn> }
{ isAdminOrStudent && <WordsBtn style="blue" className="" onClick={()=>this.onToBoardsNew()}>我要发贴</WordsBtn> }
{ !isCourseEnd && isAdminOrStudent && <WordsBtn style="blue" className="" onClick={()=>this.onToBoardsNew()}>我要发贴</WordsBtn> }
</React.Fragment>
}
secondRowLeft={

@ -426,7 +426,7 @@ class CoursesBanner extends Component {
render() {
let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state;
const isCourseEnd = this.props.isCourseEnd()
return (
<div>
{
@ -714,24 +714,24 @@ class CoursesBanner extends Component {
position: "relative"
}}
>
<li className={"mt7 mr10im"}>
{!isCourseEnd && <li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(true)}>
<span className="color-white fl font-16 bannerurli width100f">添加老师</span>
</a>
</li>
</li>}
<li className={"mt7 mr10im"}>
{!isCourseEnd && <li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}>
<span className="color-white fl font-16 bannerurli width100f">添加助教</span>
</a>
</li>
</li>}
<li className={"mt7 mr10im"}>
{!isCourseEnd && <li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}>
<span className={"color-white fl font-16 bannerurli width100f"}>添加学生</span>
</a>
</li>
</li>}
{excellent===false?
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}>
<a>

@ -497,6 +497,7 @@ class studentsList extends Component{
render(){
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
const isCourseEnd = this.props.isCourseEnd()
let {
page,
@ -591,7 +592,7 @@ class studentsList extends Component{
></CreateGroupByImportModal>
<WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn>
</React.Fragment> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
{ !isCourseEnd && isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
<style>{`

@ -244,6 +244,10 @@ export function TPMIndexHOC(WrappedComponent) {
return this.state.coursedata&&this.state.coursedata.course_identity >= 6
}
isCourseEnd = () => {
return this.state.current_user ? this.state.current_user.course_is_end : false
}
// setTrialapplication = ()=>{
// this.setState({
// isRenders:true
@ -411,6 +415,8 @@ export function TPMIndexHOC(WrappedComponent) {
isStudent: this.isStudent,
isAdminOrStudent: this.isAdminOrStudent,
isNotMember: this.isNotMember,
isCourseEnd: this.isCourseEnd,
isUserid:this.state.coursedata&&this.state.coursedata.userid,
fetchUser: this.fetchUser,

@ -15,7 +15,7 @@ import axios from 'axios';
import './css/TPMsettings.css';
import { getImageUrl, toPath, getUrl ,appendFileSizeToUploadFileAll} from 'educoder';
import { getImageUrl, toPath, getUrl ,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
let origin = getUrl();
@ -1372,15 +1372,18 @@ export default class TPMsettings extends Component {
})
}
handleChange = (info) => {
let {fileList}=this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1");
let {fileList}=this.state;
if(fileList.length===0){
// if(fileList.length===0){
let fileLists = info.fileList;
this.setState({ fileList:fileLists,
deleteisnot:false});
}
// }
}
}
@ -1497,10 +1500,13 @@ export default class TPMsettings extends Component {
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: (file) => {
beforeUpload: (file, fileList) => {
if (this.state.fileList.length >= 1) {
return false
}
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
if (!isLt150M) {

@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC';
import {SnackbarHOC,appendFileSizeToUploadFileAll} from 'educoder';
import {SnackbarHOC,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification,Tooltip} from 'antd';
@ -757,19 +757,19 @@ class Newshixuns extends Component {
})
}
// 附件相关 START
handleChange = (info) => {
let {fileList}=this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList}=this.state;
console.log("handleChange1");
if(fileList.length===0){
// if(fileList.length===0){
let fileLists = info.fileList;
this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList),
fileList:fileLists,
deleteisnot:false});
}
// }
}
}
@ -872,10 +872,14 @@ class Newshixuns extends Component {
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: (file) => {
beforeUpload: (file, fileList) => {
if (this.state.fileList.length >= 1) {
return false
}
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
if (!isLt150M) {

Loading…
Cancel
Save