code: public function account(Request $request)
      {
          if ($request->isPost()) {
              $user_nick = $request->param('user_nick');
              if (empty($user_nick)) {
                  return $this->error('昵称为空');
              }
              
              $user_passwd = $request->param('user_passwd');
              $re_passwd = $request->param('re_passwd');
              if (! empty($user_passwd)) {
                  
                  // 重复密码
                  if ($user_passwd != $re_passwd) {
                      return $this->error('两次密码不一致');
                  }
                  
                  // 验证原密码
                  $old_passwd = $request->param('old_passwd');
                  if (empty($old_passwd)) {
                      return $this->error('原密码为空');
                  } else {
                      $user = LoginLogic::gteLoginUserInfo();
                      
                      $result = LoginLogic::doLogin($user['user_name'], $old_passwd);
                      if ($result['code'] != 1) {
                          return $this->error('原密码错误');
                      }
                  }
              }
              
              // 保存账号
              $data = [
                  'user_nick' => $user_nick
              ];
              $user_passwd && $data['user_passwd'] = $user_passwd;
              MemberLogic::instance()->saveMember($data, $this->user_id);
              
              return $this->success('修改资料成功', Url::build('index/account'));
          } else {
              $this->site_title = '账号设置';
              return $this->fetch();
          }
      }
docs: 账号设置
  
  @param Request $request
  @return string