Browse Source

优化页面

zhou-hao 7 years ago
parent
commit
acc62da226

+ 0 - 1
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/resources/static/login.html

@@ -38,7 +38,6 @@
         window.open('/oauth2/boot/' + provider + '?redirect=' + uri);
         window.open('/oauth2/boot/' + provider + '?redirect=' + uri);
     }
     }
 
 
-
     function getRequest() {
     function getRequest() {
         var url = location.search; //获取url中"?"符后的字串
         var url = location.search; //获取url中"?"符后的字串
         var theRequest = new Object();
         var theRequest = new Object();

+ 1 - 2
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java

@@ -161,8 +161,7 @@ public class OAuth2ServerApplication implements CommandLineRunner {
         clientEntity.setName("测试");
         clientEntity.setName("测试");
         clientEntity.setType("test");
         clientEntity.setType("test");
         clientEntity.setCreatorId("admin");
         clientEntity.setCreatorId("admin");
-        // 这里与 hsweb-examples-oauth2-client 的回调地址对应
-        clientEntity.setRedirectUri("http://localhost:8808/oauth2/callback/hsweb");
+        clientEntity.setRedirectUri("http://localhost:8808/");
         clientEntity.setCreateTime(System.currentTimeMillis());
         clientEntity.setCreateTime(System.currentTimeMillis());
         clientEntity.setSupportGrantTypes(new HashSet<>(Collections.singletonList("*")));
         clientEntity.setSupportGrantTypes(new HashSet<>(Collections.singletonList("*")));
         clientEntity.setStatus(DataStatus.STATUS_ENABLED);
         clientEntity.setStatus(DataStatus.STATUS_ENABLED);

+ 1 - 1
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/resources/static/oauth2/login.html

@@ -102,7 +102,7 @@
         param.scope = "public";
         param.scope = "public";
         //执行OAuth认证
         //执行OAuth认证
         doAjax("GET", "/oauth2/authorize", param, function (e, r) {
         doAjax("GET", "/oauth2/authorize", param, function (e, r) {
-            var redirect = unescape(e.redirectUri);
+            var redirect =e.redirectUri;
             var uri = redirect.indexOf("?") != -1 ? "&" : "?";
             var uri = redirect.indexOf("?") != -1 ? "&" : "?";
             uri += "code=" + e.code + "&state=" + e.state;
             uri += "code=" + e.code + "&state=" + e.state;
             window.location.href = (redirect + uri);
             window.location.href = (redirect + uri);