Bladeren bron

'修改登陆'

Ethan 6 jaren geleden
bovenliggende
commit
d22557951c
2 gewijzigde bestanden met toevoegingen van 12 en 5 verwijderingen
  1. 5 2
      application/user/controller/Login.php
  2. 7 3
      application/user/view/login/index.html

+ 5 - 2
application/user/controller/Login.php

@@ -70,9 +70,12 @@ class Login extends Controller
                 //设置 session
                 session('user_id', $user_info['user_id']);
                 session('user_email', $user_info['user_email']);
+                $login = input('get.login');
 
-                if(!empty($http)){
-                    header("location:$http");
+                if($login === '0'){
+                    $path = parse_url($http);
+                    $oldPath = substr($path['path'],0,strrpos($path['path'],"."));
+                    return $this->redirect($oldPath . '?' . $path['query']);
                 }else{
                     return $this->redirect('User/Index/index');
                 }

+ 7 - 3
application/user/view/login/index.html

@@ -40,7 +40,7 @@
 <!--<body style="background-image:url({$Think.ADMIN_SITE_ROOT}/wallpage/bg_<?php echo rand(0,8)?>.jpg);background-size: cover;">-->
 <div class="admincp-header" style="line-height: 4;">
     <div class="logo">
-        <a href="/index.php"><img width="200" src="{$Think.USER_SITE_ROOT}/images/backlogo.png"/></a>
+        <a  onclick="goHome()"><img width="200" src="{$Think.USER_SITE_ROOT}/images/backlogo.png"/></a>
     </div>
     <div class="navbar">
         <ul class="fr" style="float:right" id="nav">
@@ -63,7 +63,7 @@
                     <input type="text" name="user_password" placeholder="{:lang('user_password')}" required class="text">
                 </div>
                 <div class="form-group">
-                    <input type="text" style="display: none;" name="http" placeholder="{:lang('http')}" required class="text" value="{$http}">
+                    <input type="text" style="display: none" name="http" placeholder="{:lang('http')}" required class="text" value="{$http}">
                 </div>
                 <!--<div class="form-group">-->
                     <!--<input type="text" name="captcha" placeholder="{:lang('login_captcha')}" required class="text" style="width:60%;float:left;">-->
@@ -77,9 +77,13 @@
     </div>
 </div>
 <script>
+    const myHost = "http://" + window.location.host;
+    function goHome() {
+        window.location.href = myHost;
+    }
     $('#change_captcha').click(function () {
         $(this).attr('src', '{:captcha_src()}?'+(new Date().getTime()));
     });
 </script>
 </body>
-</html>
+</html>