切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
8 years ago
提交
4abf8abe985a2def2c85450f0c9b69b3c6be4439
1 个父辈
75981bdb
新增自动计算__CDN__和cdnurl的值
修复在二级目录下和非伪静态下的脚本加载错误 移除subdomain参数
隐藏空白字符变更
内嵌
并排对比
正在显示
21 个修改的文件
包含
79 行增加
和
34 行删除
application/admin/library/Auth.php
application/admin/view/common/header.html
application/admin/view/common/menu.html
application/admin/view/index/login.html
application/common/behavior/Common.php
application/common/controller/Backend.php
application/common/controller/Frontend.php
application/index/view/index/index.html
application/tags.php
public/assets/css/backend-func.css
public/assets/css/backend.min.css
public/assets/js/backend.js
public/assets/js/backend/index.js
public/assets/js/backend/wechat/menu.js
public/assets/js/frontend.js
public/assets/js/frontend/demo.js
public/assets/js/require-backend.js
public/assets/js/require-backend.min.js
public/assets/js/require-frontend.js
public/assets/js/require-frontend.min.js
public/assets/less/backend-func.less
application/admin/library/Auth.php
查看文件 @
4abf8ab
...
...
@@ -214,12 +214,13 @@ class Auth extends \fast\Auth
$colorArr
=
[
'red'
,
'green'
,
'yellow'
,
'blue'
,
'teal'
,
'orange'
,
'purple'
];
$colorNums
=
count
(
$colorArr
);
$badgeList
=
[];
$module
=
request
()
->
module
();
// 生成菜单的badge
foreach
(
$params
as
$k
=>
$v
)
{
if
(
stripos
(
$k
,
'/'
)
===
false
)
{
$url
=
'/
admin
/'
.
$k
;
$url
=
'/
'
.
$module
.
'
/'
.
$k
;
}
else
{
...
...
@@ -249,7 +250,7 @@ class Auth extends \fast\Auth
$userRule
=
$this
->
getRuleList
();
$select_id
=
0
;
$dashboard
=
rtrim
(
url
(
'dashboard/'
),
'/'
)
;
$dashboard
=
'/'
.
$module
.
'/dashboard'
;
// 必须将结果集转换为数组
$ruleList
=
collection
(
model
(
'AuthRule'
)
->
where
(
'ismenu'
,
1
)
->
order
(
'weigh'
,
'desc'
)
->
cache
(
"__menu__"
)
->
select
())
->
toArray
();
foreach
(
$ruleList
as
$k
=>
&
$v
)
...
...
application/admin/view/common/header.html
查看文件 @
4abf8ab
...
...
@@ -61,13 +61,13 @@
<!-- 账号信息下拉框 -->
<li
class=
"dropdown user user-menu"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<img
src=
"{$admin.avatar}"
class=
"user-image"
alt=
"User Image"
>
<img
src=
"
__CDN__
{$admin.avatar}"
class=
"user-image"
alt=
"User Image"
>
<span
class=
"hidden-xs"
>
{$admin.nickname}
</span>
</a>
<ul
class=
"dropdown-menu"
>
<!-- User image -->
<li
class=
"user-header"
>
<img
src=
"{$admin.avatar}"
class=
"img-circle"
alt=
""
>
<img
src=
"
__CDN__
{$admin.avatar}"
class=
"img-circle"
alt=
""
>
<p>
{$admin.nickname}
...
...
@@ -91,7 +91,7 @@
<!-- Menu Footer-->
<li
class=
"user-footer"
>
<div
class=
"pull-left"
>
<a
href=
"{:
url('general.profile/index
')}"
class=
"btn btn-default btn-flat"
>
{:__('Profile')}
</a>
<a
href=
"{:
rtrim(url('general.profile/'),'/
')}"
class=
"btn btn-default btn-flat"
>
{:__('Profile')}
</a>
</div>
<div
class=
"pull-right"
>
<a
href=
"{:url('index/logout')}"
class=
"btn btn-default btn-flat"
>
{:__('Logout')}
</a>
...
...
application/admin/view/common/menu.html
查看文件 @
4abf8ab
...
...
@@ -3,7 +3,7 @@
<!-- Sidebar user panel -->
<div
class=
"user-panel hidden-xs"
>
<div
class=
"pull-left image"
>
<img
src=
"{$admin.avatar}"
class=
"img-circle"
/>
<img
src=
"
__CDN__
{$admin.avatar}"
class=
"img-circle"
/>
</div>
<div
class=
"pull-left info"
>
<p>
{$admin.nickname}
</p>
...
...
application/admin/view/index/login.html
查看文件 @
4abf8ab
...
...
@@ -66,7 +66,7 @@
<div
class=
"login-screen"
>
<div
class=
"well"
>
<div
class=
"login-form"
>
<img
id=
"profile-img"
class=
"profile-img-card"
src=
"/assets/img/avatar.png"
/>
<img
id=
"profile-img"
class=
"profile-img-card"
src=
"
__CDN__
/assets/img/avatar.png"
/>
<p
id=
"profile-name"
class=
"profile-name-card"
></p>
<form
action=
""
method=
"post"
id=
"login-form"
>
{:token()}
...
...
application/common/behavior/Common.php
0 → 100644
查看文件 @
4abf8ab
<?php
namespace
app\common\behavior
;
use
think\Config
;
class
Common
{
public
function
run
(
&
$params
)
{
$cdnurl
=
str_replace
(
'/index.php'
,
''
,
$params
->
root
());
// 如果未设置__CDN__则自动匹配得出
if
(
!
Config
::
get
(
'view_replace_str.__CDN__'
))
{
Config
::
set
(
'view_replace_str.__CDN__'
,
$cdnurl
);
}
// 如果未设置cdnurl则自动匹配得出
if
(
!
Config
::
get
(
'site.cdnurl'
))
{
Config
::
set
(
'site.cdnurl'
,
$cdnurl
);
}
}
}
...
...
application/common/controller/Backend.php
查看文件 @
4abf8ab
...
...
@@ -84,7 +84,11 @@ class Backend extends Controller
// 非选项卡时重定向
if
(
!
IS_AJAX
&&
!
IS_ADDTABS
&&
$controllername
!=
'index'
&&
$actionname
==
'index'
)
{
header
(
"location:"
.
url
(
'index/index#!'
.
urlencode
(
$this
->
request
->
baseUrl
()),
''
,
false
));
$url
=
$this
->
request
->
baseUrl
();
$start
=
stripos
(
$url
,
'index.php'
);
if
(
$start
!==
false
)
$url
=
substr
(
$url
,
0
,
$start
+
9
)
.
str_replace
(
'.'
,
'/'
,
substr
(
$url
,
$start
+
9
));
header
(
"location:"
.
url
(
'index/index#!'
.
urlencode
(
$url
),
''
,
false
));
exit
;
}
...
...
@@ -128,12 +132,11 @@ class Backend extends Controller
'controllername'
=>
$controllername
,
'actionname'
=>
$actionname
,
'jsname'
=>
'backend/'
.
str_replace
(
'.'
,
'/'
,
$controllername
),
'
subdomain'
=>
0
,
'
moduleurl'
=>
url
(
"/
{
$modulename
}
"
,
''
,
false
)
,
'language'
=>
$lang
];
Lang
::
load
(
APP_PATH
.
$modulename
.
'/lang/'
.
$lang
.
'/'
.
str_replace
(
'.'
,
'/'
,
$controllername
)
.
'.php'
);
$this
->
assign
(
'site'
,
Config
::
get
(
"site"
));
$this
->
assign
(
'config'
,
$config
);
...
...
application/common/controller/Frontend.php
查看文件 @
4abf8ab
...
...
@@ -59,11 +59,10 @@ class Frontend extends Controller
'controllername'
=>
$controllername
,
'actionname'
=>
$actionname
,
'jsname'
=>
'frontend/'
.
str_replace
(
'.'
,
'/'
,
$controllername
),
'
subdomain'
=>
0
,
'
moduleurl'
=>
url
(
"/
{
$modulename
}
"
,
''
,
false
)
,
'language'
=>
$lang
];
Lang
::
load
(
APP_PATH
.
$modulename
.
'/lang/'
.
$lang
.
'/'
.
str_replace
(
'.'
,
'/'
,
$controllername
)
.
'.php'
);
$this
->
assign
(
'site'
,
Config
::
get
(
"site"
));
$this
->
assign
(
'config'
,
$config
);
}
...
...
application/index/view/index/index.html
查看文件 @
4abf8ab
...
...
@@ -13,7 +13,7 @@
<div
class=
"row"
>
<div
class=
"col-sm-6 col-md-4"
>
<div
class=
"thumbnail"
>
<a
href=
"{:url('index/user/login')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"/assets/img/third.jpg"
data-holder-rendered=
"true"
></a>
<a
href=
"{:url('index/user/login')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"
__CDN__
/assets/img/third.jpg"
data-holder-rendered=
"true"
></a>
<div
class=
"caption"
>
<h3>
第三方登录
</h3>
<p>
FastAdmin中自带第三方登录扩展组件,包括微博登录、QQ登录、微信登录,可极速进行第三方登录的融合,同时系统中已提供注册登录的代码
</p>
...
...
@@ -23,7 +23,7 @@
</div>
<div
class=
"col-sm-6 col-md-4"
>
<div
class=
"thumbnail"
>
<a
href=
"{:url('index/user/login')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"/assets/img/ucenter.jpg"
data-holder-rendered=
"true"
></a>
<a
href=
"{:url('index/user/login')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"
__CDN__
/assets/img/ucenter.jpg"
data-holder-rendered=
"true"
></a>
<div
class=
"caption"
>
<h3>
Ucenter整合登录
</h3>
<p>
FastAdmin中基于Ucenter融合一套账号同步登录注册退出的方案,同时提供修改版Ucenter和Discuz论坛代码下载,同时适应于PHP7,此版本改动较大,建议适用于新系统的开发
</p>
...
...
@@ -33,7 +33,7 @@
</div>
<div
class=
"col-sm-6 col-md-4"
>
<div
class=
"thumbnail"
>
<a
href=
"{:url('index/demo/qrcode')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"/assets/img/qrcode.jpg"
data-holder-rendered=
"true"
></a>
<a
href=
"{:url('index/demo/qrcode')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"
__CDN__
/assets/img/qrcode.jpg"
data-holder-rendered=
"true"
></a>
<div
class=
"caption"
>
<h3>
二维码生成
</h3>
<p>
基于第三方组件增加了一个二维码的生成示例,可快速的调整文字、标签、Logo的大小、颜色、字体等等。此外还可对标签位置、容错率等进行相关设置。
</p>
...
...
@@ -43,7 +43,7 @@
</div>
<div
class=
"col-sm-6 col-md-4"
>
<div
class=
"thumbnail"
>
<a
href=
"{:url('index/demo/bootstrap')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"/assets/img/bootstrap.jpg"
data-holder-rendered=
"true"
></a>
<a
href=
"{:url('index/demo/bootstrap')}"
><img
style=
"height: 200px; width: 100%; display: block;"
src=
"
__CDN__
/assets/img/bootstrap.jpg"
data-holder-rendered=
"true"
></a>
<div
class=
"caption"
>
<h3>
Bootstrap组件
</h3>
<p>
由于FastAdmin对Bootstrap进行了大量的二次开发,对Bootstrap的组件样式有许多更改,你可以直接在这里预览到Bootstrap的部分组件
</p>
...
...
application/tags.php
查看文件 @
4abf8ab
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
...
...
@@ -8,7 +9,6 @@
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 应用行为扩展定义文件
return
[
// 应用初始化
...
...
@@ -16,7 +16,9 @@ return [
// 应用开始
'app_begin'
=>
[],
// 模块初始化
'module_init'
=>
[],
'module_init'
=>
[
'app\\common\\behavior\\Common'
,
],
// 操作开始执行
'action_begin'
=>
[],
// 视图内容过滤
...
...
public/assets/css/backend-func.css
查看文件 @
4abf8ab
...
...
@@ -33,6 +33,8 @@ body {
.tab-addtabs
.tab-pane
{
height
:
100%
;
width
:
100%
;
}
.tab-addtabs.ios-iframe-fix
.tab-pane
{
-webkit-overflow-scrolling
:
touch
;
overflow
:
auto
;
}
...
...
public/assets/css/backend.min.css
查看文件 @
4abf8ab
此 diff 太大无法显示。
public/assets/js/backend.js
查看文件 @
4abf8ab
...
...
@@ -56,7 +56,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($
if
(
url
.
substr
(
0
,
1
)
!==
"/"
)
{
var
r
=
new
RegExp
(
'^(?:[a-z]+:)?//'
,
'i'
);
if
(
!
r
.
test
(
url
))
{
url
=
(
Config
.
subdomain
==
"1"
?
""
:
"/"
+
Config
.
modulename
)
+
"/"
+
url
;
url
=
Config
.
moduleurl
+
"/"
+
url
;
}
}
return
url
;
...
...
public/assets/js/backend/index.js
查看文件 @
4abf8ab
...
...
@@ -62,6 +62,11 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'validator'], f
//绑定tabs事件
$
(
'#nav'
).
addtabs
({
iframeHeight
:
"100%"
});
//修复iOS下iframe无法滚动的BUG
if
(
/iPad|iPhone|iPod/
.
test
(
navigator
.
userAgent
)
&&
!
window
.
MSStream
)
{
$
(
".tab-addtabs"
).
addClass
(
"ios-iframe-fix"
);
}
if
(
location
.
hash
.
indexOf
(
"#!"
)
===
0
)
{
var
url
=
decodeURIComponent
(
location
.
hash
.
substring
(
2
));
//刷新页面后将左侧对应的LI展开
...
...
@@ -181,7 +186,6 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'validator'], f
// 切换子菜单显示和菜单小图标的显示
$
(
"[data-menu]"
).
on
(
'click'
,
function
()
{
console
.
log
(
$
(
this
).
data
(
"menu"
));
if
(
$
(
this
).
data
(
"menu"
)
==
'show-submenu'
)
{
$
(
"ul.sidebar-menu"
).
toggleClass
(
"show-submenu"
);
}
else
{
...
...
public/assets/js/backend/wechat/menu.js
查看文件 @
4abf8ab
...
...
@@ -121,7 +121,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'sortable'], function
}
else
if
(
false
)
{
}
console
.
log
(
currentItem
.
children
());
currentItem
.
children
(
"a"
).
find
(
"span"
).
text
(
title
.
subByte
(
0
,
16
));
$
(
"input[name='item-title']"
).
val
(
title
);
currentItem
.
attr
(
'data-name'
,
title
);
...
...
public/assets/js/frontend.js
查看文件 @
4abf8ab
...
...
@@ -56,7 +56,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'config'], function ($, undefi
if
(
url
.
substr
(
0
,
1
)
!==
"/"
)
{
var
r
=
new
RegExp
(
'^(?:[a-z]+:)?//'
,
'i'
);
if
(
!
r
.
test
(
url
))
{
url
=
(
Config
.
subdomain
==
"1"
?
""
:
"/"
+
Config
.
modulename
)
+
"/"
+
url
;
url
=
(
Config
.
moduleurl
)
+
"/"
+
url
;
}
}
return
url
;
...
...
public/assets/js/frontend/demo.js
查看文件 @
4abf8ab
...
...
@@ -3,7 +3,7 @@ define(['jquery', 'bootstrap', 'frontend', 'config'], function ($, undefined, Fr
var
Controller
=
{
qrcode
:
function
()
{
$
(
"form"
).
submit
(
function
()
{
$
(
"#qrcodeimg"
).
prop
(
"src"
,
(
Config
.
subdomain
==
"1"
?
''
:
'/index'
)
+
"/demo/qrcode?"
+
$
(
this
).
serialize
());
$
(
"#qrcodeimg"
).
prop
(
"src"
,
Config
.
moduleurl
+
"/demo/qrcode?"
+
$
(
this
).
serialize
());
return
false
;
});
$
(
"form"
).
trigger
(
'submit'
);
...
...
public/assets/js/require-backend.js
查看文件 @
4abf8ab
...
...
@@ -138,8 +138,7 @@ require.config({
require
([
'jquery'
,
'bootstrap'
,
'config'
],
function
(
$
,
undefined
,
Config
)
{
// 配置语言包的路径
var
paths
=
{};
paths
[
'lang'
]
=
(
Config
.
subdomain
==
"1"
?
''
:
'/admin'
)
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
paths
[
'lang'
]
=
Config
.
moduleurl
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
// 避免目录冲突
paths
[
'backend/'
]
=
'backend/'
;
require
.
config
({
paths
:
paths
});
...
...
@@ -170,6 +169,8 @@ require(['jquery', 'bootstrap', 'config'], function ($, undefined, Config) {
//加载相应模块
require
([
Config
.
jsname
],
function
(
Controller
)
{
Controller
[
Config
.
actionname
]
!=
undefined
&&
Controller
[
Config
.
actionname
]();
},
function
(
e
)
{
// 这里可捕获模块加载的错误
});
});
});
...
...
public/assets/js/require-backend.min.js
查看文件 @
4abf8ab
...
...
@@ -155,8 +155,7 @@ require.config({
require
([
'jquery'
,
'bootstrap'
,
'config'
],
function
(
$
,
undefined
,
Config
)
{
// 配置语言包的路径
var
paths
=
{};
paths
[
'lang'
]
=
(
Config
.
subdomain
==
"1"
?
''
:
'/admin'
)
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
paths
[
'lang'
]
=
Config
.
moduleurl
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
// 避免目录冲突
paths
[
'backend/'
]
=
'backend/'
;
require
.
config
({
paths
:
paths
});
...
...
@@ -187,6 +186,8 @@ require(['jquery', 'bootstrap', 'config'], function ($, undefined, Config) {
//加载相应模块
require
([
Config
.
jsname
],
function
(
Controller
)
{
Controller
[
Config
.
actionname
]
!=
undefined
&&
Controller
[
Config
.
actionname
]();
},
function
(
e
)
{
// 这里可捕获模块加载的错误
});
});
});
...
...
@@ -1968,7 +1969,7 @@ define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], f
if
(
url
.
substr
(
0
,
1
)
!==
"/"
)
{
var
r
=
new
RegExp
(
'^(?:[a-z]+:)?//'
,
'i'
);
if
(
!
r
.
test
(
url
))
{
url
=
(
Config
.
subdomain
==
"1"
?
""
:
"/"
+
Config
.
modulename
)
+
"/"
+
url
;
url
=
Config
.
moduleurl
+
"/"
+
url
;
}
}
return
url
;
...
...
@@ -8943,7 +8944,7 @@ $.fn.addtabs = function (options) {
content
.
append
(
opts
.
content
);
}
else
if
(
options
.
iframeUse
&&
!
opts
.
ajax
)
{
//没有内容,使用IFRAME打开链接
var
height
=
options
.
iframeHeight
;
content
.
append
(
'<iframe src="'
+
url
+
'" width="100%" height="'
+
height
+
'
%
" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe></div>'
);
content
.
append
(
'<iframe src="'
+
url
+
'" width="100%" height="'
+
height
+
'" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe></div>'
);
}
else
{
$
.
get
(
url
,
function
(
data
)
{
content
.
append
(
data
);
...
...
public/assets/js/require-frontend.js
查看文件 @
4abf8ab
...
...
@@ -138,7 +138,7 @@ require.config({
require
([
'jquery'
,
'bootstrap'
,
'config'
],
function
(
$
,
undefined
,
Config
)
{
// 配置语言包的路径
var
paths
=
{};
paths
[
'lang'
]
=
(
Config
.
subdomain
==
"1"
?
''
:
'/index'
)
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
paths
[
'lang'
]
=
Config
.
moduleurl
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
// 避免目录冲突
paths
[
'frontend/'
]
=
'frontend/'
;
...
...
@@ -170,6 +170,8 @@ require(['jquery', 'bootstrap', 'config'], function ($, undefined, Config) {
//加载相应模块
require
([
Config
.
jsname
],
function
(
Controller
)
{
Controller
[
Config
.
actionname
]
!=
undefined
&&
Controller
[
Config
.
actionname
]();
},
function
(
e
)
{
// 这里可捕获模块加载的错误
});
});
});
...
...
public/assets/js/require-frontend.min.js
查看文件 @
4abf8ab
...
...
@@ -155,7 +155,7 @@ require.config({
require
([
'jquery'
,
'bootstrap'
,
'config'
],
function
(
$
,
undefined
,
Config
)
{
// 配置语言包的路径
var
paths
=
{};
paths
[
'lang'
]
=
(
Config
.
subdomain
==
"1"
?
''
:
'/index'
)
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
paths
[
'lang'
]
=
Config
.
moduleurl
+
'/ajax/lang?callback=define&controllername='
+
Config
.
controllername
;
// 避免目录冲突
paths
[
'frontend/'
]
=
'frontend/'
;
...
...
@@ -187,6 +187,8 @@ require(['jquery', 'bootstrap', 'config'], function ($, undefined, Config) {
//加载相应模块
require
([
Config
.
jsname
],
function
(
Controller
)
{
Controller
[
Config
.
actionname
]
!=
undefined
&&
Controller
[
Config
.
actionname
]();
},
function
(
e
)
{
// 这里可捕获模块加载的错误
});
});
});
...
...
@@ -1968,7 +1970,7 @@ define('frontend',['jquery', 'bootstrap', 'toastr', 'layer', 'config'], function
if
(
url
.
substr
(
0
,
1
)
!==
"/"
)
{
var
r
=
new
RegExp
(
'^(?:[a-z]+:)?//'
,
'i'
);
if
(
!
r
.
test
(
url
))
{
url
=
(
Config
.
subdomain
==
"1"
?
""
:
"/"
+
Config
.
modulename
)
+
"/"
+
url
;
url
=
(
Config
.
moduleurl
)
+
"/"
+
url
;
}
}
return
url
;
...
...
public/assets/less/backend-func.less
查看文件 @
4abf8ab
...
...
@@ -51,8 +51,12 @@ body {
.tab-pane {
height: 100%;
width: 100%;
-webkit-overflow-scrolling:touch;
overflow:auto;
}
&.ios-iframe-fix{
.tab-pane {
-webkit-overflow-scrolling:touch;
overflow: auto;
}
}
}
...
...
请
注册
或
登录
后发表评论