diff --git a/Application/Common/Common/index.html b/Application/Common/Common/index.html deleted file mode 100644 index 0519ecb..0000000 --- a/Application/Common/Common/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Application/Common/Conf/config.php b/Application/Common/Conf/config.php index 4a57ea8..69008cd 100644 --- a/Application/Common/Conf/config.php +++ b/Application/Common/Conf/config.php @@ -1,6 +1,5 @@ '配置值' // 添加数据库配置信息 'DB_TYPE' => 'mysql', // 数据库类型 'DB_HOST' => '127.0.0.1', // 服务器地址 diff --git a/Application/Common/Conf/index.html b/Application/Common/Conf/index.html deleted file mode 100644 index 0519ecb..0000000 --- a/Application/Common/Conf/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Application/Common/index.html b/Application/Common/index.html deleted file mode 100644 index 0519ecb..0000000 --- a/Application/Common/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Application/Home/Conf/config.php b/Application/Home/Conf/config.php index 74bc338..7e3997a 100644 --- a/Application/Home/Conf/config.php +++ b/Application/Home/Conf/config.php @@ -4,8 +4,8 @@ return array ( 'DB_TYPE' => 'mysql', // 数据库类型 'DB_HOST' => '127.0.0.1', // 服务器地址 'DB_NAME' => 'minecraft', // 数据库名 - 'DB_USER' => 'minecraft', // 用户名 - 'DB_PWD' => '325325', // 密码 + 'DB_USER' => 'root', // 用户名 + 'DB_PWD' => 'root', // 密码 'DB_PORT' => 3306, // 端口 'DB_PREFIX' => '', // 数据库表前缀 'DB_CHARSET' => 'utf8' diff --git a/Application/Home/Controller/IndexController.class.php b/Application/Home/Controller/IndexController.class.php index a66e027..a8bee21 100644 --- a/Application/Home/Controller/IndexController.class.php +++ b/Application/Home/Controller/IndexController.class.php @@ -4,8 +4,8 @@ use Think\Controller; class IndexController extends Controller { public function index(){ $data=M('authme')->select(); + dump($data); $this->data->$data; $this->display(); - //$this->show('

:)

欢迎使用 ThinkPHP


版本 V{$Think.version}
','utf-8'); } } \ No newline at end of file diff --git a/Application/Home/Controller/UserController.class.php b/Application/Home/Controller/UserController.class.php new file mode 100644 index 0000000..3c2ff54 --- /dev/null +++ b/Application/Home/Controller/UserController.class.php @@ -0,0 +1,67 @@ +select (); + dump ( $data ); + $this->data->$data; + $this->display (); + // $this->show('

:)

欢迎使用 ThinkPHP


版本 V{$Think.version}
','utf-8'); + } + public function Login($username, $password) { + $data = M ( 'authme' )->where ( array ( + 'username' => $username, + 'password' => $password + ) )->find (); + if ($data != null) { + $this->ajaxReturn ( array ( + status => 1, + msg => "登录成功!" + ) ); + } else { + $this->ajaxReturn ( array ( + status => 0, + msg => "登录失败 用户名或密码错误!" + ) ); + } + } + public function Register($username, $password, $ip = '127.0.0.1', $mail = 'authme@citycraft.cn') { + $modelAuthMe = M ( 'authme' ); + $result = $modelAuthMe->where ( array ( + username => $username + ) )->find (); + if ($result != null) { + $this->ajaxReturn ( array ( + status => 0, + msg => "注册失败,用户已存在!" + ) ); + } + $value = array ( + 'username' => $username, + 'password' => $password, + 'ip' => $ip, + 'lastlogin' => '', + 'x' => '0', + 'y' => '0', + 'z' => '0', + 'world' => 'world', + 'email' => $mail + ); + $result = $modelAuthMe->save ( $value ); + if ($result) { + $this->ajaxReturn ( array ( + status => 1, + msg => "注册成功!" + ) ); + } else { + $this->ajaxReturn ( array ( + status => 0, + msg => "注册失败!" + ) ); + } + } +} \ No newline at end of file