star7th vor 4 Jahren
Ursprung
Commit
9077e08d71

+ 6 - 1
server/Application/Api/Controller/ExtLoginController.class.php

@@ -69,7 +69,12 @@ class ExtLoginController extends BaseController {
         $urlAuthorize = $oauth2_form['protocol']."://".$oauth2_form['host'].$oauth2_form['authorize_path'] ;
         $urlAccessToken = $oauth2_form['protocol']."://".$oauth2_form['host'].$oauth2_form['token_path'] ;
         $urlResourceOwnerDetails = $oauth2_form['protocol']."://".$oauth2_form['host'].$oauth2_form['resource_path'] ;
-        $urlUserInfo = $oauth2_form['protocol']."://".$oauth2_form['host'].$oauth2_form['userinfo_path'] ;
+        if(strstr($oauth2_form['userinfo_path'],"://")){
+            $urlUserInfo = $oauth2_form['userinfo_path'] ;
+        }else{
+            $urlUserInfo = $oauth2_form['protocol']."://".$oauth2_form['host'].$oauth2_form['userinfo_path'] ;
+        }
+        
     
         $provider = new \League\OAuth2\Client\Provider\GenericProvider([
             'clientId'                => $clientId,    // The client ID assigned to you by the provider

+ 1 - 1
web/index.html

@@ -16,4 +16,4 @@
       "server": window.location.protocol +'//'+ window.location.host + window.location.pathname+ '../server/index.php?s=',
       //"lang" :'en'
       "lang" :'zh-cn'
-  }</script><link href=./static/css/app.affba0334d633ada35708ef55400cf96.css rel=stylesheet></head><body class=grey-bg><div id=app></div><div style=display:none>本网站基于开源版showdoc搭建,仅供私人使用。如需访问showdoc官网,请在搜索引擎里搜索showdoc字样或者直接访问showdoc.com.cn</div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1eb6213d11eb61d1bd46.js></script><script type=text/javascript src=./static/js/app.cba3778aae7eed10f2fe.js></script></body></html>
+  }</script><link href=./static/css/app.d3b2b7074f2c30840fc6c99ed42e8236.css rel=stylesheet></head><body class=grey-bg><div id=app></div><div style=display:none>本网站基于开源版showdoc搭建,仅供私人使用。如需访问showdoc官网,请在搜索引擎里搜索showdoc字样或者直接访问showdoc.com.cn</div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1eb6213d11eb61d1bd46.js></script><script type=text/javascript src=./static/js/app.4830f00b504aee633c2a.js></script></body></html>

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
web/static/css/app.d3b2b7074f2c30840fc6c99ed42e8236.css


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
web/static/js/app.4830f00b504aee633c2a.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
web/static/js/app.cba3778aae7eed10f2fe.js


+ 1 - 1
web/static/lang/en.js

@@ -443,6 +443,6 @@ exports.default = {
   callback_eg: ' callback url example',
   entrance_tips_label: 'Entrance text prompt',
   entrance_tips_content: "When OAuth2 login is enabled, this entry will appear below the input box on the login interface. You can fill in a prompt such as 'Log in with company OA'",
-  userinfo_path_content:'The interface path for obtaining user information after successful login. The interface should return a json string and include the username field',
+  userinfo_path_content:'Interface to obtain user information after successful login. You can write a full URL or a path. When only the path is filled in, the OAuth host above will be used to supplement the full address automatically. The interface should return a JSON string with a username field',
   reset:'reset',
 }

+ 1 - 1
web/static/lang/zh-CN.js

@@ -421,6 +421,6 @@ exports.default = {
   callback_eg: ' callback url填写示例',
   entrance_tips_label: '入口文字提示',
   entrance_tips_content: "当启用OAuth2登录时候,登录界面将在输入框的下方出现此入口。你可以填上如'使用公司OA登录'这样的提示",
-  userinfo_path_content: '登录成功后获取用户信息的接口路径。该接口应当返回json字符串且包含username字段',
+  userinfo_path_content: '登录成功后获取用户信息的接口。可以写完整网址也可以写路径。当只填写路径的时候,将自动使用上面的Oauth host补充完整地址。该接口应当返回json字符串且包含username字段',
   reset:'重新生成',
 }

+ 1 - 1
web_src/src/components/admin/extLogin/Index.vue

@@ -85,7 +85,7 @@
           <el-form-item :label="$t('callback_eg')">
             http://{{
               $t('your_showdoc_server')
-            }}/server/?s=/api/ExtLogin/oauth2
+            }}/server/?s=/api/extLogin/oauth2
           </el-form-item>
           <div>
             <el-form-item :label="$t('入口文字提示')">

+ 1 - 1
web_src/static/lang/en.js

@@ -443,6 +443,6 @@ exports.default = {
   callback_eg: ' callback url example',
   entrance_tips_label: 'Entrance text prompt',
   entrance_tips_content: "When OAuth2 login is enabled, this entry will appear below the input box on the login interface. You can fill in a prompt such as 'Log in with company OA'",
-  userinfo_path_content:'The interface path for obtaining user information after successful login. The interface should return a json string and include the username field',
+  userinfo_path_content:'Interface to obtain user information after successful login. You can write a full URL or a path. When only the path is filled in, the OAuth host above will be used to supplement the full address automatically. The interface should return a JSON string with a username field',
   reset:'reset',
 }

+ 1 - 1
web_src/static/lang/zh-CN.js

@@ -421,6 +421,6 @@ exports.default = {
   callback_eg: ' callback url填写示例',
   entrance_tips_label: '入口文字提示',
   entrance_tips_content: "当启用OAuth2登录时候,登录界面将在输入框的下方出现此入口。你可以填上如'使用公司OA登录'这样的提示",
-  userinfo_path_content: '登录成功后获取用户信息的接口路径。该接口应当返回json字符串且包含username字段',
+  userinfo_path_content: '登录成功后获取用户信息的接口。可以写完整网址也可以写路径。当只填写路径的时候,将自动使用上面的Oauth host补充完整地址。该接口应当返回json字符串且包含username字段',
   reset:'重新生成',
 }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.