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

dev_hss
caicai8 6 years ago
commit e3cc889db8

@ -47,7 +47,7 @@ class ApplicationController < ActionController::Base
# 题库的访问权限
def bank_visit_auth
tip_exception("未通过职业认证") if current_user.is_teacher? && !current_user.certification_teacher? && !current_user.admin? && @bank.user_id != current_user.id && @bank.is_public
tip_exception(-2,"未通过职业认证") if current_user.is_teacher? && !current_user.certification_teacher? && !current_user.admin? && @bank.user_id != current_user.id && @bank.is_public
tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? ||
(current_user.certification_teacher? && @bank.is_public)
end

@ -65,7 +65,7 @@ class Users::QuestionBanksController < Users::BaseController
def check_user_permission!
if params[:type] == 'publicly'
render_error("未通过职业认证") unless User.current.admin? || User.current.certification_teacher?
normal_status(-2,"未通过职业认证") unless User.current.admin? || User.current.certification_teacher?
else
render_forbidden unless User.current.admin? || User.current.is_teacher?
end

@ -21,16 +21,16 @@ let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
if (isDev) {
const _search = window.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
}
// if (isDev) {
// const _search = window.location.search;
// let parsed = {};
// if (_search) {
// parsed = queryString.parse(_search);
// }
// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
// window.location.search.indexOf('debug=s') != -1 ? 'student' :
// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
// }
window._debugType = debugType;
export function initAxiosInterceptors(props) {

@ -74,7 +74,7 @@ class InfosTopics extends Component{
isSpin:true
})
let types=this.props.match.params.topicstype;
let user_id=undefined;
let user_id="";
if(types==="publicly"){
user_id=this.props.current_user&&this.props.current_user.login;
@ -82,8 +82,10 @@ class InfosTopics extends Component{
user_id=this.props.match.params&&this.props.match.params.username;
}
if(user_id!=undefined){
if(user_id===undefined){
user_id=this.props.match.params&&this.props.match.params.username;
}
let {per_page}=this.state;
let url=`/users/${user_id}/question_banks.json`;
@ -107,11 +109,7 @@ class InfosTopics extends Component{
isSpin:false
})
});
}else{
this.setState({
isSpin:false
})
}
}
searchCategory=(type)=>{

Loading…
Cancel
Save