/** * 登陆框登陆,并根据POST参数,返回status参数 * 私有方法 * $username:用户名字,$password:用户密码 * $password 注释方法 md5(hash('sha256', ($password >> ($password%3)).substr($password, 1, 3))); * 共有方法,所有方法的入口 */ private function _onLogging() { static::$username = I(trim('post.name'), 'htmlspecialchars'); static::$password = I(trim('post.pwd')); if (!IS_POST && empty(static::$username) && empty(static::$password)) { $this->ajaxReturn(array('status' => 302, 'info' => '请求数据有问题,请重试')); } }
public static function create($email, $password) { $acc = new static(); $acc->email = $email; $acc->password($password); $acc->save(); return $acc; }
/** * Set the password value * * @param string $password The password value * * @static */ public static function setPassword(string $password) { static::$password = $password; }