邀请码分享
This commit is contained in:
parent
a177c48a29
commit
c02245adfb
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
|||
}
|
||||
};
|
||||
}]);
|
||||
}]);
|
||||
}]);
|
||||
|
|
Loading…
Reference in New Issue