diff --git a/说明.txt b/README.txt similarity index 77% rename from 说明.txt rename to README.txt index 82eb76d..543cca1 100644 --- a/说明.txt +++ b/README.txt @@ -2,7 +2,7 @@ git clone https://github.com/Fanli2012/lqycms.git cmd´.envļ -echo test > .env +echo hello > .env ˵ @@ -44,6 +44,15 @@ return $qrcode->size(500)->generate('Make a qrcode without Laravel!'); ֱʾɶάͼƬreturn ''; +composer.phar installװproc_open󣬽취 +޸composer.jsonscriptsµ"php artisan optimize"Ϊ"php artisan clear-compiled" + + +composerйȫ޸ +ĿĸĿ¼Ҳ composer.json ļĿ¼ִ +composer config repo.packagist composer https://packagist.phpcomposer.com + + ΢ſ֧ https://easywechat.org/ diff --git a/app/Http/Controllers/Admin/LoginController.php b/app/Http/Controllers/Admin/LoginController.php index 041acb6..21e00c1 100644 --- a/app/Http/Controllers/Admin/LoginController.php +++ b/app/Http/Controllers/Admin/LoginController.php @@ -36,7 +36,9 @@ class LoginController extends BaseController if(!empty($_POST["username"])){$username = $_POST["username"];}else{$username='';exit;}//用户名 if(!empty($_POST["pwd"])){$pwd = md5($_POST["pwd"]);}else{$pwd='';exit;}//密码 - $admin_user = DB::table('admin')->where(array('username' => $username, 'pwd' => $pwd))->orWhere(array('email' => $username, 'pwd' => $pwd))->first(); + $admin_user = DB::table('admin')->where(array('username' => $username, 'pwd' => $pwd))->orWhere(function ($query) use ($username, $pwd) { + $query->where('email', '=', $username)->where('pwd', '=', $pwd); + })->first(); if($admin_user) { @@ -49,10 +51,8 @@ class LoginController extends BaseController return redirect()->route('admin'); } - else - { - return redirect()->route('admin_login'); - } + + error_jump('账号或密码错误', route('admin_login')); } //退出登录 @@ -73,10 +73,8 @@ class LoginController extends BaseController { success_jump('密码恢复成功', route('admin_login')); } - else - { - error_jump('密码恢复失败', route('home')); - } + + error_jump('密码恢复失败', route('home')); } /** diff --git a/composer.json b/composer.json index ed4ea78..03f3e1c 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "Tests\\": "tests/" } }, - "scripts": { + "scripts": { "post-root-package-install": [ "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], @@ -45,16 +45,22 @@ ], "post-install-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postInstall", - "php artisan optimize" + "php artisan clear-compiled" ], "post-update-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postUpdate", - "php artisan optimize" + "php artisan clear-compiled" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true + }, + "repositories": { + "packagist": { + "type": "composer", + "url": "https://packagist.phpcomposer.com" + } } -} \ No newline at end of file +}