Jonlin 6 years ago
parent
commit
1243e9059b

+ 1 - 1
application/database.php

@@ -6,7 +6,7 @@ return [
 // 服务器地址
 'hostname'       => '192.168.2.186',
 // 数据库名
-'database'       => 'aqmdata',
+'database'       => 'ds_cms',
 // 用户名
 'username'       => 'root',
 // 密码

+ 12 - 1
application/user/controller/Login.php

@@ -21,6 +21,11 @@ class Login extends Controller
      */
     public function index()
     {
+        $http = array();
+        if(!empty($_SERVER['HTTP_REFERER'])){
+            $http[] = $_SERVER['HTTP_REFERER'];
+        }
+
         if (session('user_id')) {
             $this->success('已经登录', 'User/Index/index');
         }
@@ -70,7 +75,13 @@ class Login extends Controller
                 session('user_id', $user_info['user_id']);
                 session('user_email', $user_info['user_email']);
 
-                return $this->redirect('User/Index/index');
+                if(!empty($http)){
+                   // header(location:$http);
+                   // echo '<script>parent.location.href='.$http.';</script>';
+                    header("location:http://homedata.test/home/product/details.html?id=2");
+                }else{
+                    return $this->redirect('User/Index/index');
+                }
             } else {
                 $this->success('帐号密码错误');
             }

+ 6 - 6
application/user/controller/Register.php

@@ -44,17 +44,17 @@ class Register extends Controller
             $ch_box = input('post.ch_box');
             $user_type = input('post.user_type');
 
-            // 协议 校验
+            // 用户类型 校验
             if (empty($user_type)) {
                 //验证失败
                 $this->error('未选择用户类型');
             }
 
-            // 用户类型
-            if ($ch_box == false) {
-                //验证失败
-                $this->error('未勾选协议');
-            }
+//            // 协议 校验
+//            if ($ch_box == false) {
+//                //验证失败
+//                $this->error('未勾选协议');
+//            }
 
             //验证密码
             if ($user_password != $confirm_password) {

+ 0 - 2
application/user/model/UserMessage.php

@@ -24,7 +24,6 @@ class UserMessage extends Model
     //获取用户未读消息
     public function getMessage($user_id)
     {
-
         $message = $this
             ->where('user_id',$user_id)
             ->where('userMessage_status',0)
@@ -34,5 +33,4 @@ class UserMessage extends Model
 
     }
 
-
 }

+ 1 - 1
application/user/view/index/index.html

@@ -126,7 +126,7 @@
 <script>
     var num = document.getElementById("num").value;
     if(num>0){
-        console.log(num);
+        //console.log(1);
         var appendHtml = '<a href="javascript:void(0);" onclick=" return false; " class="num">'+num+'</a>';
         $(".my_massage").append(appendHtml);
     }

+ 2 - 2
application/user/view/login/index.html

@@ -57,7 +57,7 @@
         <div class="login_content">
             <form method="post">
                 <div class="form-group">
-                    <input type="text" name="user_email" placeholder="{:lang('user_email')}" required class="text">
+                    <input type="text" name="user_email" placeholder="{:lang('user_email')}" required class="text" value="{$http[0]}">
                 </div>
                 <div class="form-group">
                     <input type="password" name="user_password" placeholder="{:lang('user_password')}" required class="text">
@@ -67,7 +67,7 @@
                     <!--<img src="{:captcha_src()}" style="width:30%;height:38px;" id="change_captcha"/>-->
                 <!--</div>-->
                 <div class="form-group" style="text-align: center;">
-                    <input style="width: 100px;" type="submit" class="layui-btn" value="{:lang('login_sumbit')}" lay-submit lay-filter="login"/>
+                    <input style="width: 100%;" type="submit" class="layui-btn" value="{:lang('login_sumbit')}" lay-submit lay-filter="login"/>
                 </div>
             </form>
         </div>

+ 6 - 6
application/user/view/register/index.html

@@ -99,8 +99,8 @@
                     <div id="phone"></div>
                 </div>
                 <div class="form-group">
-                    <select name="user_type" id="" style="height: 38px;line-height: 38px;width: 96%;border-color: #E6E6E6;">
-                        <option value>请选择</option>
+                    <select name="user_type" id="" style="height: 38px;line-height: 38px;width: 100%;border-color: #E6E6E6;">
+                        <option value>请选择用户类型</option>
                         <option value="1">个人用户</option>
                         <option value="2">企业用户</option>
                     </select>
@@ -108,12 +108,12 @@
                     <!--<div id="type"></div>-->
                 </div>
                 <div class="form-group" style="margin-top: 60px;">
-                    <input type="text" name="captcha" placeholder="{:lang('login_captcha')}" required class="text" style="width:60%;float:left;">
+                    <input type="text" name="captcha" placeholder="{:lang('login_captcha')}" required class="text" style="width:64%;float:left;">
                     <img src="{:captcha_src()}" style="width:30%;height:38px;" id="change_captcha"/>
                 </div>
-                <input type="checkbox" name="ch_box" id="ch_box" onclick="c_box()" />我已阅读并同意<a>《用户协议》</a>及<a>《法律声明及隐私条款》</a><br><br>
-                <div class="form-group" style="text-align: center;">
-                    <input type="submit" class="layui-btn" id="layui-btn" value="{:lang('register_sumbit')}" lay-submit lay-filter="login" style="margin-top:-20px; "/>
+                <!--<input type="checkbox" name="ch_box" id="ch_box" onclick="c_box()" />我已阅读并同意<a>《用户协议》</a>及<a>《法律声明及隐私条款》</a><br><br>-->
+                <div class="form-group" style="text-align: center;margin-top: 60px;">
+                    <input type="submit" class="layui-btn" id="layui-btn" value="{:lang('register_sumbit')}" lay-submit lay-filter="login" style="margin-top:-20px;width:100%; "/>
                 </div>
             </form>
         </div>