邀请码分享

This commit is contained in:
guange 2016-07-15 18:08:19 +08:00
parent a177c48a29
commit c02245adfb
3 changed files with 4 additions and 8 deletions

View File

@ -193,14 +193,10 @@ module Mobile
desc "返回单个课程"
params do
requires :id, type: Integer
optional :token, type: String
end
route_param :id do
get do
authenticate!
cs = CoursesService.new
course = cs.show_course(params,(current_user.nil? ? User.find(2):current_user))
#course = Course.find(params[:id])
course = Course.find(params[:id])
present :data, course, with: Mobile::Entities::Course,user: current_user
{ status: 0}
end

View File

@ -8,7 +8,7 @@ app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config
vm.course = {};
var courseid = $routeParams.id;
$http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
$http.get(config.apiUrl+ 'courses/'+courseid+").then(
function(response){
console.log(response.data);
vm.course = response.data.data;

View File

@ -35,7 +35,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
.when('/edit_class', makeRoute('edit_class.html', 'EditClassController'))
.when('/class_list', makeRoute('class_list.html', 'ClassListController'))
.when('/myresource', makeRoute('myresource.html', 'MyResourceController'))
.when('/invite_code', makeRoute('invite_code.html', 'InviteCodeController'))
.when('/invite_code', {templateUrl: rootPath + 'invite_code.html', controller: 'InviteCodeController'})
.when('/send_class_list', makeRoute('send_class_list.html', 'SendClassListController'))
.otherwise({
redirectTo: '/activites'
@ -66,4 +66,4 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
}
};
}]);
}]);
}]);