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

dev_tpm_ui
杨树明 5 years ago
commit 0f7a2dbd63

@ -23,17 +23,21 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
Rails.logger.info("66666 #{params}")
if params[:client_key].present?
randomcode = params[:randomcode]
tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
Rails.logger.info("2222 #{sign}")
tip_exception(501, "请求不合理") if sign != params[:client_key]
else
tip_exception(501, "请求不合理")
end
# Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last
# suffix_arr = ["xls", "xlsx"] # excel文件先注释
# unless suffix_arr.include?(suffix)
# if params[:client_key].present?
# randomcode = params[:randomcode]
# tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
# sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
# Rails.logger.info("2222 #{sign}")
# tip_exception(501, "请求不合理") if sign != params[:client_key]
# else
# tip_exception(501, "请求不合理")
# end
# end
end
# 全局配置参数

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

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

@ -10,7 +10,7 @@ class Admins::ProfessionalAuths::AgreeApplyService < ApplicationService
ActiveRecord::Base.transaction do
apply.update!(status: 1)
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)
deal_tiding!

@ -46,12 +46,12 @@ class GotoQQgroup extends Component {
>
<div className="educouddiv intermediatecenter verticallayout">
<div className="tabeltext-alignleft mt10"><p>您可以在QQ服务群向管理员申请获得继续操作的权限</p></div>
<img className="mt10" src={getImageUrl("images/educoder/qqqun20191230.png")}/>
<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" onClick={()=>this.setDownload()}>立即联系</a>
<a className="task-btn task-btn-orange" target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">立即联系</a>
</div>
</div>
</Modal>

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

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

@ -656,7 +656,7 @@ submittojoinclass=(value)=>{
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===true){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.setgoshowqqgtounp(true);
return;
}
@ -924,8 +924,8 @@ submittojoinclass=(value)=>{
})
}
console.log("newHeadersnewHeaders");
console.log(this.props);
// console.log("newHeadersnewHeaders");
// console.log(this.props);
// this.props.current_user.is_shixun_marker
return (

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

@ -9,6 +9,7 @@ import { setImagesUrl } from 'educoder';
import "./usersInfo.css"
import Create from './publicCreatNew'
import GotoQQgroup from "../../../modal/GotoQQgroup";
class InfosShixun extends Component{
constructor(props){
@ -22,7 +23,8 @@ class InfosShixun extends Component{
sort_by: "updated_at",
sort_direction: "desc",
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);
}
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render(){
let{
@ -154,7 +163,8 @@ class InfosShixun extends Component{
data,
totalCount,
sort_direction,
isSpin
isSpin,
goshowqqgtounp
} = this.state;
let is_current=this.props.is_current;
@ -171,6 +181,12 @@ class InfosShixun extends Component{
);
return(
<div className="educontent">
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
<Spin size="large" spinning={isSpin}>
<style>
{
@ -368,7 +384,7 @@ class InfosShixun extends Component{
{/* 298 */}
{
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>

@ -1,58 +1,86 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css"
class publicCreateNew extends Component{
constructor(props){
super(props);
}
//头部获取是否已经登录了
getUser=(url)=> {
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("请先绑定邮箱,谢谢");
return
}
if(url !== undefined || url!==""){
window.location.href = url;
}
}
render() {
let {href,name,index}=this.props;
return (
<div className="square-Item" style={{"height":`${index=="1"?"289":index=="2"?"298":index=="3"?"295":"289"}px`}}>
<div className="substance substancepad">
{this.props.Createtype==="projects"?<a onClick={()=>this.getUser(href)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>: <a href={`${href}`}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>}
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
<span className="fl ml10 mr10 squareIconSpan substancefont">
{name}
</span>
</div>
</div>
</div>
)
}
}
export default publicCreateNew;
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC';
import GotoQQgroup from '../../../modal/GotoQQgroup';
import "./usersInfo.css"
class publicCreateNew extends Component{
constructor(props){
super(props);
this.state={
}
}
//头部获取是否已经登录了
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==="") {
this.props.showNotification("请先绑定邮箱,谢谢");
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!==""){
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() {
let {href,name,index}=this.props;
return (
<div className="square-Item" style={{"height":`${index=="1"?"289":index=="2"?"298":index=="3"?"295":"289"}px`}}>
<div className="substance substancepad">
{this.props.Createtype==="projects"?<a onClick={()=>this.getUser(href,name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>: <a onClick={()=>this.getUsers(href,name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>}
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
<span className="fl ml10 mr10 squareIconSpan substancefont">
{name}
</span>
</div>
</div>
</div>
)
}
}
export default publicCreateNew;

Loading…
Cancel
Save