切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
5 years ago
提交
9ddcb1953fa451f5eedc98b24e7edad38835e9e5
1 个父辈
da4402b4
新增会员中心边栏高亮检查方法
优化跨域检测方法
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
23 行增加
和
10 行删除
application/common.php
application/common/controller/Api.php
application/common/view/tpl/think_exception.tpl
application/index/view/common/sidenav.html
application/common.php
查看文件 @
9ddcb19
...
...
@@ -363,11 +363,24 @@ if (!function_exists('hsv2rgb')) {
}
}
if
(
!
function_exists
(
'c
ors_request_check
'
))
{
if
(
!
function_exists
(
'c
heck_nav_active
'
))
{
/**
* 跨域检测
*/
function
cors_request_check
()
function
check_nav_active
(
$url
,
$classname
=
'active'
)
{
$auth
=
\app\common\library\Auth
::
instance
();
$requestUrl
=
$auth
->
getRequestUri
();
$url
=
ltrim
(
$url
,
'/'
);
return
$requestUrl
===
str_replace
(
"."
,
"/"
,
$url
)
?
$classname
:
''
;
}
}
if
(
!
function_exists
(
'check_cors_request'
))
{
/**
* 跨域检测
*/
function
check_cors_request
()
{
if
(
isset
(
$_SERVER
[
'HTTP_ORIGIN'
])
&&
$_SERVER
[
'HTTP_ORIGIN'
])
{
$info
=
parse_url
(
$_SERVER
[
'HTTP_ORIGIN'
]);
...
...
application/common/controller/Api.php
查看文件 @
9ddcb19
...
...
@@ -92,7 +92,7 @@ class Api
protected
function
_initialize
()
{
//跨域请求检测
c
ors_request_check
();
c
heck_cors_request
();
//移除HTML标签
$this
->
request
->
filter
(
'trim,strip_tags,htmlspecialchars'
);
...
...
application/common/view/tpl/think_exception.tpl
查看文件 @
9ddcb19
<?php
$cdnurl = function_exists('config') ? config('view_replace_str.__CDN__') : '';
$publicurl = function_exists('config') ?
config('view_replace_str.__PUBLIC__
') : '/';
$publicurl = function_exists('config') ?
(config('view_replace_str.__PUBLIC__')?:'/
') : '/';
$debug = function_exists('config') ? config('app_debug') : false;
$lang = [
...
...
@@ -98,4 +98,4 @@ $langSet == 'en' && $lang = array_combine(array_keys($lang), array_keys($lang));
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
...
...
application/index/view/common/sidenav.html
查看文件 @
9ddcb19
...
...
@@ -2,10 +2,10 @@
{:hook('user_sidenav_before')}
<ul
class=
"list-group"
>
<li
class=
"list-group-heading"
>
{:__('Member center')}
</li>
<li
class=
"list-group-item {:$config['actionname']=='index'?'active':''}"
>
<a
href=
"{:url('user/index')}"
><i
class=
"fa fa-user-circle fa-fw"
></i>
{:__('User center')}
</a>
</li>
<li
class=
"list-group-item {:$config['actionname']=='profile'?'active':''}"
>
<a
href=
"{:url('user/profile')}"
><i
class=
"fa fa-user-o fa-fw"
></i>
{:__('Profile')}
</a>
</li>
<li
class=
"list-group-item {:$config['actionname']=='changepwd'?'active':''}"
>
<a
href=
"{:url('user/changepwd')}"
><i
class=
"fa fa-key fa-fw"
></i>
{:__('Change password')}
</a>
</li>
<li
class=
"list-group-item {:$config['actionname']=='logout'?'active':''}"
>
<a
href=
"{:url('user/logout')}"
><i
class=
"fa fa-sign-out fa-fw"
></i>
{:__('Sign out')}
</a>
</li>
<li
class=
"list-group-item {:check_nav_active('user/index')}"
>
<a
href=
"{:url('user/index')}"
><i
class=
"fa fa-user-circle fa-fw"
></i>
{:__('User center')}
</a>
</li>
<li
class=
"list-group-item {:check_nav_active('user/profile')}"
>
<a
href=
"{:url('user/profile')}"
><i
class=
"fa fa-user-o fa-fw"
></i>
{:__('Profile')}
</a>
</li>
<li
class=
"list-group-item {:check_nav_active('user/changepwd')}"
>
<a
href=
"{:url('user/changepwd')}"
><i
class=
"fa fa-key fa-fw"
></i>
{:__('Change password')}
</a>
</li>
<li
class=
"list-group-item {:check_nav_active('user/logout')}"
>
<a
href=
"{:url('user/logout')}"
><i
class=
"fa fa-sign-out fa-fw"
></i>
{:__('Sign out')}
</a>
</li>
</ul>
{:hook('user_sidenav_after')}
</div>
\ No newline at end of file
</div>
...
...
请
注册
或
登录
后发表评论