routes修改

This commit is contained in:
Yang Zhao 2016-12-28 14:36:04 +00:00
parent ff7959fdc9
commit 694e9f2c97
2 changed files with 32 additions and 0 deletions

View File

@ -62,4 +62,17 @@ Rails.application.routes.draw do
post 'sessions' => 'sessions#create' post 'sessions' => 'sessions#create'
delete 'session' => 'sessions#destroy' delete 'session' => 'sessions#destroy'
get 'session' => 'sessions#show' get 'session' => 'sessions#show'
post 'shares' => 'shares#create'
get 'shares' => 'share#getShareList'
get 'projects' => 'projects#index'
post 'projects' => 'projects#create'
post 'projects/users' => 'projects#addUsers'
get 'projects/detail' => 'projects#detail'
get 'missions/project/status' => 'missions#getlist'
get 'missions/detail' => 'missions#detail'
patch 'missions/detail' => 'missions#update'
post 'missions/comments' => 'missions#commentPublish'
end end

View File

@ -259,6 +259,25 @@
<!-- AdminLTE for demo purposes --> <!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script> <script src="../dist/js/demo.js"></script>
<!-- date select and query --> <!-- date select and query -->
<script>
//alert("111");
$(document).ready(function(){
$.ajax({
type: "get",
dataType: "json",
url:"/shares.json",
statusCode: {
200: function(data) {// 请求成功
alert(data);
},
401:function(){// 未授权
alert("未登录!");
window.location.href="pages/login.html";
}
}
});
});
</script>
</body> </body>
</html> </html>