Browse Source

ext login

star7th 4 years ago
parent
commit
788652de98

+ 10 - 10
server/Application/Api/Controller/AdminSettingController.class.php

@@ -155,24 +155,24 @@ class AdminSettingController extends BaseController {
 
     }
 
-    public function getLoginSecretToken(){
+    public function getLoginSecretKey(){
         $login_user = $this->checkLogin();
         $this->checkAdmin();
-        $login_secret_token = D("Options")->get("login_secret_token") ;
-        if(!$login_secret_token){
-            $login_secret_token = md5("rgrsfsrfsrf".time().rand());
-            D("Options")->set("login_secret_token",$login_secret_token) ;
+        $login_secret_key = D("Options")->get("login_secret_key") ;
+        if(!$login_secret_key){
+            $login_secret_key = md5("rgrsfsrfsrf".time().rand());
+            D("Options")->set("login_secret_key",$login_secret_key) ;
         }
-        $this->sendResult(array("login_secret_token"=>$login_secret_token));
+        $this->sendResult(array("login_secret_key"=>$login_secret_key));
 
     }
 
-    public function resetLoginSecretToken(){
+    public function resetLoginSecretKey(){
         $login_user = $this->checkLogin();
         $this->checkAdmin();
-        $login_secret_token = md5("rgrsfsrfsrf".time().rand());
-        D("Options")->set("login_secret_token",$login_secret_token) ;
-        $this->sendResult(array("login_secret_token"=>$login_secret_token));
+        $login_secret_key = md5("rgrsfsrfsrf".time().rand());
+        D("Options")->set("login_secret_key",$login_secret_key) ;
+        $this->sendResult(array("login_secret_key"=>$login_secret_key));
 
     }
 

+ 3 - 3
server/Application/Api/Controller/ExtLoginController.class.php

@@ -4,7 +4,7 @@ use Think\Controller;
 class ExtLoginController extends BaseController {
 
 
-    // 根据用户名和LoginSecretToken登录
+    // 根据用户名和LoginSecretKey登录
     public function bySecretKey(){
         $username = I("username") ;
         $key = I("key") ;
@@ -16,9 +16,9 @@ class ExtLoginController extends BaseController {
             $this->sendError(10101,"已过期");
             return ;
         }
-        $login_secret_token = D("Options")->get("login_secret_token") ;
+        $login_secret_key = D("Options")->get("login_secret_key") ;
 
-        $new_token = md5($username.$login_secret_token.$time);
+        $new_token = md5($username.$login_secret_key.$time);
         if($token !=  $new_token){
             $this->sendError(10101,"token不正确");
             return ;

+ 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.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>
+  }</script><link href=./static/css/app.5292f6f55e64e4b62c9b5a0baf5b82f7.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.1773fa4abe372dfac8ef.js></script></body></html>

File diff suppressed because it is too large
+ 0 - 0
web/static/css/app.5292f6f55e64e4b62c9b5a0baf5b82f7.css


File diff suppressed because it is too large
+ 0 - 0
web/static/js/app.1773fa4abe372dfac8ef.js


File diff suppressed because it is too large
+ 0 - 0
web/static/js/app.4830f00b504aee633c2a.js


+ 11 - 13
web_src/src/components/admin/extLogin/Index.vue

@@ -182,10 +182,10 @@
             LoginSecretKey:&nbsp;
             <el-input
               readonly
-              v-model="login_secret_token"
+              v-model="login_secret_key"
               class="form-el"
             ></el-input>
-            <el-button @click="resetLoginSecretToken">{{
+            <el-button @click="resetLoginSecretKey">{{
               $t('reset')
             }}</el-button>
           </p>
@@ -237,7 +237,7 @@ export default {
           userinfo_path: ''
         }
       },
-      login_secret_token: '',
+      login_secret_key: '',
       itemList: [],
       lang: ''
     }
@@ -296,29 +296,27 @@ export default {
       })
     },
 
-    getLoginSecretToken() {
-      this.request('/api/adminSetting/getLoginSecretToken', {}).then(data => {
-        this.login_secret_token = data.data.login_secret_token
+    getLoginSecretKey() {
+      this.request('/api/adminSetting/getLoginSecretKey', {}).then(data => {
+        this.login_secret_key = data.data.login_secret_key
       })
     },
-    resetLoginSecretToken() {
+    resetLoginSecretKey() {
       this.$confirm(this.$t('confirm') + '?', ' ', {
         confirmButtonText: this.$t('confirm'),
         cancelButtonText: this.$t('cancel'),
         type: 'warning'
       }).then(() => {
-        this.request('/api/adminSetting/resetLoginSecretToken', {}).then(
-          data => {
-            this.login_secret_token = data.data.login_secret_token
-          }
-        )
+        this.request('/api/adminSetting/resetLoginSecretKey', {}).then(data => {
+          this.login_secret_key = data.data.login_secret_key
+        })
       })
     }
   },
   mounted() {
     this.loadLdapConfig()
     this.loadOauth2Config()
-    this.getLoginSecretToken()
+    this.getLoginSecretKey()
     this.lang = DocConfig.lang
   },
   beforeDestroy() {

Some files were not shown because too many files changed in this diff