Browse Source

admin login bug

master
Fanli2012 6 years ago
parent
commit
d1b5ecaee2
  1. 11
      README.txt
  2. 14
      app/Http/Controllers/Admin/LoginController.php
  3. 10
      composer.json

11
说明.txt → 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 '<img src="data:image/png;base64,'.base64_encode(\QrCode::format('png')->encoding('UTF-8')->size(200)->generate('http://www.baidu.com/')).'">';
composer.phar install安装出现proc_open错误,解决办法
修改composer.json中scripts下的"php artisan optimize"为"php artisan clear-compiled"
composer中国全量镜像修改
进入项目的根目录(也就是 composer.json 文件所在目录),执行如下命令:
composer config repo.packagist composer https://packagist.phpcomposer.com
微信开发,支付
https://easywechat.org/

14
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,11 +73,9 @@ class LoginController extends BaseController
{
success_jump('密码恢复成功', route('admin_login'));
}
else
{
error_jump('密码恢复失败', route('home'));
}
}
/**
* 判断用户名是否存在

10
composer.json

@ -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"
}
}
}
Loading…
Cancel
Save