Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
3f13cc19
ShopXO
项目概览
jcy2004x
/
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,体验更适合开发者的 AI 搜索 >>
提交
3f13cc19
编写于
2月 14, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用上传安装
上级
31820544
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
111 addition
and
204 deletion
+111
-204
application/admin/controller/Pluginsadmin.php
application/admin/controller/Pluginsadmin.php
+19
-0
application/admin/controller/Theme.php
application/admin/controller/Theme.php
+2
-4
application/admin/view/default/pluginsadmin/save_info.html
application/admin/view/default/pluginsadmin/save_info.html
+2
-2
application/admin/view/default/pluginsadmin/upload.html
application/admin/view/default/pluginsadmin/upload.html
+2
-2
application/index/view/default/config.json
application/index/view/default/config.json
+3
-3
application/plugins/ttttttsssstest88/Admin.php
application/plugins/ttttttsssstest88/Admin.php
+0
-24
application/plugins/ttttttsssstest88/Hook.php
application/plugins/ttttttsssstest88/Hook.php
+0
-27
application/plugins/ttttttsssstest88/Index.php
application/plugins/ttttttsssstest88/Index.php
+0
-24
application/plugins/ttttttsssstest88/config.json
application/plugins/ttttttsssstest88/config.json
+0
-21
application/plugins/view/ttttttsssstest88/admin/index.html
application/plugins/view/ttttttsssstest88/admin/index.html
+0
-15
application/plugins/view/ttttttsssstest88/index/index.html
application/plugins/view/ttttttsssstest88/index/index.html
+0
-31
application/service/PluginsAdminService.php
application/service/PluginsAdminService.php
+61
-20
application/service/ThemeService.php
application/service/ThemeService.php
+15
-10
config/shopxo.sql
config/shopxo.sql
+7
-7
public/static/plugins/css/ttttttsssstest88/admin.css
public/static/plugins/css/ttttttsssstest88/admin.css
+0
-7
public/static/plugins/css/ttttttsssstest88/index.css
public/static/plugins/css/ttttttsssstest88/index.css
+0
-7
public/static/upload/images/plugins_ttttttsssstest88/2019/02/13/1550050651917730.png
.../plugins_ttttttsssstest88/2019/02/13/1550050651917730.png
+0
-0
未找到文件。
application/admin/controller/Pluginsadmin.php
浏览文件 @
3f13cc19
...
...
@@ -195,5 +195,24 @@ class Pluginsadmin extends Common
// 开始处理
return
PluginsAdminService
::
PluginsStatusUpdate
(
input
(
'post.'
));
}
/**
* 上传安装
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-05-10T16:27:09+0800
*/
public
function
Upload
()
{
// 是否ajax
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
return
PluginsAdminService
::
PluginsUpload
(
input
());
}
}
?>
\ No newline at end of file
application/admin/controller/Theme.php
浏览文件 @
3f13cc19
...
...
@@ -98,8 +98,7 @@ class Theme extends Common
}
// 开始处理
$params
=
input
();
return
ThemeService
::
ThemeDelete
(
$params
);
return
ThemeService
::
ThemeDelete
(
input
());
}
/**
...
...
@@ -118,8 +117,7 @@ class Theme extends Common
}
// 开始处理
$params
=
input
();
return
ThemeService
::
ThemeUpload
(
$params
);
return
ThemeService
::
ThemeUpload
(
input
());
}
}
?>
\ No newline at end of file
application/admin/view/default/pluginsadmin/save_info.html
浏览文件 @
3f13cc19
...
...
@@ -25,8 +25,8 @@
<label
class=
"block"
>
LOGO
<span
class=
"fs-12 fw-100 cr-999"
>
(建议130像数X130像数)
</span></label>
<ul
class=
"plug-file-upload-view plugins-logo-view"
data-form-name=
"logo"
data-max-number=
"1"
data-delete=
"0"
data-dialog-type=
"images"
>
<li>
<input
type=
"text"
name=
"logo"
value=
"{{if !empty($data['logo
'])}}{{$data.logo
}}{{/if}}"
data-validation-message=
"请上传图片"
required
/>
<img
src=
"{{if !empty($data['logo
_old'])}}{{$data.logo_old
}}{{else /}}{{$attachment_host}}/static/admin/default/images/default-images.png{{/if}}"
/>
<input
type=
"text"
name=
"logo"
value=
"{{if !empty($data['logo
_old'])}}{{$data.logo_old
}}{{/if}}"
data-validation-message=
"请上传图片"
required
/>
<img
src=
"{{if !empty($data['logo
'])}}{{$data.logo
}}{{else /}}{{$attachment_host}}/static/admin/default/images/default-images.png{{/if}}"
/>
</li>
</ul>
<div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.plugins-logo-view"
>
+上传图片
</div>
...
...
application/admin/view/default/pluginsadmin/upload.html
浏览文件 @
3f13cc19
...
...
@@ -8,12 +8,12 @@
<!-- nav end -->
<!-- form start -->
<form
class=
"am-form form-validation view-save m-t-10"
action=
"{{:MyUrl('admin/plugins
/upload')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/plugins
/index')}}"
enctype=
"multipart/form-data"
>
<form
class=
"am-form form-validation view-save m-t-10"
action=
"{{:MyUrl('admin/plugins
admin/upload')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/pluginsadmin
/index')}}"
enctype=
"multipart/form-data"
>
<div
class=
"am-form-group am-form-file"
>
<button
type=
"button"
class=
"am-btn am-btn-default am-btn-sm am-radius"
>
<i
class=
"am-icon-cloud-upload"
></i>
选择文件
</button>
<input
type=
"file"
name=
"file"
class=
"file-event"
data-tips-tag=
"#form-file-tips"
multiple
data-validation-message=
"请选择需要上传的文件"
required
/>
<span
class=
"tips fs-12"
>
上传一个zip压缩格式的
主题
安装包
</span>
<span
class=
"tips fs-12"
>
上传一个zip压缩格式的
应用
安装包
</span>
<div
id=
"form-file-tips"
></div>
</div>
<div
class=
"am-form-group"
>
...
...
application/index/view/default/config.json
浏览文件 @
3f13cc19
{
"name"
:
"默认模板"
,
"ver"
:
"1.
2
.0"
,
"author"
:
"
魔鬼
"
,
"home"
:
"http://
gong.gg
/"
"ver"
:
"1.
3
.0"
,
"author"
:
"
Devil
"
,
"home"
:
"http://
shopxo.net
/"
}
\ No newline at end of file
application/plugins/ttttttsssstest88/Admin.php
已删除
100644 → 0
浏览文件 @
31820544
<?php
namespace
app\plugins\ttttttsssstest88
;
/**
* 测试应用 - 后台管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Admin
{
// 后台管理入口
public
function
index
(
$params
=
[])
{
// 数组组装
$data
=
[
'data'
=>
[
'hello'
,
'world!'
],
'msg'
=>
'hello world! admin'
,
];
return
DataReturn
(
'处理成功'
,
0
,
$data
);
}
}
?>
\ No newline at end of file
application/plugins/ttttttsssstest88/Hook.php
已删除
100644 → 0
浏览文件 @
31820544
<?php
namespace
app\plugins\ttttttsssstest88
;
/**
* 测试应用 - 钩子入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Hook
{
// 应用响应入口
public
function
run
(
$params
=
[])
{
// 是否控制器钩子
if
(
isset
(
$params
[
'is_control'
])
&&
$params
[
'is_control'
]
===
true
)
{
return
[];
// 默认返回视图
}
else
{
return
'hello world!'
;
}
}
}
?>
\ No newline at end of file
application/plugins/ttttttsssstest88/Index.php
已删除
100644 → 0
浏览文件 @
31820544
<?php
namespace
app\plugins\ttttttsssstest88
;
/**
* 测试应用 - 前端独立页面入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
Index
{
// 前端页面入口
public
function
index
(
$params
=
[])
{
// 数组组装
$data
=
[
'data'
=>
[
'hello'
,
'world!'
],
'msg'
=>
'hello world! index'
,
];
return
DataReturn
(
'处理成功'
,
0
,
$data
);
}
}
?>
\ No newline at end of file
application/plugins/ttttttsssstest88/config.json
已删除
100644 → 0
浏览文件 @
31820544
{
"base"
:{
"plugins"
:
"ttttttsssstest88"
,
"name"
:
"测试应用"
,
"logo"
:
"
\/
static
\/
upload
\/
images
\/
plugins_ttttttsssstest88
\/
2019
\/
02
\/
13
\/
1550050651917730.png"
,
"author"
:
"Devil"
,
"author_url"
:
"https:
\/\/
shopxo.net
\/
"
,
"version"
:
"1.0.0"
,
"desc"
:
"测试应用描述"
,
"apply_terminal"
:[
"pc"
],
"apply_version"
:[
"1.3.0"
],
"is_home"
:
true
},
"hook"
:[
]
}
\ No newline at end of file
application/plugins/view/ttttttsssstest88/admin/index.html
已删除
100644 → 0
浏览文件 @
31820544
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<h1>
后台管理页面
</h1>
{{:print_r($data)}}
<p
class=
"msg"
>
{{$msg}}
</p>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/ttttttsssstest88/index/index.html
已删除
100644 → 0
浏览文件 @
31820544
{{include file="public/header" /}}
<!-- nav start -->
{{include file="public/nav" /}}
<!-- nav end -->
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- content start -->
<div
class=
"am-g my-content"
>
<div
class=
"am-u-md-6 am-u-sm-centered"
>
<h1>
前端页面
</h1>
{{:print_r($data)}}
<p
class=
"msg"
>
{{$msg}}
</p>
</div>
</div>
<!-- content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/service/PluginsAdminService.php
浏览文件 @
3f13cc19
...
...
@@ -298,16 +298,30 @@ class PluginsAdminService
return
DataReturn
(
'应用不存在'
,
-
10
);
}
// 开启事务
Db
::
startTrans
();
// 删除操作
if
(
Db
::
name
(
'Plugins'
)
->
where
(
$where
)
->
delete
())
{
// 删除应用文件
self
::
PluginsResourcesDelete
(
$plugins
);
// 钩子部署
$ret
=
self
::
PluginsHookDeployment
();
if
(
$ret
[
'code'
]
==
0
)
{
// 删除应用文件
self
::
PluginsResourcesDelete
(
$plugins
);
return
DataReturn
(
'删除成功'
);
// 提交事务
Db
::
commit
();
return
DataReturn
(
'删除成功'
);
}
}
else
{
$ret
=
DataReturn
(
'删除失败或资源不存在'
,
-
100
);
}
return
DataReturn
(
'删除失败或资源不存在'
,
-
100
);
// 事务回退
Db
::
rollback
();
return
$ret
;
}
/**
...
...
@@ -725,7 +739,7 @@ php;
],
// 钩子配置
'hook'
=>
[],
'hook'
=>
(
object
)
[],
];
// 创建配置文件
...
...
@@ -842,6 +856,21 @@ php;
return
$ret
;
}
// 资源目录
$dir_list
=
[
'_controller_'
=>
APP_PATH
.
'plugins'
.
DS
,
'_view_'
=>
APP_PATH
.
'plugins'
.
DS
.
'view'
.
DS
,
'_css_'
=>
ROOT
.
'public'
.
DS
.
'static'
.
DS
.
'plugins'
.
DS
.
'css'
.
DS
,
'_js_'
=>
ROOT
.
'public'
.
DS
.
'static'
.
DS
.
'plugins'
.
DS
.
'js'
.
DS
,
'_images_'
=>
ROOT
.
'public'
.
DS
.
'static'
.
DS
.
'plugins'
.
DS
.
'images'
.
DS
,
'_uploadfile_'
=>
ROOT
.
'public'
.
DS
.
'static'
.
DS
.
'upload'
.
DS
.
'file'
.
DS
,
'_uploadimages_'
=>
ROOT
.
'public'
.
DS
.
'static'
.
DS
.
'upload'
.
DS
.
'images'
.
DS
,
'_uploadvideo_'
=>
ROOT
.
'public'
.
DS
.
'static'
.
DS
.
'upload'
.
DS
.
'video'
.
DS
,
];
// 包名
$plugins_name
=
''
;
// 开始解压文件
$resource
=
zip_open
(
$_FILES
[
'file'
][
'tmp_name'
]);
while
((
$temp_resource
=
zip_read
(
$resource
))
!==
false
)
...
...
@@ -851,29 +880,40 @@ php;
// 当前压缩包中项目名称
$file
=
zip_entry_name
(
$temp_resource
);
// 获取包名
if
(
empty
(
$plugins_name
))
{
// 应用不存在则添加
$plugins_name
=
substr
(
$file
,
0
,
strpos
(
$file
,
'/'
));
$ret
=
self
::
PluginsExistInsert
([],
$plugins_name
);
if
(
$ret
[
'code'
]
!=
0
)
{
zip_entry_close
(
$temp_resource
);
return
$ret
;
}
}
// 去除包名
$file
=
substr
(
$file
,
strpos
(
$file
,
'/'
)
+
1
);
// 排除临时文件和临时目录
if
(
strpos
(
$file
,
'/.'
)
===
false
&&
strpos
(
$file
,
'__'
)
===
false
)
{
// 拼接路径
if
(
strpos
(
$file
,
'_controller'
)
!==
false
)
{
$file
=
ROOT
.
self
::
$html_path
.
$file
;
}
else
if
(
strpos
(
$file
,
'_static'
)
!==
false
)
// 文件包对应系统所在目录
foreach
(
$dir_list
as
$dir_key
=>
$dir_value
)
{
$file
=
ROOT
.
self
::
$static_path
.
$file
;
}
else
{
continue
;
if
(
strpos
(
$file
,
$dir_key
)
!==
false
)
{
$file
=
str_replace
(
$dir_key
.
'/'
,
''
,
$dir_value
.
$file
);
break
;
}
}
$file
=
str_replace
(
array
(
'_static/'
,
'_html/'
),
''
,
$file
);
// 截取文件路径
$file_path
=
substr
(
$file
,
0
,
strrpos
(
$file
,
'/'
));
// 路径不存在则创建
if
(
!
is_dir
(
$file_path
))
{
mkdir
(
$file_path
,
0777
,
true
);
}
\
base\FileUtil
::
CreateDir
(
$file_path
);
// 如果不是目录则写入文件
if
(
!
is_dir
(
$file
))
...
...
@@ -881,14 +921,15 @@ php;
// 读取这个文件
$file_size
=
zip_entry_filesize
(
$temp_resource
);
$file_content
=
zip_entry_read
(
$temp_resource
,
$file_size
);
file_put_contents
(
$file
,
$file_content
);
@
file_put_contents
(
$file
,
$file_content
);
}
// 关闭目录项
zip_entry_close
(
$temp_resource
);
}
}
}
return
DataReturn
(
'
操作
成功'
);
return
DataReturn
(
'
安装
成功'
);
}
}
?>
\ No newline at end of file
application/service/ThemeService.php
浏览文件 @
3f13cc19
...
...
@@ -116,6 +116,12 @@ class ThemeService
return
DataReturn
(
'资源目录没权限'
,
-
10
);
}
// 资源目录
$dir_list
=
[
'_html_'
=>
ROOT
.
self
::
$html_path
,
'_static_'
=>
ROOT
.
self
::
$static_path
,
];
// 开始解压文件
$resource
=
zip_open
(
$_FILES
[
'theme'
][
'tmp_name'
]);
while
((
$temp_resource
=
zip_read
(
$resource
))
!==
false
)
...
...
@@ -128,17 +134,15 @@ class ThemeService
// 排除临时文件和临时目录
if
(
strpos
(
$file
,
'/.'
)
===
false
&&
strpos
(
$file
,
'__'
)
===
false
)
{
// 拼接路径
if
(
strpos
(
$file
,
'_html'
)
!==
false
)
{
$file
=
ROOT
.
self
::
$html_path
.
$file
;
}
else
if
(
strpos
(
$file
,
'_static'
)
!==
false
)
// 文件包对应系统所在目录
foreach
(
$dir_list
as
$dir_key
=>
$dir_value
)
{
$file
=
ROOT
.
self
::
$static_path
.
$file
;
}
else
{
continue
;
if
(
strpos
(
$file
,
$dir_key
)
!==
false
)
{
$file
=
str_replace
(
$dir_key
.
'/'
,
''
,
$dir_value
.
$file
);
break
;
}
}
$file
=
str_replace
(
array
(
'_static/'
,
'_html/'
),
''
,
$file
);
// 截取文件路径
$file_path
=
substr
(
$file
,
0
,
strrpos
(
$file
,
'/'
));
...
...
@@ -157,12 +161,13 @@ class ThemeService
$file_content
=
zip_entry_read
(
$temp_resource
,
$file_size
);
file_put_contents
(
$file
,
$file_content
);
}
// 关闭目录项
zip_entry_close
(
$temp_resource
);
}
}
}
return
DataReturn
(
'
操作
成功'
);
return
DataReturn
(
'
安装
成功'
);
}
/**
...
...
config/shopxo.sql
浏览文件 @
3f13cc19
此差异已折叠。
点击以展开。
public/static/plugins/css/ttttttsssstest88/admin.css
已删除
100644 → 0
浏览文件 @
31820544
h1
{
font-size
:
60px
;
}
.msg
{
font-size
:
38px
;
color
:
#F00
;
}
\ No newline at end of file
public/static/plugins/css/ttttttsssstest88/index.css
已删除
100644 → 0
浏览文件 @
31820544
h1
{
font-size
:
60px
;
}
.msg
{
font-size
:
68px
;
color
:
#4CAF50
;
}
\ No newline at end of file
public/static/upload/images/plugins_ttttttsssstest88/2019/02/13/1550050651917730.png
已删除
100644 → 0
浏览文件 @
31820544
6.9 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录