Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_ec
cxt 5 years ago
commit 9e69d1292d

@ -33,7 +33,7 @@ class AccountsController < ApplicationController
uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}")
# check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
# todo 上线前请删除万能验证码"513231"
unless code == "513231" && request.subdomain == "pre-newweb"
unless code == "513231" && request.subdomain == "test-newweb"
return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
end

@ -355,7 +355,7 @@ class ApplicationController < ActionController::Base
# type 0 创始内容, 1 最新内容
def game_passed_code(path, myshixun, game_id)
# 如果代码窗口是隐藏的,则不用保存代码
return if myshixun.shixun.hide_code
return if myshixun.shixun.hide_code || myshixun.shixun.vnc
file_content = git_fle_content myshixun.repo_path, path
unless file_content.present?
raise("获取文件代码异常")

@ -116,6 +116,11 @@ class YslDetailCards extends Component{
}
Pathlisteditundefined=()=>{
this.setState({
pathlistedit:undefined
})
};
hidestartshixunsreplace=(url)=>{
this.setState({
isSpin:true,
@ -521,6 +526,7 @@ class YslDetailCards extends Component{
ysldetailcards={"ysldetailcards"}
pathid={subject_id}
coursesId={pathid}
Pathlisteditundefined={this.Pathlisteditundefined}
></DetailCardsEditAndEdit>
:""
}

@ -309,7 +309,13 @@ class DetailCards extends Component{
this.setState({
startshixunCombattype:false
})
}
};
Pathlisteditundefined=()=>{
this.setState({
pathlistedit:undefined
})
};
render(){
@ -502,19 +508,16 @@ class DetailCards extends Component{
</div>
</div>
}
<DetailCardsEditAndEdit
idsum={idsum}
keys={key}
pathCardsedittype={pathCardsedittype}
updatapathCardsedits={this.updatapathCardsedit}
pathlisteditlist={pathlistedit}
stageid={item.stage_id}
pathid={pathid}
></DetailCardsEditAndEdit>
<DetailCardsEditAndEdit
idsum={idsum}
keys={key}
pathCardsedittype={pathCardsedittype}
updatapathCardsedits={this.updatapathCardsedit}
pathlisteditlist={pathlistedit}
stageid={item.stage_id}
pathid={pathid}
Pathlisteditundefined={this.Pathlisteditundefined}
></DetailCardsEditAndEdit>
</div>
)
})

@ -93,22 +93,27 @@ class DetailCardsEditAndEdit extends Component{
})
}
componentDidMount(){
}
componentWillReceiveProps(nextProps, nextState) {
if(nextProps.pathlisteditlist!=undefined){
let list=[]
for(var i=0; i<nextProps.pathlisteditlist.shixuns_list.length; i++){
list.push(nextProps.pathlisteditlist.shixuns_list[i].shixun_id)
}
this.setState({
// console.log("DetailCardsEditAndEdit");
// console.log("componentWillReceiveProps(nextProps, nextState)");
// console.log("nextProps.pathlisteditlist.stage_description");
this.setState({
shixuns_listedit:nextProps.pathlisteditlist.shixuns_list,
shixuns_listeditlist:list,
stage_name:nextProps.pathlisteditlist.stage_name,
stage_description:nextProps.pathlisteditlist.stage_description,
stageid:nextProps.stageid
})
});
this.props.Pathlisteditundefined();
}
}
@ -123,7 +128,7 @@ class DetailCardsEditAndEdit extends Component{
}
updatastage_description=(e)=>{
//输入数据绑定
this.setState({
stage_description:e.target.value
})

@ -38,6 +38,7 @@ class TPMRepositoryComponent extends Component {
componentDidMount = () => {
this.nameTypeMap = {}
this.fetchRepo()
}
setContentWidth100 = (flag) => {
@ -108,7 +109,7 @@ class TPMRepositoryComponent extends Component {
if (!array || array.length === 0) {
return false
}
return this._isFileName( array[array.length - 1] )
return this.nameTypeMap[array[array.length - 1]] !== 'tree' && this._isFileName( array[array.length - 1] )
}
// listItem 如果是num则是通过面包屑点击过来的取pathArray的子集
fetchRepo = (listItem) => {
@ -117,7 +118,7 @@ class TPMRepositoryComponent extends Component {
if (listItem === 0 || listItem) {
this.setContentWidth100(false)
this.nameTypeMap[listItem.name] = listItem.type
if (typeof listItem == 'number') { // 参数是数字的话,做截取
// if (this._isFileName(newPathArray[listItem])) { // 面包屑中的文件不让点击了
// listItem--;
@ -137,7 +138,8 @@ class TPMRepositoryComponent extends Component {
let urlNewPathArray = newPathArray;
let fileInPathArray = false;
if (newPathArray.length) {
fileInPathArray = this._isFileName( newPathArray[newPathArray.length - 1] )
fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree'
: (listItem.type !== 'tree' && this._isFileName( newPathArray[newPathArray.length - 1] ))
if ( fileInPathArray ) {
urlNewPathArray = newPathArray.slice(0, newPathArray.length - 1)
}
@ -195,6 +197,7 @@ class TPMRepositoryComponent extends Component {
{ !isContentWidth100 ? <TPMRepository
{...this.props}
{...this.state}
nameTypeMap={this.nameTypeMap}
fetchRepo={this.fetchRepo}
>
</TPMRepository>
@ -208,7 +211,7 @@ class TPMRepositoryComponent extends Component {
{...this.props}
fetchRepo={this.fetchRepo}
saveCode={this.saveCode}
nameTypeMap={this.nameTypeMap}
></RepositoryCodeEditor>
</div>

@ -42,7 +42,7 @@ class RepositoryDirectories extends Component {
// /shixuns/3ozvy5f8/repository/3ozvy5f8/master/shixun_show/src
return (
<React.Fragment>
{ item.indexOf('.') === -1
{ this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1
? <a
onClick={() => fetchRepo(index + 1)}
className="color-blue">

Loading…
Cancel
Save