Merge branch 'dev_aliyun' into develop

dev_daiao
daiao 5 years ago
commit 8a2b409bf4

@ -10,6 +10,7 @@ class Admins::BaseController < ApplicationController
before_action :require_login, :require_admin! before_action :require_login, :require_admin!
after_action :rebind_event_if_ajax_render_partial after_action :rebind_event_if_ajax_render_partial
skip_before_action :check_sign
private private

@ -61,7 +61,7 @@ class Admins::UsersController < Admins::BaseController
private private
def update_params def update_params
params.require(:user).permit(%i[lastname nickname gender identity technical_title student_id params.require(:user).permit(%i[lastname nickname gender identity technical_title student_id is_shixun_marker
mail phone location location_city school_id department_id admin business is_test mail phone location location_city school_id department_id admin business is_test
password professional_certification authentication]) password professional_certification authentication])
end end

@ -23,17 +23,21 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名 # 所有请求必须合法签名
def check_sign def check_sign
Rails.logger.info("66666 #{params}") # Rails.logger.info("66666 #{params}")
if params[:client_key].present? # suffix = request.url.split(".").last
Rails.logger.info("111111 #{params[:client_key]}") # suffix_arr = ["xls", "xlsx"] # excel文件先注释
Rails.logger.info("00000 #{params[:timestamp]}") # unless suffix_arr.include?(suffix)
timestamp = params[:timestamp] # if params[:client_key].present?
sign = Digest::MD5.hexdigest("#{OPENKEY}#{timestamp}") # randomcode = params[:randomcode]
Rails.logger.info("2222 #{sign}") # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
tip_exception(501, "请求不合理") if sign != params[:client_key] #
else # sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
tip_exception(501, "请求不合理") # Rails.logger.info("2222 #{sign}")
end # tip_exception(501, "请求不合理") if sign != params[:client_key]
# else
# tip_exception(501, "请求不合理")
# end
# end
end end
# 全局配置参数 # 全局配置参数
@ -42,6 +46,12 @@ class ApplicationController < ActionController::Base
EduSetting.get(name) EduSetting.get(name)
end end
def shixun_marker
unless current_user.is_shixun_marker? || current_user.admin_or_business?
tip_exception(403, "..")
end
end
# 实训的访问权限 # 实训的访问权限
def shixun_access_allowed def shixun_access_allowed
if !current_user.shixun_permission(@shixun) if !current_user.shixun_permission(@shixun)

@ -5,6 +5,7 @@ class AttachmentsController < ApplicationController
before_action :require_login, :check_auth, except: [:show] before_action :require_login, :check_auth, except: [:show]
before_action :find_file, only: %i[show destroy] before_action :find_file, only: %i[show destroy]
before_action :attachment_candown, only: [:show] before_action :attachment_candown, only: [:show]
skip_before_action :check_sign, only: [:show, :create]
include ApplicationHelper include ApplicationHelper

@ -1,4 +1,6 @@
class DepartmentsController < ApplicationController class DepartmentsController < ApplicationController
skip_before_action :check_sign
def for_option def for_option
render_ok(departments: current_school.departments.without_deleted.select(:id, :name).as_json) render_ok(departments: current_school.departments.without_deleted.select(:id, :name).as_json)
end end

@ -1,6 +1,10 @@
class MainController < ApplicationController class MainController < ApplicationController
skip_before_action :check_sign skip_before_action :check_sign
def first_stamp
render :json => { status: 0, message: Time.now.to_i }
end
def index def index
render file: 'public/react/build/index.html', :layout => false render file: 'public/react/build/index.html', :layout => false
end end

@ -1,4 +1,5 @@
class SchoolsController < ApplicationController class SchoolsController < ApplicationController
skip_before_action :check_sign
def school_list def school_list
schools = School.all schools = School.all

@ -24,6 +24,7 @@ class ShixunsController < ApplicationController
before_action :portion_allowed, only: [:copy] before_action :portion_allowed, only: [:copy]
before_action :special_allowed, only: [:send_to_course, :search_user_courses] before_action :special_allowed, only: [:send_to_course, :search_user_courses]
before_action :shixun_marker, only: [:new, :create]
## 获取课程列表 ## 获取课程列表
def index def index
@ -1151,4 +1152,5 @@ private
end end
md5.hexdigest md5.hexdigest
end end
end end

@ -7,6 +7,8 @@ class SubjectsController < ApplicationController
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report, :search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
:up_member_position, :down_member_position, :update_team_title] :up_member_position, :down_member_position, :update_team_title]
before_action :require_admin, only: [:copy_subject] before_action :require_admin, only: [:copy_subject]
before_action :shixun_marker, only: [:new, :create, :add_shixun_to_stage]
include ApplicationHelper include ApplicationHelper
include SubjectsHelper include SubjectsHelper

@ -10,7 +10,6 @@ class Admins::IdentityAuths::AgreeApplyService < ApplicationService
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
apply.update!(status: 1) apply.update!(status: 1)
user.update!(authentication: true) user.update!(authentication: true)
RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500) RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500)
deal_tiding! deal_tiding!

@ -10,7 +10,7 @@ class Admins::ProfessionalAuths::AgreeApplyService < ApplicationService
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
apply.update!(status: 1) apply.update!(status: 1)
user.update!(professional_certification: true) user.update!(professional_certification: true)
user.update!(is_shixun_marker: true) if user.is_teacher?
RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500) RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500)
deal_tiding! deal_tiding!

@ -25,6 +25,7 @@ class Admins::UpdateUserService < ApplicationService
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
user.save! user.save!
user.user_extension.save! user.user_extension.save!
user.update!(is_shixun_marker: true) if user.is_certification_teacher
update_gitlab_password if params[:password].present? update_gitlab_password if params[:password].present?
end end
@ -36,7 +37,7 @@ class Admins::UpdateUserService < ApplicationService
def user_attributes def user_attributes
params.slice(*%i[lastname nickname mail phone admin business is_test params.slice(*%i[lastname nickname mail phone admin business is_test
professional_certification authentication]) professional_certification authentication is_shixun_marker])
end end
def user_extension_attributes def user_extension_attributes

@ -120,6 +120,7 @@
<div class="d-flex"> <div class="d-flex">
<%= f.input :professional_certification, as: :boolean, label: '职业认证', checked_value: 1, unchecked_value: 0 %> <%= f.input :professional_certification, as: :boolean, label: '职业认证', checked_value: 1, unchecked_value: 0 %>
<%= f.input :authentication, as: :boolean, label: '实名认证', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %> <%= f.input :authentication, as: :boolean, label: '实名认证', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %>
<%= f.input :is_shixun_marker, as: :boolean, label: '实训制作', wrapper_html: { class: 'ml-3' }, checked_value: 1, unchecked_value: 0 %>
</div> </div>
</div> </div>

@ -14,6 +14,7 @@ json.email @user.mail
json.profile_completed @user.profile_completed? json.profile_completed @user.profile_completed?
json.professional_certification @user.professional_certification json.professional_certification @user.professional_certification
json.main_site current_laboratory.main_site? json.main_site current_laboratory.main_site?
json.is_shixun_marker current_user.is_shixun_marker? || current_user.admin_or_business?
if @course if @course
json.course_identity @course_identity json.course_identity @course_identity
json.course_name @course.name json.course_name @course.name

@ -15,6 +15,7 @@ Rails.application.routes.draw do
scope '/api' do scope '/api' do
get 'home/index' get 'home/index'
get 'home/search' get 'home/search'
get 'main/first_stamp'
get 'search', to: 'searchs#index' get 'search', to: 'searchs#index'
@ -1336,6 +1337,7 @@ Rails.application.routes.draw do
root 'main#index' root 'main#index'
## react用 ## react用
get '*path', to: 'main#index', constraints: ReactConstraint.new get '*path', to: 'main#index', constraints: ReactConstraint.new
end end

@ -0,0 +1,9 @@
class AddIsShixunMarkerForUsers < ActiveRecord::Migration[5.2]
def change
add_column :users, :is_shixun_marker, :boolean, :default => false
User.joins(:user_extension)
.where(users: {professional_certification: 1}, user_extensions: {identity: 0})
.update_all(is_shixun_marker: 1)
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

@ -6,9 +6,10 @@ import { requestProxy } from "./indexEduplus2RequestProxy";
import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder'; import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder';
import { notification } from 'antd'; import { notification } from 'antd';
import './index.css'; import './index.css';
const $ = window.$;
const opens ="79e33abd4b6588941ab7622aed1e67e8"; const opens ="79e33abd4b6588941ab7622aed1e67e8";
let timestamp = Date.parse(new Date()); let timestamp;
const newopens=md5(opens+timestamp) let checkSubmitFlg = false;
broadcastChannelOnmessage('refreshPage', () => { broadcastChannelOnmessage('refreshPage', () => {
window.location.reload() window.location.reload()
}) })
@ -20,7 +21,7 @@ function locationurl(list){
window.location.href=list window.location.href=list
} }
} }
let hashTimeout
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
let debugType ="" let debugType =""
@ -40,7 +41,29 @@ if (isDev) {
//ebugType="teacher"; //ebugType="teacher";
// 学生 // 学生
//debugType="student"; //debugType="student";
function railsgettimes(proxy) {
if(timestamp&&checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
timestamp=data.message;
}
}})
checkSubmitFlg=true
window.setTimeout(function () {
checkSubmitFlg=false;
}, 3500);
}else if(checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
timestamp=data.message;
}
}})
checkSubmitFlg=true
window.setTimeout(function () {
checkSubmitFlg=false;
}, 3500);
}
}
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {
initOnlineOfflineListener() initOnlineOfflineListener()
@ -66,6 +89,7 @@ export function initAxiosInterceptors(props) {
window.setfalseInRequestMap = function(keyName) { window.setfalseInRequestMap = function(keyName) {
requestMap[keyName] = false; requestMap[keyName] = false;
} }
axios.interceptors.request.use( axios.interceptors.request.use(
config => { config => {
@ -95,19 +119,23 @@ export function initAxiosInterceptors(props) {
} }
if(`${config[0]}`!=`true`){ if(`${config[0]}`!=`true`){
if (window.location.port === "3007") { if (window.location.port === "3007") {
railsgettimes(`${proxy}/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`; config.url = `${proxy}${url}`;
if (config.url.indexOf('?') == -1) { if (config.url.indexOf('?') == -1) {
config.url = `${config.url}?debug=${debugType}&timestamp=${timestamp}&client_key=${newopens}`; config.url = `${config.url}?debug=${debugType}&randomcode=${timestamp}&client_key=${newopens}`;
} else { } else {
config.url = `${config.url}&debug=${debugType}&timestamp=${timestamp}&client_key=${newopens}`; config.url = `${config.url}&debug=${debugType}&randomcode=${timestamp}&client_key=${newopens}`;
} }
} else { } else {
// 加api前缀 // 加api前缀
railsgettimes(`/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = url; config.url = url;
if (config.url.indexOf('?') == -1) { if (config.url.indexOf('?') == -1) {
config.url = `${config.url}?&timestamp=${timestamp}&client_key=${newopens}`; config.url = `${config.url}?&randomcode=${timestamp}&client_key=${newopens}`;
} else { } else {
config.url = `${config.url}&timestamp=${timestamp}&client_key=${newopens}`; config.url = `${config.url}&randomcode=${timestamp}&client_key=${newopens}`;
} }
} }
} }

@ -0,0 +1,62 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import '../modules/user/account/common.css';
import './gotoqqgroup.css'
class GotoQQgroup extends Component {
constructor(props) {
super(props);
this.state={
}
}
modalCancel=()=>{
try {
this.props.setgoshowqqgtounp(false);
}catch (e) {
}
}
setDownload=()=>{
//立即联系
try {
this.props.setgoshowqqgtounp(false);
}catch (e) {
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.goshowqqgtounp===undefined?false:this.props.goshowqqgtounp}
width="530px"
>
<div className="educouddiv intermediatecenter verticallayout">
<div className="tabeltext-alignleft mt10"><p>您可以在QQ服务群向管理员申请获得继续操作的权限</p></div>
<img width={"200px"} className="mt10" src={getImageUrl("images/educoder/qqqun20191230.png")}/>
<div className="tabeltext-alignleft mt10"><p>群号612934990</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">立即联系</a>
</div>
</div>
</Modal>
)
}
}
export default GotoQQgroup;

@ -0,0 +1,61 @@
/* 中间居中 */
.intermediatecenter{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* 简单居中 */
.intermediatecenterysls{
display: flex;
align-items: center;
}
.spacearound{
display: flex;
justify-content: space-around;
}
.spacebetween{
display: flex;
justify-content: space-between;
}
/* 头顶部居中 */
.topcenter{
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
/* x轴正方向排序 */
/* 一 二 三 四 五 六 七 八 */
.sortinxdirection{
display: flex;
flex-direction:row;
}
/* x轴反方向排序 */
/* 八 七 六 五 四 三 二 一 */
.xaxisreverseorder{
display: flex;
flex-direction:row-reverse;
}
/* 垂直布局 正方向*/
/*
*/
.verticallayout{
display: flex;
flex-direction:column;
}
/* 垂直布局 反方向*/
.reversedirection{
display: flex;
flex-direction:column-reverse;
}

@ -31,13 +31,15 @@ class ShixunsHome extends Component {
} }
} }
componentDidMount(){ componentDidMount(){
configShareForIndex() configShareForIndex()
const upsystem=`/users/system_update.json`; const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; if(response.data){
this.setState({ let updata=response.data;
updata:updata this.setState({
}) updata:updata
})
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
@ -50,7 +52,7 @@ class ShixunsHome extends Component {
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) // console.log(error)
}); });
} }

@ -7,6 +7,8 @@ import Addshixuns from './Addshixuns';
import '../ShixunPaths.css'; import '../ShixunPaths.css';
import axios from 'axios'; import axios from 'axios';
import NewShixunModel from '../../courses/coursesPublic/NewShixunModel'; import NewShixunModel from '../../courses/coursesPublic/NewShixunModel';
import GotoQQgroup from "../../../modal/GotoQQgroup";
const $ = window.$; const $ = window.$;
const Search = Input.Search; const Search = Input.Search;
@ -54,8 +56,10 @@ class DetailCardsEditAndAdd extends Component{
ChooseShixunListshixun_list:undefined, ChooseShixunListshixun_list:undefined,
stage_nametype:false, stage_nametype:false,
descriptiontype:false, descriptiontype:false,
Addshixunstype:false Addshixunstype:false,
} goshowqqgtounp:false,
}
this.onDragEnd = this.onDragEnd.bind(this); this.onDragEnd = this.onDragEnd.bind(this);
} }
//选择实训弹框 //选择实训弹框
@ -315,6 +319,12 @@ class DetailCardsEditAndAdd extends Component{
} }
Addshixuns=()=>{ Addshixuns=()=>{
// debugger
// console.log("点击了新建实训Addshixuns");
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.setgoshowqqgtounp(true);
return;
}
this.setState({ this.setState({
Addshixunstype:true, Addshixunstype:true,
}) })
@ -349,7 +359,12 @@ class DetailCardsEditAndAdd extends Component{
console.log(error) console.log(error)
}); });
} }
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render(){ render(){
let {selectShixun, let {selectShixun,
@ -368,11 +383,19 @@ class DetailCardsEditAndAdd extends Component{
Modalsbottomval, Modalsbottomval,
ChooseShixunListshixun_list, ChooseShixunListshixun_list,
stage_nametype, stage_nametype,
descriptiontype} = this.state descriptiontype,
goshowqqgtounp
} = this.state
return( return(
<div> <div>
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}

@ -5,6 +5,8 @@ import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import Addshixuns from './Addshixuns'; import Addshixuns from './Addshixuns';
import NewShixunModel from '../../courses/coursesPublic/NewShixunModel'; import NewShixunModel from '../../courses/coursesPublic/NewShixunModel';
import GotoQQgroup from "../../../modal/GotoQQgroup";
import '../ShixunPaths.css'; import '../ShixunPaths.css';
import axios from 'axios'; import axios from 'axios';
const $ = window.$; const $ = window.$;
@ -56,7 +58,8 @@ class DetailCardsEditAndEdit extends Component{
ChooseShixunListshixun_list:undefined, ChooseShixunListshixun_list:undefined,
stage_nametype:false, stage_nametype:false,
descriptiontype:false, descriptiontype:false,
Addshixunstype:false Addshixunstype:false,
goshowqqgtounp:false,
} }
this.onDragEnd = this.onDragEnd.bind(this); this.onDragEnd = this.onDragEnd.bind(this);
} }
@ -77,6 +80,10 @@ class DetailCardsEditAndEdit extends Component{
} }
Addshixuns=()=>{ Addshixuns=()=>{
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.setgoshowqqgtounp(true);
return;
}
this.setState({ this.setState({
Addshixunstype:true, Addshixunstype:true,
}) })
@ -349,7 +356,12 @@ class DetailCardsEditAndEdit extends Component{
console.log(error) console.log(error)
}); });
} }
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render(){ render(){
let {selectShixun, let {selectShixun,
@ -369,11 +381,18 @@ class DetailCardsEditAndEdit extends Component{
delectfunvalue, delectfunvalue,
ChooseShixunListshixun_list, ChooseShixunListshixun_list,
stage_nametype, stage_nametype,
descriptiontype descriptiontype,
goshowqqgtounp
} = this.state } = this.state
return( return(
<div> <div>
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}

@ -19,7 +19,9 @@ import Addcourses from '../courses/coursesPublic/Addcourses';
import LoginDialog from '../login/LoginDialog'; import LoginDialog from '../login/LoginDialog';
import Trialapplication from '../login/Trialapplication' import Trialapplication from '../login/Trialapplication';
import GotoQQgroup from '../../modal/GotoQQgroup'
import 'antd/lib/modal/style/index.css'; import 'antd/lib/modal/style/index.css';
@ -31,6 +33,8 @@ import 'antd/lib/input/style/index.css';
import './TPMIndex.css'; import './TPMIndex.css';
const $ = window.$ const $ = window.$
// TODO 这部分脚本从公共脚本中直接调用 // TODO 这部分脚本从公共脚本中直接调用
@ -69,6 +73,7 @@ class NewHeader extends Component {
headtypesonClickbool:false, headtypesonClickbool:false,
headtypess:"/", headtypess:"/",
mygetHelmetapi2: null, mygetHelmetapi2: null,
goshowqqgtounp:false,
} }
console.log("176") console.log("176")
// console.log(props); // console.log(props);
@ -649,6 +654,18 @@ submittojoinclass=(value)=>{
return; return;
} }
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.setgoshowqqgtounp(true);
return;
}
if(url !== undefined || url!==""){ if(url !== undefined || url!==""){
window.location.href = url; window.location.href = url;
} }
@ -790,6 +807,14 @@ submittojoinclass=(value)=>{
return false return false
} }
} }
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render() { render() {
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
const {match} = this.props; const {match} = this.props;
@ -808,6 +833,7 @@ submittojoinclass=(value)=>{
headtypesonClickbool, headtypesonClickbool,
headtypess, headtypess,
mygetHelmetapi2, mygetHelmetapi2,
goshowqqgtounp,
}=this.state; }=this.state;
/* /*
用户名称 用户头像url 用户名称 用户头像url
@ -898,7 +924,9 @@ submittojoinclass=(value)=>{
}) })
} }
// console.log("newHeadersnewHeaders");
// console.log(this.props);
// this.props.current_user.is_shixun_marker
return ( return (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
@ -914,6 +942,14 @@ submittojoinclass=(value)=>{
{...this.props} {...this.props}
{...this.state} {...this.state}
/>:""} />:""}
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
<a href={"/"} onClick={()=>this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}> <a href={"/"} onClick={()=>this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}>
{ {
mygetHelmetapi2 === null ? mygetHelmetapi2 === null ?
@ -1100,9 +1136,6 @@ submittojoinclass=(value)=>{
{/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*/} {/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*/}
<Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link> <Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link>
</li> </li>
{}
{console.log(activeShixuns)}
<li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}> <li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>
<Link to="/shixuns">实训项目</Link> <Link to="/shixuns">实训项目</Link>
{/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/} {/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}
@ -1287,7 +1320,9 @@ submittojoinclass=(value)=>{
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":coursestypes===false? {this.props.current_user&&this.props.current_user.user_identity==="学生"?"":coursestypes===false?
<li><a onClick={(url)=>this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}</a></li>:"" <li><a onClick={(url)=>this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}</a></li>:""
} }
{shixuntype===true?"":<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>} {shixuntype===true?"":
<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>
}
{this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>} {this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>}
{this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"": {this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"":
pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>:"" pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>:""

@ -12,6 +12,7 @@ import classNames from 'classnames'
import 'antd/lib/switch/style/index.css' import 'antd/lib/switch/style/index.css'
import './shixunCss/ShixunCardList.css'; import './shixunCss/ShixunCardList.css';
import GotoQQgroup from '../../../modal/GotoQQgroup'
import { on, off } from 'educoder' import { on, off } from 'educoder'
@ -33,6 +34,7 @@ class ShixunCardList extends Component {
shixunid:"", shixunid:"",
upcircle:false, upcircle:false,
typekeyid:undefined, typekeyid:undefined,
goshowqqgtounp:false,
} }
} }
@ -171,6 +173,10 @@ class ShixunCardList extends Component {
this.props.showProfileCompleteDialog() this.props.showProfileCompleteDialog()
return return
} }
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.setgoshowqqgtounp(true);
return;
}
if(url !== undefined || url!==""){ if(url !== undefined || url!==""){
window.location.href = url; window.location.href = url;
@ -178,8 +184,15 @@ class ShixunCardList extends Component {
} }
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render(){ render(){
let {mine,InputValue,upcircle}=this.state; let {mine,InputValue,upcircle,goshowqqgtounp}=this.state;
// console.log("NewHeadermygetHelmetapi123123123123"); // console.log("NewHeadermygetHelmetapi123123123123");
let shixuntype=false; let shixuntype=false;
@ -196,10 +209,19 @@ class ShixunCardList extends Component {
} }
}) })
} }
return ( return (
<div className="educontent mt20"> <div className="educontent mt20">
<div className="clearfix"> <div className="clearfix">
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
{/*<div className="fl mr20 font-16 bestChoose shixun_repertoire active"*/} {/*<div className="fl mr20 font-16 bestChoose shixun_repertoire active"*/}
{/*id={"all"}*/} {/*id={"all"}*/}
{/*onClick={(e)=>this.latestHot(e,1)}>全部*/} {/*onClick={(e)=>this.latestHot(e,1)}>全部*/}

@ -116,3 +116,4 @@ button.ant-btn.ant-btn-primary.grayBtn {
overflow-y: auto; overflow-y: auto;
} }
} }

@ -9,6 +9,7 @@ import { setImagesUrl } from 'educoder';
import "./usersInfo.css" import "./usersInfo.css"
import Create from './publicCreatNew' import Create from './publicCreatNew'
import GotoQQgroup from "../../../modal/GotoQQgroup";
class InfosShixun extends Component{ class InfosShixun extends Component{
constructor(props){ constructor(props){
@ -22,7 +23,8 @@ class InfosShixun extends Component{
sort_by: "updated_at", sort_by: "updated_at",
sort_direction: "desc", sort_direction: "desc",
totalCount:undefined, totalCount:undefined,
data:undefined data:undefined,
goshowqqgtounp:false,
} }
} }
@ -144,6 +146,13 @@ class InfosShixun extends Component{
this.getCourses(category, status, sort_by, page, sort_directiony); this.getCourses(category, status, sort_by, page, sort_directiony);
} }
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render(){ render(){
let{ let{
@ -154,7 +163,8 @@ class InfosShixun extends Component{
data, data,
totalCount, totalCount,
sort_direction, sort_direction,
isSpin isSpin,
goshowqqgtounp
} = this.state; } = this.state;
let is_current=this.props.is_current; let is_current=this.props.is_current;
@ -171,6 +181,12 @@ class InfosShixun extends Component{
); );
return( return(
<div className="educontent"> <div className="educontent">
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
<Spin size="large" spinning={isSpin}> <Spin size="large" spinning={isSpin}>
<style> <style>
{ {
@ -368,7 +384,7 @@ class InfosShixun extends Component{
{/* 298 */} {/* 298 */}
{ {
page == 1 && is_current && !category ? page == 1 && is_current && !category ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:"" <Create href={"/shixuns/new"} name={"新建实训"} index="2" {...this.props} {...this.state} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></Create>:""
} }
{ {
(!data || (data && data.shixuns.length==0)) && category && <NoneData></NoneData> (!data || (data && data.shixuns.length==0)) && category && <NoneData></NoneData>

@ -7,37 +7,65 @@ import Loading from '../../../Loading';
import axios from 'axios'; import axios from 'axios';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC' import { CNotificationHOC } from '../../courses/common/CNotificationHOC';
import GotoQQgroup from '../../../modal/GotoQQgroup';
import "./usersInfo.css" import "./usersInfo.css"
class publicCreateNew extends Component{ class publicCreateNew extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={
}
} }
//头部获取是否已经登录了 //头部获取是否已经登录了
getUser=(url)=> { getUser=(url,name)=> {
if (this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email==="") { if (this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email==="") {
this.props.showNotification("请先绑定邮箱,谢谢"); this.props.showNotification("请先绑定邮箱,谢谢");
return return
} }
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.props.setgoshowqqgtounp(true);
return;
}
}
if(url !== undefined || url!==""){ if(url !== undefined || url!==""){
window.location.href = url; window.location.href = url;
} }
} }
getUsers=(url,name)=> {
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.props.setgoshowqqgtounp(true);
return;
}
}
if(url !== undefined || url!==""){
window.location.href = url;
}
}
render() { render() {
let {href,name,index}=this.props; let {href,name,index}=this.props;
return ( return (
<div className="square-Item" style={{"height":`${index=="1"?"289":index=="2"?"298":index=="3"?"295":"289"}px`}}> <div className="square-Item" style={{"height":`${index=="1"?"289":index=="2"?"298":index=="3"?"295":"289"}px`}}>
<div className="substance substancepad"> <div className="substance substancepad">
{this.props.Createtype==="projects"?<a onClick={()=>this.getUser(href)}> {this.props.Createtype==="projects"?<a onClick={()=>this.getUser(href,name)}>
<div className="substancenenew"> <div className="substancenenew">
<div className="leftten"></div> <div className="leftten"></div>
<div className="topten"></div> <div className="topten"></div>
</div> </div>
</a>: <a href={`${href}`}> </a>: <a onClick={()=>this.getUsers(href,name)}>
<div className="substancenenew"> <div className="substancenenew">
<div className="leftten"></div> <div className="leftten"></div>
<div className="topten"></div> <div className="topten"></div>

Loading…
Cancel
Save