forked from fp2952/spring-cloud-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fangp
committed
Apr 21, 2018
1 parent
6cdc852
commit da4fbec
Showing
14 changed files
with
317 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...er/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/WebMvcConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.peng.auth.provider.config.web; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | ||
|
||
/** | ||
* Created by fp295 on 2018/4/21. | ||
*/ | ||
@Configuration | ||
public class WebMvcConfig extends WebMvcConfigurerAdapter { | ||
|
||
@Override | ||
public void addViewControllers(ViewControllerRegistry registry){ | ||
registry.addViewController("/login").setViewName("login"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+731 Bytes
auth-center/auth-center-provider/src/main/resources/static/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions
39
auth-center/auth-center-provider/src/main/resources/static/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" | ||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>欢迎使用统一登录系统</title> | ||
<link rel="stylesheet" href="webjars/Semantic-UI/2.2.10/semantic.min.css"/> | ||
</head> | ||
<style type="text/css"> | ||
body > .grid { | ||
height: 100%; | ||
} | ||
.image { | ||
margin-top: -100px; | ||
} | ||
.column { | ||
max-width: 450px; | ||
} | ||
</style> | ||
<body> | ||
<div class="ui middle aligned center aligned grid"> | ||
<div class="column"> | ||
<h2 class="ui teal image header"> | ||
<img src="images/logo.png" class="image"> | ||
<div class="content"> | ||
统一登录服务 | ||
</div> | ||
</h2> | ||
<div class="ui red message"> | ||
登录成功 | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
<script src="webjars/jquery/3.2.1/jquery.min.js" ></script> | ||
<script src="webjars/Semantic-UI/2.2.10/semantic.min.js" ></script> | ||
</html> |
63 changes: 63 additions & 0 deletions
63
auth-center/auth-center-provider/src/main/resources/templates/authorize.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | ||
<link rel="stylesheet" href="${request.contextPath}/webjars/Semantic-UI/2.2.10/semantic.min.css"/> | ||
</head> | ||
<style type="text/css"> | ||
body { | ||
background-color: #DADADA; | ||
} | ||
body > .grid { | ||
height: 100%; | ||
} | ||
.image { | ||
margin-top: -100px; | ||
} | ||
.column { | ||
max-width: 450px; | ||
} | ||
</style> | ||
<body> | ||
<div class="ui middle aligned center aligned grid"> | ||
<div class="column"> | ||
<div class="ui large form"> | ||
<div class="ui stacked segment"> | ||
<div class="ui grid"> | ||
<div class="left aligned sixteen wide column"> | ||
将允许应用 ${authorizationRequest.clientId} 进行以下操作:<br> | ||
<i class="user icon"></i>获取你的用户信息 | ||
</div> | ||
<div class="sixteen wide column"> | ||
<button id="ok" class="ui primary button">允许 </button> | ||
<button id="no" class="ui button">拒绝 </button> | ||
</div> | ||
<form id="form" action="${request.contextPath}/oauth/authorize" method='post'> | ||
<input id="approval" name='user_oauth_approval' value='false' type='hidden'/> | ||
<input id="approveOrDeny" name='authorize' value='Authorize' type='hidden'/> | ||
<input id="scope" name='scope.user' value='true' type='hidden'/> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
<script src="${request.contextPath}/webjars/jquery/3.2.1/jquery.min.js" ></script> | ||
<script src="${request.contextPath}/webjars/Semantic-UI/2.2.10/semantic.min.js" ></script> | ||
<script> | ||
$("#ok").click(function () { | ||
$("#approval").val("true"); | ||
$("#approveOrDeny").attr("name", "authorize").val("Authorize"); | ||
$("#form").submit(); | ||
}) | ||
$("#no").click(function () { | ||
$("#approval").val("false"); | ||
$("#approveOrDeny").attr("name", "deny").val("Deny"); | ||
$("#scope").val("false"); | ||
$("#form").submit(); | ||
}) | ||
</script> | ||
</html> |
Oops, something went wrong.