Browse Source

checkredis

undefined
娄梦宁 4 years ago
parent
commit
337009ee40
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      addons/unishop/controller/User.php

+ 9
- 8
addons/unishop/controller/User.php View File

@@ -128,15 +128,16 @@ class User extends Base
*/
public function edit()
{
$userInfo = $this->auth->getUserinfo();
$username = $this->request->post('username', $userInfo['username']);
$mobile = $this->request->post('mobile', $userInfo['mobile']);
$avatar = $this->request->post('avatar', $userInfo['avatar']);

// $userInfo = $this->auth->getUserinfo();
// $username = $this->request->post('username', $userInfo['username']);
$password = $this->request->post('password', "");
// $avatar = $this->request->post('avatar', $userInfo['avatar']);
if (!$password){
$this->error(__('请填写密码'), 0);
}
$user = \app\common\model\User::get($this->auth->id);
$user->username = $username;
$user->mobile = $mobile;
$user->avatar = $avatar;
$pwd= \app\common\library\Auth::instance()->getEncryptPassword($password, $user->salt);
$user->password = $pwd;
if ($user->save()) {
$this->success(__('Modified'), 1);
} else {


Loading…
Cancel
Save