切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
7 years ago
提交
f2152bee1f530386ab87a572d43f654ce2e70709
1 个父辈
a8567643
新增后台3次登录失败后1天以后才可再次尝试
新增Config中多个变量供JS中使用 修复分类管理在使用CRUD一键生成关联模型后的BUG 修复后台管理员selectpage编辑时的BUG
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
22 行增加
和
7 行删除
application/admin/controller/Category.php
application/admin/controller/auth/Admin.php
application/admin/library/Auth.php
application/common/controller/Backend.php
application/common/controller/Frontend.php
public/assets/js/backend/auth/rule.js
application/admin/controller/Category.php
查看文件 @
f2152be
...
...
@@ -23,7 +23,7 @@ class Category extends Backend
{
parent
::
_initialize
();
$this
->
request
->
filter
([
'strip_tags'
]);
$this
->
model
=
model
(
'Category'
);
$this
->
model
=
model
(
'
app\common\model\
Category'
);
$tree
=
Tree
::
instance
();
$tree
->
init
(
collection
(
$this
->
model
->
order
(
'weigh desc,id desc'
)
->
select
())
->
toArray
(),
'pid'
);
...
...
application/admin/controller/auth/Admin.php
查看文件 @
f2152be
...
...
@@ -257,6 +257,7 @@ class Admin extends Backend
protected
function
selectpage
()
{
$this
->
dataLimit
=
'auth'
;
$this
->
dataLimitField
=
'id'
;
return
parent
::
selectpage
();
}
...
...
application/admin/library/Auth.php
查看文件 @
f2152be
...
...
@@ -27,6 +27,14 @@ class Auth extends \fast\Auth
return
Session
::
get
(
'admin.'
.
$name
);
}
/**
* 管理员登录
*
* @param string $username 用户名
* @param string $password 密码
* @param int $keeptime 有效时长
* @return boolean
*/
public
function
login
(
$username
,
$password
,
$keeptime
=
0
)
{
$admin
=
Admin
::
get
([
'username'
=>
$username
]);
...
...
@@ -34,6 +42,10 @@ class Auth extends \fast\Auth
{
return
false
;
}
if
(
$admin
->
loginfailure
>=
3
&&
time
()
-
$admin
->
updatetime
<
86400
)
{
return
false
;
}
if
(
$admin
->
password
!=
md5
(
md5
(
$password
)
.
$admin
->
salt
))
{
$admin
->
loginfailure
++
;
...
...
@@ -103,8 +115,9 @@ class Auth extends \fast\Auth
/**
* 刷新保持登录的Cookie
* @param int $keeptime
* @return boolean
*
* @param int $keeptime
* @return boolean
*/
protected
function
keeplogin
(
$keeptime
=
0
)
{
...
...
@@ -167,7 +180,6 @@ class Auth extends \fast\Auth
//判断是否同一时间同一账号只能在一个地方登录
if
(
Config
::
get
(
'fastadmin.login_unique'
))
{
$my
=
Admin
::
get
(
$admin
[
'id'
]);
if
(
!
$my
||
$my
[
'token'
]
!=
$admin
[
'token'
])
{
...
...
application/common/controller/Backend.php
查看文件 @
f2152be
...
...
@@ -61,7 +61,7 @@ class Backend extends Controller
* 数据限制字段
*/
protected
$dataLimitField
=
'admin_id'
;
/**
* 数据限制开启时自动填充限制字段值
*/
...
...
@@ -171,7 +171,7 @@ class Backend extends Controller
// 配置信息
$config
=
[
'site'
=>
array_intersect_key
(
$site
,
array_flip
([
'name'
,
'cdnurl'
,
'version'
,
'timezone'
,
'languages'
])),
'site'
=>
array_intersect_key
(
$site
,
array_flip
([
'name'
,
'
indexurl'
,
'
cdnurl'
,
'version'
,
'timezone'
,
'languages'
])),
'upload'
=>
$upload
,
'modulename'
=>
$modulename
,
'controllername'
=>
$controllername
,
...
...
@@ -182,6 +182,7 @@ class Backend extends Controller
'fastadmin'
=>
Config
::
get
(
'fastadmin'
),
'referer'
=>
Session
::
get
(
"referer"
)
];
$config
=
array_merge
(
$config
,
Config
::
get
(
"view_replace_str"
));
Config
::
set
(
'upload'
,
array_merge
(
Config
::
get
(
'upload'
),
$upload
));
...
...
application/common/controller/Frontend.php
查看文件 @
f2152be
...
...
@@ -116,6 +116,7 @@ class Frontend extends Controller
'moduleurl'
=>
rtrim
(
url
(
"/
{
$modulename
}
"
,
''
,
false
),
'/'
),
'language'
=>
$lang
];
$config
=
array_merge
(
$config
,
Config
::
get
(
"view_replace_str"
));
Config
::
set
(
'upload'
,
array_merge
(
Config
::
get
(
'upload'
),
$upload
));
...
...
public/assets/js/backend/auth/rule.js
查看文件 @
f2152be
...
...
@@ -111,7 +111,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
name
.
prop
(
"placeholder"
,
$
(
this
).
val
()
==
1
?
name
.
data
(
"placeholder-menu"
)
:
name
.
data
(
"placeholder-node"
));
});
$
(
"input[name='row[ismenu]']:checked"
).
trigger
(
"click"
);
var
iconlist
=
[];
Form
.
api
.
bindevent
(
$
(
"form[role=form]"
));
$
(
document
).
on
(
'click'
,
".btn-search-icon"
,
function
()
{
...
...
请
注册
或
登录
后发表评论