切换导航条
此项目
正在载入...
登录
何书鹏
/
anttest
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
5 years ago
提交
077eebec86670c848c3ed9cfb2f8c7a1c5caeeb5
1 个父辈
36d762fc
优化前台退出文字
修复分页搜索BUG
隐藏空白字符变更
内嵌
并排对比
正在显示
20 个修改的文件
包含
53 行增加
和
74 行删除
application/admin/command/Crud/stubs/controllerindex.stub
application/admin/controller/Index.php
application/admin/controller/auth/Admin.php
application/admin/controller/auth/Adminlog.php
application/admin/controller/general/Attachment.php
application/admin/controller/general/Profile.php
application/admin/controller/user/User.php
application/admin/lang/zh-cn.php
application/admin/library/Auth.php
application/admin/library/traits/Backend.php
application/api/controller/User.php
application/api/lang/zh-cn.php
application/api/lang/zh-cn/user.php
application/common/controller/Backend.php
application/common/lang/zh-cn/addon.php
application/common/library/Auth.php
application/index/controller/User.php
application/index/lang/zh-cn.php
application/index/lang/zh-cn/user.php
public/api.html
application/admin/command/Crud/stubs/controllerindex.stub
查看文件 @
077eebe
...
...
@@ -19,8 +19,7 @@
{%relationWithList%}
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->paginate();
->paginate($limit);
foreach ($list as $row) {
{%visibleFieldList%}
...
...
application/admin/controller/Index.php
查看文件 @
077eebe
...
...
@@ -110,7 +110,7 @@ class Index extends Backend
}
/**
*
注销
登录
*
退出
登录
*/
public
function
logout
()
{
...
...
application/admin/controller/auth/Admin.php
查看文件 @
077eebe
...
...
@@ -67,6 +67,8 @@ class Admin extends Backend
*/
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if
(
$this
->
request
->
request
(
'keyField'
))
{
...
...
@@ -90,26 +92,21 @@ class Admin extends Backend
$adminGroupName
[
$this
->
auth
->
id
][
$n
[
'id'
]]
=
$n
[
'name'
];
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
->
where
(
$where
)
->
where
(
'id'
,
'in'
,
$this
->
childrenAdminIds
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$this
->
model
->
where
(
$where
)
->
where
(
'id'
,
'in'
,
$this
->
childrenAdminIds
)
->
field
([
'password'
,
'salt'
,
'token'
],
true
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
->
paginate
(
$limit
);
foreach
(
$list
as
$k
=>
&
$v
)
{
$groups
=
isset
(
$adminGroupName
[
$v
[
'id'
]])
?
$adminGroupName
[
$v
[
'id'
]]
:
[];
$v
[
'groups'
]
=
implode
(
','
,
array_keys
(
$groups
));
$v
[
'groups_text'
]
=
implode
(
','
,
array_values
(
$groups
));
}
unset
(
$v
);
$result
=
array
(
"total"
=>
$
total
,
"rows"
=>
$list
);
$result
=
array
(
"total"
=>
$
list
->
total
(),
"rows"
=>
$list
->
items
()
);
return
json
(
$result
);
}
...
...
application/admin/controller/auth/Adminlog.php
查看文件 @
077eebe
...
...
@@ -40,21 +40,17 @@ class Adminlog extends Backend
*/
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
->
where
(
$where
)
->
where
(
'admin_id'
,
'in'
,
$this
->
childrenAdminIds
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$this
->
model
->
where
(
$where
)
->
where
(
'admin_id'
,
'in'
,
$this
->
childrenAdminIds
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
$result
=
array
(
"total"
=>
$total
,
"rows"
=>
$list
);
->
paginate
(
$limit
);
$result
=
array
(
"total"
=>
$list
->
total
(),
"rows"
=>
$list
->
items
());
return
json
(
$result
);
}
...
...
application/admin/controller/general/Attachment.php
查看文件 @
077eebe
...
...
@@ -31,7 +31,7 @@ class Attachment extends Backend
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
]);
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
$mimetypeQuery
=
[];
$filter
=
$this
->
request
->
request
(
'filter'
);
...
...
@@ -51,24 +51,19 @@ class Attachment extends Backend
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
->
where
(
$mimetypeQuery
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$this
->
model
->
where
(
$mimetypeQuery
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
->
paginate
(
$limit
);
$cdnurl
=
preg_replace
(
"/\/(\w+)\.php$/i"
,
''
,
$this
->
request
->
root
());
foreach
(
$list
as
$k
=>
&
$v
)
{
$v
[
'fullurl'
]
=
(
$v
[
'storage'
]
==
'local'
?
$cdnurl
:
$this
->
view
->
config
[
'upload'
][
'cdnurl'
])
.
$v
[
'url'
];
}
unset
(
$v
);
$result
=
array
(
"total"
=>
$
total
,
"rows"
=>
$list
);
$result
=
array
(
"total"
=>
$
list
->
total
(),
"rows"
=>
$list
->
items
()
);
return
json
(
$result
);
}
...
...
application/admin/controller/general/Profile.php
查看文件 @
077eebe
...
...
@@ -22,25 +22,18 @@ class Profile extends Backend
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
]);
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
$model
=
model
(
'AdminLog'
);
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$model
->
where
(
$where
)
->
where
(
'admin_id'
,
$this
->
auth
->
id
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$model
->
where
(
$where
)
->
where
(
'admin_id'
,
$this
->
auth
->
id
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
->
paginate
(
$limit
);
$result
=
array
(
"total"
=>
$
total
,
"rows"
=>
$list
);
$result
=
array
(
"total"
=>
$
list
->
total
(),
"rows"
=>
$list
->
items
()
);
return
json
(
$result
);
}
...
...
application/admin/controller/user/User.php
查看文件 @
077eebe
...
...
@@ -33,29 +33,23 @@ class User extends Backend
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
]);
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if
(
$this
->
request
->
request
(
'keyField'
))
{
return
$this
->
selectpage
();
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
->
with
(
'group'
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$this
->
model
->
with
(
'group'
)
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
->
paginate
(
$limit
);
foreach
(
$list
as
$k
=>
$v
)
{
$v
->
avatar
=
$v
->
avatar
?
cdnurl
(
$v
->
avatar
,
true
)
:
letter_avatar
(
$v
->
nickname
);
$v
->
hidden
([
'password'
,
'salt'
]);
}
$result
=
array
(
"total"
=>
$
total
,
"rows"
=>
$list
);
$result
=
array
(
"total"
=>
$
list
->
total
(),
"rows"
=>
$list
->
items
()
);
return
json
(
$result
);
}
...
...
application/admin/lang/zh-cn.php
查看文件 @
077eebe
...
...
@@ -7,7 +7,7 @@ return [
'Password'
=>
'密码'
,
'Sign up'
=>
'注 册'
,
'Sign in'
=>
'登 录'
,
'Sign out'
=>
'
注 销
'
,
'Sign out'
=>
'
退 出
'
,
'Keep login'
=>
'保持会话'
,
'Guest'
=>
'游客'
,
'Welcome'
=>
'%s,你好!'
,
...
...
@@ -69,7 +69,7 @@ return [
'Home'
=>
'主页'
,
'Online'
=>
'在线'
,
'Login'
=>
'登录'
,
'Logout'
=>
'
注销
'
,
'Logout'
=>
'
退出
'
,
'Profile'
=>
'个人资料'
,
'Index'
=>
'首页'
,
'Hot'
=>
'热门'
,
...
...
application/admin/library/Auth.php
查看文件 @
077eebe
...
...
@@ -68,7 +68,7 @@ class Auth extends \fast\Auth
}
/**
*
注销
登录
*
退出
登录
*/
public
function
logout
()
{
...
...
application/admin/library/traits/Backend.php
查看文件 @
077eebe
...
...
@@ -43,7 +43,7 @@ trait Backend
public
function
index
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
]);
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if
(
$this
->
request
->
request
(
'keyField'
))
{
...
...
@@ -54,8 +54,7 @@ trait Backend
$list
=
$this
->
model
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
paginate
();
->
paginate
(
$limit
);
$result
=
array
(
"total"
=>
$list
->
total
(),
"rows"
=>
$list
->
items
());
...
...
application/api/controller/User.php
查看文件 @
077eebe
...
...
@@ -128,7 +128,7 @@ class User extends Api
}
/**
*
注销
登录
*
退出
登录
*/
public
function
logout
()
{
...
...
application/api/lang/zh-cn.php
查看文件 @
077eebe
...
...
@@ -8,7 +8,7 @@ return [
'Password'
=>
'密码'
,
'Sign up'
=>
'注 册'
,
'Sign in'
=>
'登 录'
,
'Sign out'
=>
'
注 销
'
,
'Sign out'
=>
'
退 出
'
,
'Guest'
=>
'游客'
,
'Welcome'
=>
'%s,你好!'
,
'Add'
=>
'添加'
,
...
...
@@ -42,7 +42,7 @@ return [
'None'
=>
'无'
,
'Home'
=>
'主页'
,
'Online'
=>
'在线'
,
'Logout'
=>
'
注销
'
,
'Logout'
=>
'
退出
'
,
'Profile'
=>
'个人资料'
,
'Index'
=>
'首页'
,
'Hot'
=>
'热门'
,
...
...
application/api/lang/zh-cn/user.php
查看文件 @
077eebe
...
...
@@ -29,7 +29,7 @@ return [
'Change password'
=>
'修改密码'
,
'Captcha is incorrect'
=>
'验证码不正确'
,
'Logged in successful'
=>
'登录成功'
,
'Logout successful'
=>
'
注销
成功'
,
'Logout successful'
=>
'
退出
成功'
,
'Operation failed'
=>
'操作失败'
,
'Invalid parameters'
=>
'参数不正确'
,
'Change password failure'
=>
'修改密码失败'
,
...
...
application/common/controller/Backend.php
查看文件 @
077eebe
...
...
@@ -261,8 +261,14 @@ class Backend extends Controller
$op
=
$this
->
request
->
get
(
"op"
,
''
,
'trim'
);
$sort
=
$this
->
request
->
get
(
"sort"
,
!
empty
(
$this
->
model
)
&&
$this
->
model
->
getPk
()
?
$this
->
model
->
getPk
()
:
'id'
);
$order
=
$this
->
request
->
get
(
"order"
,
"DESC"
);
$offset
=
$this
->
request
->
get
(
"offset"
,
0
);
$limit
=
$this
->
request
->
get
(
"limit"
,
0
);
$offset
=
$this
->
request
->
get
(
"offset/d"
,
0
);
$limit
=
$this
->
request
->
get
(
"limit/d"
,
10
);
//新增自动计算页码
$page
=
$limit
?
intval
(
$offset
/
$limit
)
+
1
:
1
;
if
(
$this
->
request
->
has
(
"page"
))
{
$page
=
$this
->
request
->
get
(
"page/d"
,
1
);
}
$this
->
request
->
get
([
config
(
'paginate.var_page'
)
=>
$page
]);
$filter
=
(
array
)
json_decode
(
$filter
,
true
);
$op
=
(
array
)
json_decode
(
$op
,
true
);
$filter
=
$filter
?
$filter
:
[];
...
...
@@ -404,7 +410,7 @@ class Backend extends Controller
}
}
};
return
[
$where
,
$sort
,
$order
,
$offset
,
$limit
];
return
[
$where
,
$sort
,
$order
,
$offset
,
$limit
,
$page
];
}
/**
...
...
application/common/lang/zh-cn/addon.php
查看文件 @
077eebe
...
...
@@ -14,7 +14,7 @@ return [
'Password'
=>
'密码'
,
'Sign up'
=>
'注 册'
,
'Sign in'
=>
'登 录'
,
'Sign out'
=>
'
注 销
'
,
'Sign out'
=>
'
退 出
'
,
'Guest'
=>
'游客'
,
'Welcome'
=>
'%s,你好!'
,
'Add'
=>
'添加'
,
...
...
@@ -47,7 +47,7 @@ return [
'Last'
=>
'末页'
,
'None'
=>
'无'
,
'Online'
=>
'在线'
,
'Logout'
=>
'
注销
'
,
'Logout'
=>
'
退出
'
,
'Profile'
=>
'个人资料'
,
'Index'
=>
'首页'
,
'Hot'
=>
'热门'
,
...
...
application/common/library/Auth.php
查看文件 @
077eebe
...
...
@@ -225,7 +225,7 @@ class Auth
}
/**
*
注销
*
退出
*
* @return boolean
*/
...
...
@@ -239,7 +239,7 @@ class Auth
$this
->
_logined
=
false
;
//删除Token
Token
::
delete
(
$this
->
_token
);
//
注销
成功的事件
//
退出
成功的事件
Hook
::
listen
(
"user_logout_successed"
,
$this
->
_user
);
return
true
;
}
...
...
application/index/controller/User.php
查看文件 @
077eebe
...
...
@@ -31,7 +31,7 @@ class User extends Frontend
$this
->
error
(
__
(
'User center already closed'
));
}
//监听注册登录
注销
的事件
//监听注册登录
退出
的事件
Hook
::
add
(
'user_login_successed'
,
function
(
$user
)
use
(
$auth
)
{
$expire
=
input
(
'post.keeplogin'
)
?
30
*
86400
:
0
;
Cookie
::
set
(
'uid'
,
$user
->
id
,
$expire
);
...
...
@@ -208,11 +208,11 @@ class User extends Frontend
}
/**
*
注销
登录
*
退出
登录
*/
public
function
logout
()
{
//
注销
本站
//
退出
本站
$this
->
auth
->
logout
();
$this
->
success
(
__
(
'Logout successful'
),
url
(
'user/index'
));
}
...
...
application/index/lang/zh-cn.php
查看文件 @
077eebe
...
...
@@ -9,7 +9,7 @@ return [
'Password'
=>
'密码'
,
'Sign up'
=>
'注 册'
,
'Sign in'
=>
'登 录'
,
'Sign out'
=>
'
注 销
'
,
'Sign out'
=>
'
退 出
'
,
'Guest'
=>
'游客'
,
'Welcome'
=>
'%s,你好!'
,
'Add'
=>
'添加'
,
...
...
@@ -44,7 +44,7 @@ return [
'Last'
=>
'末页'
,
'None'
=>
'无'
,
'Online'
=>
'在线'
,
'Logout'
=>
'
注销
'
,
'Logout'
=>
'
退出
'
,
'Profile'
=>
'个人资料'
,
'Index'
=>
'首页'
,
'Hot'
=>
'热门'
,
...
...
application/index/lang/zh-cn/user.php
查看文件 @
077eebe
...
...
@@ -56,7 +56,7 @@ return [
'Change password successful'
=>
'修改密码成功'
,
'Captcha is incorrect'
=>
'验证码不正确'
,
'Logged in successful'
=>
'登录成功'
,
'Logout successful'
=>
'
注销
成功'
,
'Logout successful'
=>
'
退出
成功'
,
'User center already closed'
=>
'会员中心已经关闭'
,
'Operation failed'
=>
'操作失败'
,
'Invalid parameters'
=>
'参数不正确'
,
...
...
public/api.html
查看文件 @
077eebe
...
...
@@ -175,7 +175,7 @@
<a
href=
"javascript:;"
data-id=
"14"
class=
"list-group-item"
>
会员登录
</a>
<a
href=
"javascript:;"
data-id=
"15"
class=
"list-group-item"
>
手机验证码登录
</a>
<a
href=
"javascript:;"
data-id=
"16"
class=
"list-group-item"
>
注册会员
</a>
<a
href=
"javascript:;"
data-id=
"17"
class=
"list-group-item"
>
注销
登录
</a>
<a
href=
"javascript:;"
data-id=
"17"
class=
"list-group-item"
>
退出
登录
</a>
<a
href=
"javascript:;"
data-id=
"18"
class=
"list-group-item"
>
修改会员个人信息
</a>
<a
href=
"javascript:;"
data-id=
"19"
class=
"list-group-item"
>
修改邮箱
</a>
<a
href=
"javascript:;"
data-id=
"20"
class=
"list-group-item"
>
修改手机号
</a>
...
...
@@ -2174,7 +2174,7 @@
<div
class=
"panel-heading"
id=
"heading-17"
>
<h4
class=
"panel-title"
>
<span
class=
"label label-success"
>
GET
</span>
<a
data-toggle=
"collapse"
data-parent=
"#accordion17"
href=
"#collapseOne17"
>
注销
登录
<span
class=
"text-muted"
>
/api/user/logout
</span></a>
<a
data-toggle=
"collapse"
data-parent=
"#accordion17"
href=
"#collapseOne17"
>
退出
登录
<span
class=
"text-muted"
>
/api/user/logout
</span></a>
</h4>
</div>
<div
id=
"collapseOne17"
class=
"panel-collapse collapse"
>
...
...
@@ -2192,7 +2192,7 @@
<div
class=
"tab-pane active"
id=
"info17"
>
<div
class=
"well"
>
注销
登录
</div>
退出
登录
</div>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
><strong>
Headers
</strong></div>
<div
class=
"panel-body"
>
...
...
请
注册
或
登录
后发表评论