Skip to content

Commit

Permalink
增加验证码
Browse files Browse the repository at this point in the history
  • Loading branch information
leeqvip committed Dec 27, 2018
1 parent 9113523 commit 23819fe
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 38 deletions.
8 changes: 6 additions & 2 deletions resource/view/auth/passport/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
<div class="tpl-login-content">
<form class="am-form tpl-form-line-form" method="post" data-am-validator>
<div class="am-form-group">
<input type="text" class="tpl-form-input" id="user-name" name="admin_account" placeholder="请输入账号" required="">
<input type="text" class="tpl-form-input" id="user-name" name="admin_account" placeholder="请输入账号" required>
</div>
<div class="am-form-group">
<input type="password" class="tpl-form-input" id="user-password" name="admin_password" placeholder="请输入密码" required="">
<input type="password" class="tpl-form-input" id="user-password" name="admin_password" placeholder="请输入密码" required>
</div>
<div class="am-form-group">
<input type="text" class="tpl-form-input" id="user-code" name="captcha" placeholder="验证码" required style="width: 60%;float: left;">
<img src="{:captcha_src()}" alt="captcha" id="user-code-img" style="width: 40%;height: 32px;float: left;" onclick="this.src=this.src+'?t='+Math.random()" />
</div>
<div class="am-form-group">
<button type="submit" class="am-btn am-btn-primary am-btn-block tpl-btn-bg-color-success tpl-login-btn">提交</button>
Expand Down
4 changes: 2 additions & 2 deletions src/controller/Advertising.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
use tadmin\model\Advertising as AdvertisingModel;
use tadmin\model\AdvertisingBlock;
use tadmin\service\upload\contract\Factory as Uploader;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Advertising extends AbstractController
class Advertising extends Controller
{
protected $model;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/AdvertisingBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller;

use tadmin\model\AdvertisingBlock as AdvertisingBlockModel;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class AdvertisingBlock extends AbstractController
class AdvertisingBlock extends Controller
{
protected $model;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use tadmin\model\Category;
use tadmin\model\Tag;
use tadmin\service\upload\contract\Factory as Uploader;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Article extends AbstractController
class Article extends Controller
{
protected $article;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller;

use tadmin\model\Category as CategoryModel;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Category extends AbstractController
class Category extends Controller
{
protected $category;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller;

use tadmin\model\Config as ConfigModel;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Config extends AbstractController
class Config extends Controller
{
protected $config;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use tadmin\model\Article;
use tadmin\model\OperationLog;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;

class Index extends AbstractController
class Index extends Controller
{
protected $operationLog;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use tadmin\model\Job as JobModel;
use tadmin\model\JobResume;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Job extends AbstractController
class Job extends Controller
{
protected $job;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
use tadmin\model\Link as LinkModel;
use tadmin\model\LinkBlock;
use tadmin\service\upload\contract\Factory as Uploader;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Link extends AbstractController
class Link extends Controller
{
protected $model;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/LinkBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller;

use tadmin\model\LinkBlock as LinkBlockModel;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class LinkBlock extends AbstractController
class LinkBlock extends Controller
{
protected $model;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller;

use tadmin\model\MessageBoard;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Message extends AbstractController
class Message extends Controller
{
protected $model;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller;

use tadmin\model\Nav as NavModel;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Nav extends AbstractController
class Nav extends Controller
{
protected $model;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/Single.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
use tadmin\model\Category;
use tadmin\model\Single as SingleModel;
use tadmin\service\upload\contract\Factory as Uploader;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Single extends AbstractController
class Single extends Controller
{
protected $single;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/auth/Adminer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use tadmin\model\Adminer as AdminerModel;
use tadmin\model\Role;
use tadmin\service\upload\contract\Factory as Uploader;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\exception\ValidateException;
use think\facade\Validate;
use think\Request;

class Adminer extends AbstractController
class Adminer extends Controller
{
protected $adminer;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/auth/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace tadmin\controller\auth;

use tadmin\model\OperationLog;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;

class Log extends AbstractController
class Log extends Controller
{
protected $operationLog;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/auth/Passport.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller\auth;

use tadmin\service\auth\contract\Auth;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Passport extends AbstractController
class Passport extends Controller
{
protected $auth;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/auth/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tadmin\controller\auth;

use tadmin\model\Permission as PermissionModel;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Permission extends AbstractController
class Permission extends Controller
{
protected $permission;

Expand Down
4 changes: 2 additions & 2 deletions src/controller/auth/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use tadmin\model\Permission;
use tadmin\model\Role as RoleModel;
use tadmin\support\controller\AbstractController;
use tadmin\support\controller\Controller;
use think\Request;

class Role extends AbstractController
class Role extends Controller
{
protected $role;

Expand Down
1 change: 1 addition & 0 deletions src/service/auth/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected function validate(array $data = [])
$validate = Validate::make([
'admin_account' => 'require|max:25',
'admin_password' => 'require|max:25',
'captcha|验证码' => 'require|captcha',
], [
'admin_account.require' => '登录名必须',
'admin_account.max' => '登录名最多不能超过25个字符',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use tadmin\model\Menu;
use tadmin\service\auth\facade\Auth;
use think\Container;
use think\Controller;
use think\Controller as ThinkController;
use think\facade\Config;
use think\Console;
use think\Loader;

abstract class AbstractController extends Controller
abstract class Controller extends ThinkController
{
protected $viewPath = '';

Expand Down

0 comments on commit 23819fe

Please sign in to comment.