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

dev_ec
cxt 6 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}") 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) # check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
# todo 上线前请删除万能验证码"513231" # 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.try(:code) != code.strip
return normal_status(-2, "验证码已失效") if !verifi_code&.effective? return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
end end

@ -355,7 +355,7 @@ class ApplicationController < ActionController::Base
# type 0 创始内容, 1 最新内容 # type 0 创始内容, 1 最新内容
def game_passed_code(path, myshixun, game_id) 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 file_content = git_fle_content myshixun.repo_path, path
unless file_content.present? unless file_content.present?
raise("获取文件代码异常") raise("获取文件代码异常")

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

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

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

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

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

Loading…
Cancel
Save