Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
Conflicts: app/views/users/_reply_to.html.erb
This commit is contained in:
commit
0611ddcc43
|
@ -8,18 +8,7 @@ class WechatsController < ActionController::Base
|
|||
# default text responder when no other match
|
||||
on :text do |request, content|
|
||||
#邀请码
|
||||
begin
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
if !uw
|
||||
return sendBind()
|
||||
else
|
||||
return join_class({invite_code: content}, uw.user)
|
||||
end
|
||||
rescue => e
|
||||
logger.error e.inspect
|
||||
logger.error e.backtrace.join("\n")
|
||||
return request.reply.text e
|
||||
end
|
||||
sendBindClass(request, {invite_code: content})
|
||||
end
|
||||
|
||||
# When receive 'help', will trigger this responder
|
||||
|
@ -48,24 +37,13 @@ class WechatsController < ActionController::Base
|
|||
|
||||
# When subscribe user scan scene_id in public account
|
||||
on :scan, with: 'scene_id' do |request, ticket|
|
||||
begin
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
if !uw
|
||||
return sendBind()
|
||||
else
|
||||
return join_class({ticket: ticket}, uw.user)
|
||||
end
|
||||
rescue => e
|
||||
logger.error e.inspect
|
||||
logger.error e.backtrace.join("\n")
|
||||
return request.reply.text e
|
||||
end
|
||||
sendBindClass(request, {ticket: ticket})
|
||||
end
|
||||
|
||||
# When no any on :scan responder can match subscribe user scaned scene_id
|
||||
on :event, with: 'scan' do |request|
|
||||
if request[:EventKey].present?
|
||||
request.reply.text "event scan got EventKey #{request[:EventKey]} Ticket #{request[:Ticket]}"
|
||||
sendBindClass(request, {ticket: request[:Ticket]})
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -161,6 +139,22 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
def sendBindClass(request, params)
|
||||
begin
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
if !uw
|
||||
return sendBind(request)
|
||||
else
|
||||
return join_class(params, uw.user, request)
|
||||
end
|
||||
rescue => e
|
||||
logger.error e.inspect
|
||||
logger.error e.backtrace.join("\n")
|
||||
return request.reply.text e
|
||||
end
|
||||
end
|
||||
|
||||
def default_msg(request)
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
if uw && uw.user
|
||||
|
@ -187,20 +181,19 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
def join_class(params, user)
|
||||
def join_class(params, user, request)
|
||||
course = nil
|
||||
course = Course.where(qrcode: params[:ticket]) if params[:ticket]
|
||||
course = Course.where(invite_code: params[:invite_code]) if params[:invite_code]
|
||||
raise "课程不存在" if course.blank?
|
||||
course = Course.where(qrcode: params[:ticket]).first if params[:ticket]
|
||||
course = Course.where(invite_code: params[:invite_code]).first if params[:invite_code]
|
||||
raise "课程不存在" unless course
|
||||
|
||||
cs = CoursesService.new
|
||||
status = cs.join_course(course.invite_code, user)
|
||||
status = cs.join_course({invite_code: course.invite_code}, user)
|
||||
logger.info status
|
||||
if status[:state] != 0
|
||||
raise CoursesService::JoinCourseError.message(status[:state])
|
||||
end
|
||||
|
||||
course = status[:course]
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
|
||||
content: "课程名称: #{course.name}\n班级名称: #{course.name}\n任课老师: #{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||
return request.reply.news(news) do |article, n, index| # article is return object
|
||||
|
|
|
@ -351,7 +351,7 @@ class CoursesService
|
|||
#如果加入角色为教师或者教辅,并且当前是学生,或者是要成为教辅,当前不是教辅,或者要成为教师,当前不是教师。那么要发送请求
|
||||
elsif (params[:role] != "10" && roleName == "Student") || (params[:role] == "7" && roleName != "TeachingAsistant" ) || (params[:role] == "9" && roleName != "Teacher" )
|
||||
#如果已经发送过消息了,那么就要给个提示
|
||||
if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and content = #{params[:role]} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0 ").count != 0
|
||||
if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0 ").count != 0
|
||||
@state = 7
|
||||
else
|
||||
Mailer.run.join_course_request(course, User.current, params[:role])
|
||||
|
|
|
@ -112,7 +112,8 @@
|
|||
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%>
|
||||
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
|
||||
<%# if @organization.secdomain_name.nil? %>
|
||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{url_for(:controller => 'organizations', :action => 'org_member_autocomplete', :org=> @organization.id)}')" %>
|
||||
<%# else %>
|
||||
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||
<%# end %>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
|
||||
<div class="<%= User.current.logged? ? 'orig_reply_box' : 'orig_reply_box2' %> borderBottomNone" id="reply_to_message_<%= reply.id%>">
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="orig_textarea mb10 fl">
|
||||
<div nhname='new_message_<%= reply.id%>'>
|
||||
|
||||
<% if @type == 'HomeworkCommon' %>
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'reply_to_homework', :id => reply.id},:method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="is_in_course" value=<%=@is_in_course %>>
|
||||
|
@ -29,6 +31,7 @@
|
|||
<div class="cl"></div>
|
||||
<% end%>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged_reply" %>
|
||||
|
|
|
@ -28,27 +28,27 @@
|
|||
|
||||
<script src="https://dn-demotest.qbox.me/angular.all.min.js"></script>
|
||||
<!--<script src="/javascripts/wechat/build/angular.all.min.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/build/app.min.js"></script>-->
|
||||
<script src="/javascripts/wechat/app.js"></script>
|
||||
<script src="/javascripts/wechat/others/factory.js"></script>
|
||||
<script src="/javascripts/wechat/others/filter.js"></script>
|
||||
<script src="/javascripts/wechat/directives/alert.js"></script>
|
||||
<script src="/javascripts/wechat/directives/form_validate.js"></script>
|
||||
<script src="/javascripts/wechat/directives/input_auto.js"></script>
|
||||
<script src="/javascripts/wechat/directives/loading_spinner.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/reg.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/invite_code.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/login.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/activity.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/add_class.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/blog.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/course_notice.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/discussion.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/homework.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/issue.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/journals.js"></script>
|
||||
<script src="/javascripts/wechat/controllers/myclass.js"></script>
|
||||
<script src="/javascripts/wechat/others/routes.js"></script>
|
||||
<script src="/javascripts/wechat/build/app.min.js"></script>
|
||||
<!--<script src="/javascripts/wechat/app.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/others/factory.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/others/filter.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/directives/alert.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/directives/form_validate.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/directives/input_auto.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/directives/loading_spinner.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/reg.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/invite_code.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/login.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/activity.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/add_class.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/blog.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/course_notice.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/discussion.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/homework.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/issue.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/journals.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/controllers/myclass.js"></script>-->
|
||||
<!--<script src="/javascripts/wechat/others/routes.js"></script>-->
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -7,7 +7,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="share-code-wrap">
|
||||
<a ng-click="share()" href="javascript:void(0);" class="share-code-btn">分享邀请码</a>
|
||||
<!--<a ng-click="share()" href="javascript:void(0);" class="share-code-btn">分享邀请码</a>-->
|
||||
<p/>
|
||||
<div class="share-code-instruction"> 1.将此页面分享给好友,邀请好友加入班级<br />
|
||||
2.通过微信扫一扫加入班级<br />
|
||||
3.输入邀请码加入班级</div>
|
||||
|
|
|
@ -547,6 +547,7 @@ function observeSearchfield(fieldId, targetId, url) {
|
|||
$.ajax({
|
||||
url: url,
|
||||
type: 'get',
|
||||
dataType: 'jsonp',
|
||||
data: {q: $this.val()},
|
||||
success: function(data){ if(targetId) $('#'+targetId).html(data); },
|
||||
beforeSend: function(){ $this.addClass('ajax-loading'); },
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
var app=angular.module("wechat",["ngRoute"]);app.constant("config",{rootPath:"/assets/wechat/",rootUrl:"/",apiUrl:"/api/v1/"}),app.run(["$rootScope","auth","$location","$routeParams",function(t,a,e,r){g_redirect_path&&g_redirect_path.length>0&&(e.path(g_redirect_path),g_redirect_path=null),t.$on("$routeChangeError",function(t,a,r){a&&a.templateUrl&&(a.templateUrl.endsWith("login.html")||a.templateUrl.endsWith("reg.html")||e.path("/login"))}),t.$on("$routeChangeStart",function(t,a,e){})}]);
|
||||
var app=angular.module("wechat",["ngRoute"]);app.constant("config",{rootPath:"/assets/wechat/",rootUrl:"/",apiUrl:"/api/v1/"}),app.run(["$rootScope","auth","$location","$routeParams",function(t,a,e,r){g_redirect_path&&g_redirect_path.length>1&&(e.path(g_redirect_path),g_redirect_path=null),t.$on("$routeChangeError",function(t,a,r){a&&a.templateUrl&&(a.templateUrl.endsWith("login.html")||a.templateUrl.endsWith("reg.html")||e.path("/login"))}),t.$on("$routeChangeStart",function(t,a,e){})}]);
|
||||
app.factory("alertService",function(){function t(){this.title=null,this.message=null,this.visible=null,this.cb=null}return t.prototype.showMessage=function(t,e,n){this.message=e,this.title=t,this.visible=!0,this.cb=n},t.prototype.dismiss=function(){this.message=null,this.title=null,this.visible=!1,this.cb&&this.cb()},{create:function(){return new t}}}),app.factory("auth",["$http","$routeParams","$q","session","config",function(t,e,n,o,a){var i=function(){var a=n.defer(),i=c();if(i&&i.length>10)a.resolve(i);else{window.g_code||e.code||o.get("code");t.post("/wechat/get_bind",{}).then(function(t){0!=t.data.status?a.reject(t.data.message):(o.save("token",t.data.token),a.resolve(t.data.token))})["catch"](function(t){a.reject(t)})}return a.promise},c=function(){return o.get("token")};return{get_bind:i,token:c}}]),app.factory("session",function(){return{save:function(t,e){sessionStorage.setItem(t,e)},get:function(t){return sessionStorage.getItem(t)}}}),app.factory("rms",function(){var t={},e=function(e,n){t[e]=n},n=function(e){return t[e]};return{save:e,get:n}}),app.factory("common",["$http","auth","$routeParams",function(t,e,n){var o=function(n,o,a,i){if(a.comment&&!(a.comment.length<=0)){var c=a.comment.replace(/\n/g,"<br/>"),s={type:o,content:c,token:e.token()};a.disabled=!0,t({method:"POST",url:apiUrl+"new_comment/"+n,data:s}).then(function(t){a.disabled=!1,"function"==typeof i&&i()},function(t){})}},a=function(n,o){return t({method:"GET",url:apiUrl+o+"/"+n+"?token="+e.token()})},i=function(n){n.praise_count+=1,n.has_praise=!0,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},c=function(n){n.praise_count-=1,n.has_praise=!1,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},s=function(t){t.scope.formData={comment:""};var e=function(e){a(e,t.type).then(function(e){t.loadCallback(e.data)},function(t){})};e(t.id),t.scope.addReply=function(n){console.log(n.comment),o(t.id,t.replyType,n,function(){t.scope.formData={comment:""},e(t.id),"function"==typeof t.replyCallback&&t.replyCallback()})},t.scope.addPraise=i,t.scope.decreasePraise=c};return{init:s,addCommonReply:o,loadCommonData:a,addCommonPraise:i,decreaseCommonPraise:c}}]);
|
||||
app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]);
|
||||
app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"教辅":""}});
|
||||
app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(a,t,e,o,i,c,n,r,s){e.replaceUrl=function(a){return a},e.alertService=s.create(),console.log("ActivityController load"),e.page=n.get("page")||0,e.activities=n.get("activities")||[],e.has_more=n.get("has_more"),e.loadActData=function(a){e.page=a,o({method:"POST",url:apiUrl+"activities",data:{token:c.token(),page:a}}).then(function(a){a.data.page>0?e.activities=e.activities.concat(a.data.data):e.activities=a.data.data,n.save("activities",e.activities),e.has_more=a.data.count+10*a.data.page<a.data.all_count,n.save("has_more",e.has_more),n.save("page",a.data.page),console.log(a.data)},function(a){})},e.activities.length<=0?e.loadActData(0):i(function(){window.scrollTo(0,n.get("yoffset"))}),e.goDetail=function(a,e,o){n.save("yoffset",window.document.body.scrollTop),t.path("/"+a+"/"+e)},e.addPraise=function(a){r.addCommonPraise(a)},e.decreasePraise=function(a){r.decreaseCommonPraise(a)}}]);
|
||||
app.controller("AddClassController",["$scope",function(o){}]);
|
||||
app.controller("BlogController",["$scope","$http","$routeParams","auth","common",function(o,l,t,n,a){a.init({id:t.id,scope:o,type:"blog_comments",replyType:"BlogComment",loadCallback:function(l){o.blog=l.data},replyCallback:function(){}})}]);
|
||||
app.controller("CourseNoticeController",["$scope","$http","$routeParams","auth","common",function(o,e,t,n,a){a.init({id:t.id,scope:o,type:"newss",replyType:"News",loadCallback:function(e){o.news=e.data},replyCallback:function(){}})}]);
|
||||
app.controller("DiscussionController",["$scope","$http","$routeParams","auth","common",function(o,s,a,e,n){n.init({id:a.id,scope:o,type:"messages",replyType:"Message",loadCallback:function(s){o.discussion=s.data},replyCallback:function(){}})}]);
|
||||
app.controller("HomeworkController",["$scope","$http","$routeParams","auth","common",function(o,e,l,n,r){r.init({id:l.id,scope:o,type:"whomeworks",replyType:"HomeworkCommon",loadCallback:function(e){console.log(e),o.homework=e.data},replyCallback:function(){}})}]);
|
||||
app.controller("InviteCodeController",["$scope","$http","$routeParams","config","auth",function(t,e,i,n,o){var a=t;a.course={};var c=i.id;e.get(n.apiUrl+"courses/"+c+"?token="+o.token()).then(function(t){console.log(t.data),a.course=t.data.data}),a.share=function(){window.WeixinJSBridge.invoke("sendAppMessage",{appid:"wxf694495398c7d470",type:"link",data_url:"",img_url:"http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640",img_height:370,img_width:550,link:"http://view.inews.qq.com/a/WXN2013101101385701",desc:"desc",title:"title"},function(t){})}}]);
|
||||
app.controller("IssueController",["$scope","$http","$routeParams","auth","common",function(o,e,l,s,t){t.init({id:l.id,scope:o,type:"issues",replyType:"Issue",loadCallback:function(e){console.log(e),o.issue=e.data},replyCallback:function(){}})}]);
|
||||
app.controller("JournalsController",["$scope","$http","$routeParams","auth","common",function(o,a,e,l,n){n.init({id:e.id,scope:o,type:"journal_for_messages",replyType:"JournalsForMessage",loadCallback:function(a){o.message=a.data},replyCallback:function(){}})}]);
|
||||
app.controller("LoginController",["$scope","$http","$location","$routeParams","alertService","config","auth","session",function(e,o,t,a,i,n,s,l){s.get_bind().then(function(){t.path("/activities")}),a.code&&l.save("code",a.code);var r=e;r.loginFailed=!1,r.alertService=i.create(),r.findPwdDialog=i.create(),r.login=function(a,i){return a.$setSubmitted(),console.log(i),a.$valid?(console.log(apiUrl+"auth"),void o.post(n.apiUrl+"users/wxbind",{login:i.login,password:i.password}).then(function(o){console.log(o.data),r.loginFailed=0!=o.data.status,e.loginFailed?r.alertService.showMessage("出错了",o.data.message):r.alertService.showMessage("提示",o.data.message,function(){t.path("/activities")})})["catch"](function(e){r.alertService.showMessage("出错了",e)})):void console.log(a.$error)},r.showBox=function(){r.findPwdDialog.showMessage("提示","请访问www.trustie.net获取密码,谢谢!")},r.goReg=function(){t.path("/reg")}}]);
|
||||
app.controller("MyClassController",["$scope",function(o){}]);
|
||||
app.controller("MyClassController",["$scope","config","$http","auth","$location","$routeParams",function(t,e,o,a,n,s){var c=t,r=s.id;c.currentTab=1,c.tab=function(t){c.currentTab=t,c.searchText="",console.log(c.currentTab),2==t&&c.students.length<=0&&o.get(e.apiUrl+"courses/students?token="+a.token()+"&course_id="+r).then(function(t){console.log(t.data),c.students=t.data.data})},c.course={},c.students=[],c.teachers=[],c.resources=[],c.invite=function(){n.path("/invite_code").search({id:r})},o.post(e.apiUrl+"courses/"+r+"/attachments",{token:a.token(),name:""}).then(function(t){c.resources=t.data.data}),o.get(e.apiUrl+"courses/"+r+"?token="+a.token()).then(function(t){console.log(t.data),c.course=t.data.data}),c.teachers.length<=0&&o.get(e.apiUrl+"courses/teachers?token="+a.token()+"&course_id="+r).then(function(t){console.log(t.data),c.teachers=t.data.data})}]);
|
||||
app.controller("RegController",["$scope","$http","$location","alertService",function(e,o,a,r){var s=e;s.errDialog=r.create(),s.goLogin=function(){a.path("/login")},s.isagreed=!0,s.agreed=function(e){s.isagreed=!e},s.reg=function(e,a){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(a),void o.post(apiUrl+"users",{login:a.username,password:a.password,mail:a.email}).then(function(e){0!=e.data.status?s.errDialog.showMessage("出错了",e.data.message):s.errDialog.showMessage("提示","注册且绑定微信成功")},function(e){s.errDialo.showMessage("出错了",e.data)})):void console.log(e.$error)}}]);
|
||||
app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]);
|
||||
app.directive("pwdconfirm",function(){return{require:"ngModel",link:function(r,n,i,e){e.$validators.pwdconfirm=function(n,i){return r.user&&r.user.password==i}}}});
|
||||
app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var e=t.parent().children().eq(0),i=t.parent().next();t.on("input",function(){console.log(i),e.html(t[0].value);var n=e[0].scrollHeight;t.css("height",n+"px")}),i.on("click",function(){t.css("height","28px")})}}});
|
||||
app.directive("loadingSpinner",["$http",function(i){return{restrict:"A",replace:!0,template:'<div ng-show="activeCalls>0" class="loading-bg"><div class="loading-box"><img src="/images/loading.gif" alt=""/><span>加载中...</span></div></div>'}}]);
|
||||
app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,r,t){var l=t.rootPath,n={delay:["auth",function(e){return e.get_bind()}]},s=function(e,o){return{templateUrl:l+e,controller:o,resolve:n}};e.when("/login",{templateUrl:l+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:l+"reg.html",controller:"RegController"}).when("/activites",s("activities.html","ActivityController")).when("/issues/:id",s("issue_detail.html","IssueController")).when("/project_discussion/:id",s("project_discussion.html","DiscussionController")).when("/homework/:id",s("homework_detail.html","HomeworkController")).when("/course_notice/:id",s("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",s("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",s("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",s("blog_detail.html","BlogController")).when("/add_class",s("add_class.html","AddClassController")).when("/myclass",s("myclass.html","MyClassController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]);
|
||||
app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,t,r){var l=r.rootPath,n={delay:["auth",function(e){return e.get_bind()}]},i=function(e,o){return{templateUrl:l+e,controller:o,resolve:n}};e.when("/login",{templateUrl:l+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:l+"reg.html",controller:"RegController"}).when("/activites",i("activities.html","ActivityController")).when("/issues/:id",i("issue_detail.html","IssueController")).when("/project_discussion/:id",i("project_discussion.html","DiscussionController")).when("/homework/:id",i("homework_detail.html","HomeworkController")).when("/course_notice/:id",i("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",i("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",i("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",i("blog_detail.html","BlogController")).when("/add_class",i("add_class.html","AddClassController")).when("/myclass",i("myclass.html","MyClassController")).when("/invite_code",i("invite_code.html","InviteCodeController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]);
|
Loading…
Reference in New Issue