Your Name 3 rokov pred
rodič
commit
daeb7ed31b

+ 3 - 3
learn/active/database/info_off.php

@@ -70,9 +70,9 @@ return array
             'default'   => '',
             'desc'      => '登录密码',
             'match'     => 'is_string',
-            'update'    => 'text',
-            'search'    => 'fulltext',
-            // 'list'      => true,
+            'update'    => 'password',
+            // 'search'    => 'fulltext',
+            'callback'  => 'sha1',
         ),
 
         'reorder'       => array

+ 7 - 1
learn/active/lib/Excel.php

@@ -146,10 +146,16 @@ Class Excel {
                     if ($where['mobile']) {
                         $where['pass'] = substr($where['mobile'],-6);
                     }
-                    $info = Dever::db('active/info_off')->find(array('mobile'=>$where['mobile']));
+                    $info = Dever::db('active/info_off')->find(array('mobile'=>$where['mobile'],'clear'=>true));
                     
                     if (!$info){
                         Dever::db('active/info_off')->insert($where);
+                    } else {
+                         if ($info && $info['pass'] != sha1(substr($info['mobile'],-6))) {
+                            $w['where_id'] = $info['id'];
+                            $w['pass'] = substr($info['mobile'],-6);
+                            Dever::db('active/info_off')->update($w);
+                         }
                     }
                 }
             }

+ 4 - 1
learn/active/src/Auth.php

@@ -106,12 +106,15 @@ Class Auth
     		Dever::alert('手机号不存在');
     	}
     	$pass = Dever::input('pass');
+    	if ($pass) {
+    		$pass = sha1($pass);
+    	}
     	$data = Dever::db('active/info_off')->find(array('mobile'=>$mobile));
     	if ($mobile != $data['mobile']) {
     		Dever::alert('手机号还未注册');
     	}
     	if (!$pass || $pass != $data['pass']) {
-    		Dever::alert('密码不能为空或密码不存在');
+    		Dever::alert('密码不能为空或密码不正确');
     	}
     	if ($data) {
 			$data = Dever::load('passport/reg')->getSign($data['id']);