oschina登录--授权页
This commit is contained in:
parent
ac0cd92c68
commit
ac1d3e8bf6
|
@ -1,3 +1,4 @@
|
|||
#encoding: utf-8
|
||||
class OauthController < ApplicationController
|
||||
before_filter :user_setup
|
||||
before_filter :require_login, only: [:authorize, :token]
|
||||
|
@ -41,7 +42,11 @@ class OauthController < ApplicationController
|
|||
|
||||
redirect_to params["redirect_uri"] + "?code=#{code}&state=#{params[:state]}"
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base_authorize_oschina'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def test_callback
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= current_language %>">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><%=h html_title %></title>
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan','prettify','//at.alicdn.com/t/font_930423_4z0tgi8hlb9.css', :media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag "jquery.leanModal.min",'prettify' %>
|
||||
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="<%=h body_css_classes %>" style="background-color: #fff;">
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<%= yield %>
|
||||
</div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
</html>
|
|
@ -1,11 +1,7 @@
|
|||
授权页
|
||||
|
||||
|
||||
<% if false %>
|
||||
<p>当前用户: <%= current_user.login %></p>
|
||||
|
||||
<p>
|
||||
|
||||
|
||||
<%= form_for oauth_authorize_path do%>
|
||||
<input type="hidden" name="gen_code" value="true">
|
||||
<input type="hidden" name="client_id" value="<%= @data["client_id"] %>">
|
||||
|
@ -15,5 +11,26 @@
|
|||
<input type="hidden" name="state" value="<%= @data["state"] %>">
|
||||
<button type="submit">是否授权</button>
|
||||
<% end %>
|
||||
|
||||
</p>
|
||||
<% end %>
|
||||
<div class="authTop">
|
||||
<div class="authmain">
|
||||
<i class="iconfont icon-oschina f40 c_white fl"></i><span class="f18 ml10 fl mt20">oschina</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt60">
|
||||
<div class="authmain clearfix">
|
||||
<div class="fl l-f-login">
|
||||
<div style="width: 220px;margin:0px auto;">
|
||||
<p class="f18 mb20">帐号密码登录</p>
|
||||
<input type="text" class="auth-login-input" placeholder="邮箱/手机号登录"/>
|
||||
<input type="password" class="auth-login-input" placeholder="密码"/>
|
||||
<a href="javascript:void(0)" class="auth-login-btn">授权并登录</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fl l-r-trustie">
|
||||
<p><span class="c_blue">trustie</span>将获得以下权限</p>
|
||||
<p><input type="checkbox" checked="checked" disabled class="checked-choose"/>获得您的昵称、头像、性别</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
48
db/schema.rb
48
db/schema.rb
|
@ -679,6 +679,10 @@ ActiveRecord::Schema.define(:version => 20181121071704) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "course_lists", :force => true do |t|
|
||||
t.string "name"
|
||||
end
|
||||
|
||||
create_table "course_messages", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "course_id"
|
||||
|
@ -835,6 +839,11 @@ ActiveRecord::Schema.define(:version => 20181121071704) do
|
|||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "discipline_categories", :force => true do |t|
|
||||
t.integer "major_level"
|
||||
t.string "name"
|
||||
end
|
||||
|
||||
create_table "discuss_demos", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
|
@ -1375,6 +1384,25 @@ ActiveRecord::Schema.define(:version => 20181121071704) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "major_courses", :force => true do |t|
|
||||
t.integer "course_list_id"
|
||||
t.integer "major_id"
|
||||
end
|
||||
|
||||
add_index "major_courses", ["course_list_id"], :name => "index_major_courses_on_course_list_id"
|
||||
add_index "major_courses", ["major_id"], :name => "index_major_courses_on_major_id"
|
||||
|
||||
create_table "majors", :force => true do |t|
|
||||
t.string "major_code"
|
||||
t.string "name"
|
||||
t.integer "first_level_discipline_id"
|
||||
t.integer "discipline_category_id"
|
||||
t.integer "major_level"
|
||||
end
|
||||
|
||||
add_index "majors", ["discipline_category_id"], :name => "index_majors_on_discipline_category_id"
|
||||
add_index "majors", ["first_level_discipline_id"], :name => "index_majors_on_first_level_discipline_id"
|
||||
|
||||
create_table "member_roles", :force => true do |t|
|
||||
t.integer "member_id", :null => false
|
||||
t.integer "role_id", :null => false
|
||||
|
@ -1501,16 +1529,7 @@ ActiveRecord::Schema.define(:version => 20181121071704) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "oauth_configs", :force => true do |t|
|
||||
t.string "client_id"
|
||||
t.string "client_secret"
|
||||
t.string "redirect_uri"
|
||||
t.string "scope"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "oauths", :force => true do |t|
|
||||
create_table "oauth", :force => true do |t|
|
||||
t.string "client_id"
|
||||
t.string "client_secret"
|
||||
t.string "code"
|
||||
|
@ -1524,6 +1543,15 @@ ActiveRecord::Schema.define(:version => 20181121071704) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "oauth_configs", :force => true do |t|
|
||||
t.string "client_id"
|
||||
t.string "client_secret"
|
||||
t.string "redirect_uri"
|
||||
t.string "scope"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "onclick_times", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.datetime "onclick_time"
|
||||
|
|
|
@ -503,3 +503,15 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex
|
|||
.homepageBackground{ background-color:#90C5EC; flex:1; text-align: center }
|
||||
.homepageClickBackground{ background-color:#3b94d6; flex:1; text-align: center }
|
||||
.flex-cell_homepage:hover{ background-color:#3b94d6;}
|
||||
|
||||
|
||||
/*oschina授权页*/
|
||||
.authTop{width: 100%;position: fixed;left: 0px;top:0px;background-color: #51B7EC;height: 58px;color: #fff;}
|
||||
.authmain{width: 1200px;margin:0px auto;display: block!important;}
|
||||
.l-f-login{padding: 20px 40px;border-right: 1px solid #eaeaea;text-align: center;width: 30%; margin-left: 143px;box-sizing: border-box}
|
||||
.auth-login-input{width: 100%;height: 35px;border-radius: 2px;outline: none;padding: 5px;box-sizing: border-box;display: block;margin-bottom: 10px;}
|
||||
.auth-login-btn{width: 100%;height: 32px;line-height: 32px;margin-top:20px;margin-bottom:20px;text-align: center;color: #fff!important;font-size: 14px;display: block;background-color: #4CACFF;border-radius: 2px;}
|
||||
.l-r-trustie{padding:50px;}
|
||||
.l-r-trustie p{line-height: 40px;border-bottom: 1px dashed #eaeaea;font-size: 15px;}
|
||||
.l-r-trustie p:last-child{border-bottom: none;}
|
||||
.checked-choose{margin-right: 5px;margin-top: 13px;float: left}
|
Loading…
Reference in New Issue