Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
b0058d73
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b0058d73
编写于
3月 18, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
游客登录新增默认游客开关
上级
e39a0673
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
154 addition
and
0 deletion
+154
-0
application/api/controller/Common.php
application/api/controller/Common.php
+18
-0
application/index/controller/Common.php
application/index/controller/Common.php
+18
-0
application/plugins/touristbuy/Hook.php
application/plugins/touristbuy/Hook.php
+26
-0
application/plugins/touristbuy/config.json
application/plugins/touristbuy/config.json
+3
-0
application/plugins/view/touristbuy/admin/index.html
application/plugins/view/touristbuy/admin/index.html
+11
-0
application/plugins/view/touristbuy/admin/saveinfo.html
application/plugins/view/touristbuy/admin/saveinfo.html
+11
-0
application/service/SystemService.php
application/service/SystemService.php
+62
-0
application/tags.php
application/tags.php
+5
-0
未找到文件。
application/api/controller/Common.php
浏览文件 @
b0058d73
...
...
@@ -11,6 +11,7 @@
namespace
app\api\controller
;
use
think\Controller
;
use
app\service\SystemService
;
use
app\service\ConfigService
;
use
app\service\UserService
;
...
...
@@ -47,6 +48,9 @@ class Common extends Controller
{
parent
::
__construct
();
// 系统运行开始
SystemService
::
SystemBegin
();
// 输入参数
$this
->
data_post
=
input
(
'post.'
);
$this
->
data_get
=
input
(
'get.'
);
...
...
@@ -62,6 +66,20 @@ class Common extends Controller
$this
->
CommonInit
();
}
/**
* 析构函数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-18
* @desc description
*/
public
function
__destruct
()
{
// 系统运行结束
SystemService
::
SystemEnd
();
}
/**
* 系统初始化
* @author Devil
...
...
application/index/controller/Common.php
浏览文件 @
b0058d73
...
...
@@ -12,6 +12,7 @@ namespace app\index\controller;
use
think\facade\Hook
;
use
think\Controller
;
use
app\service\SystemService
;
use
app\service\GoodsService
;
use
app\service\NavigationService
;
use
app\service\BuyService
;
...
...
@@ -52,6 +53,9 @@ class Common extends Controller
{
parent
::
__construct
();
// 系统运行开始
SystemService
::
SystemBegin
();
// 系统初始化
$this
->
SystemInit
();
...
...
@@ -71,6 +75,20 @@ class Common extends Controller
$this
->
CommonPluginsInit
();
}
/**
* 析构函数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-18
* @desc description
*/
public
function
__destruct
()
{
// 系统运行结束
SystemService
::
SystemEnd
();
}
/**
* 公共钩子初始化
* @author Devil
...
...
application/plugins/touristbuy/Hook.php
浏览文件 @
b0058d73
...
...
@@ -11,6 +11,7 @@
namespace
app\plugins\touristbuy
;
use
think\Controller
;
use
app\plugins\touristbuy\Service
;
use
app\service\PluginsService
;
use
app\service\UserService
;
...
...
@@ -59,6 +60,11 @@ class Hook extends Controller
$ret
=
$this
->
NavTitle
(
$params
);
break
;
// 系统运行开始
case
'plugins_service_system_begin'
:
$ret
=
$this
->
SystemBegin
(
$params
);
break
;
default
:
$ret
=
DataReturn
(
'无需处理'
,
0
);
}
...
...
@@ -70,6 +76,26 @@ class Hook extends Controller
}
}
/**
* 系统运行开始
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-18
* @desc description
* @param [array] $params [输入参数]
*/
public
function
SystemBegin
(
$params
=
[])
{
// 是否开启默认游客
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
if
(
$ret
[
'code'
]
==
0
&&
isset
(
$ret
[
'data'
][
'is_default_tourist'
])
&&
$ret
[
'data'
][
'is_default_tourist'
]
==
1
)
{
return
Service
::
TouristReg
();
}
return
DataReturn
(
'无需处理'
,
0
);
}
/**
* css
* @author Devil
...
...
application/plugins/touristbuy/config.json
浏览文件 @
b0058d73
...
...
@@ -17,6 +17,9 @@
"is_home"
:
true
},
"hook"
:{
"plugins_service_system_begin"
:[
"app
\\
plugins
\\
touristbuy
\\
Hook"
],
"plugins_common_header"
:[
"app
\\
plugins
\\
touristbuy
\\
Hook"
],
...
...
application/plugins/view/touristbuy/admin/index.html
浏览文件 @
b0058d73
...
...
@@ -50,6 +50,17 @@
</div>
</div>
<div
class=
"items"
>
<label>
默认游客登录
</label>
<div>
{{if isset($data['is_default_tourist']) and $data['is_default_tourist'] eq 1}}
是
{{else /}}
否
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
订单查询地址
</label>
<div>
...
...
application/plugins/view/touristbuy/admin/saveinfo.html
浏览文件 @
b0058d73
...
...
@@ -30,6 +30,17 @@
<textarea
rows=
"3"
name=
"query_tips"
class=
"am-radius am-field-valid"
placeholder=
"公告内容"
data-validation-message=
"请填写订单查询提示"
>
{{if !empty($data['query_tips'])}}{{$data.query_tips}}{{/if}}
</textarea>
</div>
<div
class=
"am-form-group"
>
<label>
默认游客登录
<span
class=
"am-form-group-label-tips"
>
建议关闭
</span></label>
<div>
{{foreach $is_whether_list as $v}}
<label
class=
"am-radio-inline m-r-10"
>
<input
type=
"radio"
name=
"is_default_tourist"
value=
"{{$v.id}}"
{{
if
isset
($
data
['
is_default_tourist
'])
and
$
data
['
is_default_tourist
']
eq
$
v
['
id
']}}
checked=
"checked"
{{
else
/}}{{
if
!
isset
($
data
['
is_default_tourist
'])
and
isset
($
v
['
checked
'])
and
$
v
['
checked
']
eq
true
}}
checked=
"checked"
{{/
if
}}{{/
if
}}
data-am-ucheck
/>
{{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
</div>
...
...
application/service/SystemService.php
0 → 100644
浏览文件 @
b0058d73
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\service
;
use
think\facade\Hook
;
/**
* 配置服务层
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
SystemService
{
/**
* 系统运行开始
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
SystemBegin
(
$params
=
[])
{
$hook_name
=
'plugins_service_system_begin'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'params'
=>
&
$params
,
]);
}
/**
* 系统运行结束
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
SystemEnd
(
$params
=
[])
{
$hook_name
=
'plugins_service_system_end'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'params'
=>
&
$params
,
]);
}
}
?>
\ No newline at end of file
application/tags.php
浏览文件 @
b0058d73
...
...
@@ -13,6 +13,7 @@
return
array
(
'app_init'
=>
array
(
0
=>
'app\\plugins\\touristbuy\\Hook'
,
),
'app_begin'
=>
array
(
...
...
@@ -99,6 +100,10 @@ return array (
array
(
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
'plugins_service_system_begin'
=>
array
(
0
=>
'app\\plugins\\touristbuy\\Hook'
,
),
'plugins_view_header_navigation_top_left'
=>
array
(
0
=>
'app\\plugins\\touristbuy\\Hook'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录