|
@@ -26,7 +26,7 @@ class Authworker
|
|
|
protected $config = [];
|
|
|
protected $options = [];
|
|
|
protected $allowFields = [
|
|
|
- 'id', 'truename', 'avatar', 'gonghao','mobile',
|
|
|
+ 'id', 'truename', 'avatar', 'gonghao','mobile','idcard_z_image','idcard_f_image','jineng_image'
|
|
|
];
|
|
|
|
|
|
|
|
@@ -174,7 +174,6 @@ class Authworker
|
|
|
$params = array_merge($data, [
|
|
|
// 'nickname' => preg_match("/^1[3-9]{1}\d{9}$/", $username) ? substr_replace($username, '****', 3, 4) : $username,
|
|
|
'nickname' => get_rand_nick_name(),
|
|
|
-// 'salt' => Random::alnum(),
|
|
|
// 'jointime' => $time,
|
|
|
// 'joinip' => $ip,
|
|
|
// 'logintime' => $time,
|
|
@@ -182,7 +181,7 @@ class Authworker
|
|
|
// 'prevtime' => $time,
|
|
|
'status' => 1
|
|
|
]);
|
|
|
-// $params['password'] = $this->getEncryptPassword($password, $params['salt']);
|
|
|
+// $params['password'] = $password;
|
|
|
$params = array_merge($params, $extend);
|
|
|
|
|
|
//账号注册时需要开启事务,避免出现垃圾数据
|
|
@@ -265,7 +264,7 @@ class Authworker
|
|
|
$this->setError('Account is locked');
|
|
|
return false;
|
|
|
}
|
|
|
- if ($user->password != $this->getEncryptPassword($password, $user->salt)) {
|
|
|
+ if ($user->password != $this->getEncryptPassword($password)) {
|
|
|
$this->setError('Password is incorrect');
|
|
|
return false;
|
|
|
}
|
|
@@ -308,11 +307,11 @@ class Authworker
|
|
|
return false;
|
|
|
}
|
|
|
//判断旧密码是否正确
|
|
|
- if ($this->_user->password == $this->getEncryptPassword($oldpassword, $this->_user->salt) || $ignoreoldpassword) {
|
|
|
+ if ($this->_user->password == $this->getEncryptPassword($oldpassword) || $ignoreoldpassword) {
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
$salt = Random::alnum();
|
|
|
- $newpassword = $this->getEncryptPassword($newpassword, $salt);
|
|
|
+ $newpassword = $this->getEncryptPassword($newpassword);
|
|
|
$this->_user->save(['password' => $newpassword]);
|
|
|
|
|
|
Tokenworker::delete($this->_token);
|
|
@@ -400,10 +399,6 @@ class Authworker
|
|
|
public function getUserinfo_simple(){
|
|
|
$userinfo = Tokenworker::get($this->_token);
|
|
|
|
|
|
- //是否完成用户资料
|
|
|
- $data = $this->_user->toArray();
|
|
|
-
|
|
|
-
|
|
|
return $userinfo;
|
|
|
}
|
|
|
|
|
@@ -419,9 +414,9 @@ class Authworker
|
|
|
|
|
|
//追加
|
|
|
$userinfo['avatar'] = one_domain_image($userinfo['avatar']);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ $userinfo['idcard_z_image'] = one_domain_image($userinfo['idcard_z_image']);
|
|
|
+ $userinfo['idcard_f_image'] = one_domain_image($userinfo['idcard_f_image']);
|
|
|
+ $userinfo['jineng_image'] = one_domain_image($userinfo['jineng_image']);
|
|
|
|
|
|
return $userinfo;
|
|
|
}
|
|
@@ -472,10 +467,10 @@ class Authworker
|
|
|
* @param string $salt 密码盐
|
|
|
* @return string
|
|
|
*/
|
|
|
- public function getEncryptPassword($password, $salt = '')
|
|
|
+ public function getEncryptPassword($password)
|
|
|
{
|
|
|
return $password;
|
|
|
- return md5(md5($password) . $salt);
|
|
|
+// return md5(md5($password) . $salt);
|
|
|
}
|
|
|
|
|
|
/**
|