diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php index 55f8a54..aaae023 100644 --- a/application/admin/controller/user/User.php +++ b/application/admin/controller/user/User.php @@ -97,15 +97,18 @@ class User extends Backend 'password', 'email', ]; - $salt = \fast\Random::alnum(); for ($currentRow = 2; $currentRow <= $allRow; $currentRow++) { $values = []; + $salt = \fast\Random::alnum(); for ($currentColumn = 1; $currentColumn <= 4; $currentColumn++) { $val = $currentSheet->getCellByColumnAndRow($currentColumn, $currentRow)->getValue(); if ($currentColumn==3){ //修改的是密码 $val= \app\common\library\Auth::instance()->getEncryptPassword($val, $salt); } + if (!$val){ + continue 2; + } $values[] = is_null($val) ? '' : $val; } // $row = []; @@ -118,7 +121,9 @@ class User extends Backend // print_r($temp); // print_r($row); // if ($row) { - $insert[] = $temp; + $temp['status']="normal"; + $temp['salt']=$salt; + $insert[] = $temp; // } } } catch (Exception $exception) { diff --git a/application/admin/view/user/user/edit.html b/application/admin/view/user/user/edit.html index 426289b..8a224ff 100644 --- a/application/admin/view/user/user/edit.html +++ b/application/admin/view/user/user/edit.html @@ -1,11 +1,11 @@