Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
0e386733
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0e386733
编写于
4月 24, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
系统在线更新
上级
d8aa058a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
645 addition
and
190 deletion
+645
-190
application/admin/controller/Index.php
application/admin/controller/Index.php
+22
-0
application/admin/view/default/index/init.html
application/admin/view/default/index/init.html
+1
-1
application/lang/zh-cn.php
application/lang/zh-cn.php
+0
-1
application/service/PluginsAdminService.php
application/service/PluginsAdminService.php
+72
-129
application/service/PluginsService.php
application/service/PluginsService.php
+7
-7
application/service/SystemUpgradeService.php
application/service/SystemUpgradeService.php
+372
-0
application/tags.php
application/tags.php
+86
-49
public/static/admin/default/js/index.js
public/static/admin/default/js/index.js
+85
-3
未找到文件。
application/admin/controller/Index.php
浏览文件 @
0e386733
...
...
@@ -12,6 +12,7 @@ namespace app\admin\controller;
use
app\service\StatisticalService
;
use
app\service\StoreService
;
use
app\service\SystemUpgradeService
;
/**
* 首页
...
...
@@ -157,5 +158,26 @@ class Index extends Common
$params
=
$this
->
data_request
;
return
StoreService
::
SiteInspectUpgrade
(
$params
);
}
/**
* 检查更新确认
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-16
* @desc description
*/
public
function
InspectUpgradeConfirm
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
$params
=
$this
->
data_request
;
return
SystemUpgradeService
::
Run
(
$params
);
}
}
?>
\ No newline at end of file
application/admin/view/default/index/init.html
浏览文件 @
0e386733
...
...
@@ -254,7 +254,7 @@
<div
class=
"upgrade-bottom am-text-right"
>
<div
class=
"upgrade-bottom-content"
>
<button
type=
"button"
class=
"am-btn am-btn-default am-radius am-btn-xs"
data-am-modal-close
>
取消
</button>
<button
type=
"button"
class=
"am-btn am-btn-success am-radius am-btn-xs am-margin-left-sm am-hide inspect-upgrade-confirm"
>
立即更新
</button>
<button
type=
"button"
class=
"am-btn am-btn-success am-radius am-btn-xs am-margin-left-sm am-hide inspect-upgrade-confirm"
data-url=
"{{:MyUrl('admin/index/inspectupgradeconfirm')}}"
>
立即更新
</button>
</div>
</div>
</div>
...
...
application/lang/zh-cn.php
浏览文件 @
0e386733
...
...
@@ -152,7 +152,6 @@ return [
'ios'
=>
[
'value'
=>
'ios'
,
'name'
=>
'苹果APP'
],
'android'
=>
[
'value'
=>
'android'
,
'name'
=>
'安卓APP'
],
],
// 小程序平台
'common_appmini_type'
=>
[
...
...
application/service/PluginsAdminService.php
浏览文件 @
0e386733
...
...
@@ -1048,6 +1048,43 @@ php;
return
$ret
;
}
// 包处理
$ret
=
self
::
PluginsPackageHandle
(
$package_file
,
0
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
$plugins
=
$ret
[
'data'
];
// 附件同步到数据库
ResourcesService
::
AttachmentDiskFilesToDb
(
'plugins_'
.
$plugins
);
// sql运行
$install_sql
=
APP_PATH
.
'plugins'
.
DS
.
$plugins
.
DS
.
'install.sql'
;
if
(
!
empty
(
$plugins
)
&&
file_exists
(
$install_sql
))
{
SqlconsoleService
::
Implement
([
'sql'
=>
file_get_contents
(
$install_sql
)]);
}
// 插件事件回调
PluginsService
::
PluginsEventCall
(
$plugins
,
'Upload'
,
$params
);
return
DataReturn
(
'安装成功'
);
}
/**
* 插件包处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-24
* @desc description
* @param [string] $package_file [包地址]
* @param [int] $type [类型(0上传, 1更新)]
* @param [string] $plugins_old [原插件标识名称]
*/
public
static
function
PluginsPackageHandle
(
$package_file
,
$type
=
0
,
$plugins_old
=
''
)
{
// 资源目录
$dir_list
=
self
::
PluginsDirStructureMapping
();
...
...
@@ -1087,19 +1124,36 @@ php;
return
DataReturn
(
'插件包有误'
,
-
30
);
}
// 应用不存在则添加
$ret
=
self
::
PluginsVerification
(
$plugins
);
if
(
$ret
[
'code'
]
!=
0
)
// 业务类型处理
switch
(
$type
)
{
zip_entry_close
(
$temp_resource
);
return
$ret
;
}
// 上传安装
case
0
:
// 应用不存在则添加
$ret
=
self
::
PluginsVerification
(
$plugins
);
if
(
$ret
[
'code'
]
!=
0
)
{
zip_entry_close
(
$temp_resource
);
return
$ret
;
}
// 应用是否存在
if
(
self
::
PluginsExist
(
$plugins
))
{
zip_entry_close
(
$temp_resource
);
return
DataReturn
(
'应用名称已存在['
.
$plugins
.
']'
,
-
1
);
// 应用是否存在
if
(
self
::
PluginsExist
(
$plugins
))
{
zip_entry_close
(
$temp_resource
);
return
DataReturn
(
'应用名称已存在['
.
$plugins
.
']'
,
-
1
);
}
break
;
// 更新
case
1
:
// 应用是否存在
if
(
$plugins
!=
$plugins_old
)
{
zip_entry_close
(
$temp_resource
);
return
DataReturn
(
'应用标识与指定不一致['
.
$plugins
.
'<>'
.
$plugins_old
.
']'
,
-
1
);
}
break
;
}
}
...
...
@@ -1161,20 +1215,7 @@ php;
}
}
// 附件同步到数据库
ResourcesService
::
AttachmentDiskFilesToDb
(
'plugins_'
.
$plugins
);
// sql运行
$install_sql
=
APP_PATH
.
'plugins'
.
DS
.
$plugins
.
DS
.
'install.sql'
;
if
(
!
empty
(
$plugins
)
&&
file_exists
(
$install_sql
))
{
SqlconsoleService
::
Implement
([
'sql'
=>
file_get_contents
(
$install_sql
)]);
}
// 插件事件回调
PluginsService
::
PluginsEventCall
(
$plugins
,
'Upload'
,
$params
);
return
DataReturn
(
'安装成功'
);
return
DataReturn
(
'success'
,
0
,
$plugins
);
}
/**
...
...
@@ -1401,114 +1442,16 @@ php;
// 应用是否存在
if
(
!
self
::
PluginsExist
(
$params
[
'plugins_value'
]))
{
return
DataReturn
(
'应用不已存在['
.
$params
[
'plugins_value'
]
.
']、请先安装'
,
-
1
);
}
// 资源目录
$dir_list
=
self
::
PluginsDirStructureMapping
();
// 包名
$plugins
=
''
;
// 开始解压文件
$resource
=
zip_open
(
$package_file
);
if
(
!
is_resource
(
$resource
))
{
return
DataReturn
(
'压缩包打开失败['
.
$resource
.
']'
,
-
10
);
return
DataReturn
(
'应用不存在['
.
$params
[
'plugins_value'
]
.
']、请先安装'
,
-
1
);
}
// 处理文件
while
((
$temp_resource
=
zip_read
(
$resource
))
!==
false
)
// 包处理
$ret
=
self
::
PluginsPackageHandle
(
$package_file
,
1
,
$params
[
'plugins_value'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
if
(
zip_entry_open
(
$resource
,
$temp_resource
))
{
// 当前压缩包中项目名称
$file
=
zip_entry_name
(
$temp_resource
);
// 获取包名
if
(
empty
(
$plugins
))
{
// 应用名称
$plugins
=
substr
(
$file
,
0
,
strpos
(
$file
,
'/'
));
if
(
empty
(
$plugins
))
{
// 应用名称为空、则校验是否为支付插件
$file_size
=
zip_entry_filesize
(
$temp_resource
);
$file_content
=
zip_entry_read
(
$temp_resource
,
$file_size
);
if
(
stripos
(
$file_content
,
'namespace payment'
)
!==
false
)
{
return
DataReturn
(
'支付插件请到[ 网站管理->支付方式 ]模块里面去上传安装'
,
-
1
);
}
// 不是支付插件则提示插件包错误
return
DataReturn
(
'插件包有误'
,
-
30
);
}
// 应用是否存在
if
(
$plugins
!=
$params
[
'plugins_value'
])
{
zip_entry_close
(
$temp_resource
);
return
DataReturn
(
'应用标识与指定不一致['
.
$plugins
.
'<>'
.
$params
[
'plugins_value'
]
.
']'
,
-
1
);
}
}
// 排除临时文件和临时目录
if
(
strpos
(
$file
,
'/.'
)
===
false
&&
strpos
(
$file
,
'__'
)
===
false
)
{
// 文件包对应系统所在目录
$is_has_find
=
false
;
foreach
(
$dir_list
as
$dir_key
=>
$dir_value
)
{
if
(
strpos
(
$file
,
$dir_key
)
!==
false
)
{
// 仅控制器模块支持php文件
if
(
$dir_key
!=
'_controller_'
)
{
// 排除后缀文件
$pos
=
strripos
(
$file
,
'.'
);
if
(
$pos
!==
false
)
{
$info
=
pathinfo
(
$file
);
if
(
isset
(
$info
[
'extension'
])
&&
in_array
(
$info
[
'extension'
],
self
::
$exclude_ext
))
{
continue
;
}
}
}
// 匹配成功文件路径处理、跳出循环
$file
=
str_replace
(
$plugins
.
'/'
.
$dir_key
.
'/'
,
''
,
$dir_value
.
$file
);
$is_has_find
=
true
;
break
;
}
}
// 没有匹配到则指定目录跳过
if
(
$is_has_find
==
false
)
{
continue
;
}
// 截取文件路径
$file_path
=
substr
(
$file
,
0
,
strrpos
(
$file
,
'/'
));
// 路径不存在则创建
\
base\FileUtil
::
CreateDir
(
$file_path
);
// 如果不是目录则写入文件
if
(
!
is_dir
(
$file
))
{
// 读取这个文件
$file_size
=
zip_entry_filesize
(
$temp_resource
);
$file_content
=
zip_entry_read
(
$temp_resource
,
$file_size
);
@
file_put_contents
(
$file
,
$file_content
);
}
// 关闭目录项
zip_entry_close
(
$temp_resource
);
}
}
return
$ret
;
}
$plugins
=
$ret
[
'data'
];
// 更新sql
$sql_file
=
APP_PATH
.
'plugins'
.
DS
.
$plugins
.
DS
.
'update.sql'
;
...
...
application/service/PluginsService.php
浏览文件 @
0e386733
...
...
@@ -320,8 +320,8 @@ class PluginsService
if
(
config
(
'shopxo.is_develop'
)
===
false
)
{
$key
=
'plugins_legal_check_'
.
$plugins
;
$
status
=
cache
(
$key
);
if
(
empty
(
$
status
))
$
ret
=
cache
(
$key
);
if
(
empty
(
$
ret
))
{
$config
=
PluginsAdminService
::
GetPluginsConfig
(
$plugins
);
if
(
empty
(
$config
)
||
empty
(
$config
[
'base'
]))
...
...
@@ -337,11 +337,11 @@ class PluginsService
'ver'
=>
$config
[
'base'
][
'version'
],
];
$ret
=
StoreService
::
PluginsLegalCheck
(
$check_params
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
cache
(
$key
,
1
,
600
)
;
cache
(
$key
,
$ret
,
600
);
}
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
}
...
...
application/service/SystemUpgradeService.php
0 → 100644
浏览文件 @
0e386733
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\service
;
use
app\service\SqlconsoleService
;
/**
* 系统更新服务层
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-23
* @desc description
*/
class
SystemUpgradeService
{
// 输入参数
public
static
$params
;
// 远程系统更新接口
public
static
$store_plugins_upgrade_url
=
'https://store.shopxo.net/index.php?s=/api/plugins/index&pluginsname=store&pluginscontrol=index&pluginsaction=systemsupgradeurl'
;
// session key
public
static
$package_url_key
=
'package_url_key'
;
public
static
$package_system_dir_key
=
'package_system_dir_key'
;
public
static
$package_upgrade_dir_key
=
'package_upgrade_dir_key'
;
/**
* 更新入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
Run
(
$params
=
[])
{
// 参数校验
$ret
=
self
::
ParamsCheck
(
$params
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 操作类型
switch
(
self
::
$params
[
'opt'
])
{
// 获取url地址
case
'url'
:
$ret
=
self
::
UrlHandle
(
self
::
$params
);
break
;
// 下载包
case
'download_system'
:
case
'download_upgrade'
:
$ret
=
self
::
DownloadHandle
(
self
::
$params
);
break
;
// 更新软件包
case
'upgrade'
:
$ret
=
self
::
UpgradeHandle
(
self
::
$params
);
break
;
}
return
$ret
;
}
/**
* 更新软件包
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
UpgradeHandle
(
$params
=
[])
{
// 系统包
$system_url
=
session
(
self
::
$package_system_dir_key
);
if
(
empty
(
$system_url
)
||
!
file_exists
(
$system_url
))
{
return
DataReturn
(
'系统包不存在、请重新下载'
,
-
1
);
}
// 升级包
$upgrade_url
=
session
(
self
::
$package_upgrade_dir_key
);
if
(
empty
(
$upgrade_url
)
||
!
file_exists
(
$upgrade_url
))
{
return
DataReturn
(
'升级包不存在、请重新下载'
,
-
1
);
}
// 系统包处理
$ret
=
self
::
SystemPackageHandle
(
$system_url
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 升级包处理
$ret
=
self
::
UpgradePackageHandle
(
$upgrade_url
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 移除session
session
(
self
::
$package_url_key
,
null
);
session
(
self
::
$package_system_dir_key
,
null
);
session
(
self
::
$package_upgrade_dir_key
,
null
);
// 删除本地文件
\
base\FileUtil
::
UnlinkFile
(
$system_url
);
\
base\FileUtil
::
UnlinkFile
(
$upgrade_url
);
// 返回提示
return
DataReturn
(
'更新成功'
,
0
);
}
/**
* 升级包处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-24
* @desc description
* @param [string] $package_file [包地址]
*/
public
static
function
UpgradePackageHandle
(
$package_file
)
{
// 开始解压文件
$resource
=
zip_open
(
$package_file
);
if
(
!
is_resource
(
$resource
))
{
return
DataReturn
(
'压缩包打开失败['
.
$resource
.
']'
,
-
10
);
}
// 需要处理的文件
$handle_file_arr
=
[
'update.sql'
,
];
while
((
$temp_resource
=
zip_read
(
$resource
))
!==
false
)
{
if
(
zip_entry_open
(
$resource
,
$temp_resource
))
{
// 当前压缩包中项目名称
$file
=
zip_entry_name
(
$temp_resource
);
// 排除临时文件和临时目录
if
(
strpos
(
$file
,
'/.'
)
===
false
&&
!
is_dir
(
$file
)
&&
in_array
(
$file
,
$handle_file_arr
))
{
// 读取这个文件
$file_size
=
zip_entry_filesize
(
$temp_resource
);
$file_content
=
zip_entry_read
(
$temp_resource
,
$file_size
);
if
(
!
empty
(
$file_content
))
{
SqlconsoleService
::
Implement
([
'sql'
=>
$file_content
]);
}
// 关闭目录项
zip_entry_close
(
$temp_resource
);
}
}
}
return
DataReturn
(
'success'
,
0
);
}
/**
* 系统包处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-24
* @desc description
* @param [string] $package_file [包地址]
*/
public
static
function
SystemPackageHandle
(
$package_file
)
{
// 开始解压文件
$resource
=
zip_open
(
$package_file
);
if
(
!
is_resource
(
$resource
))
{
return
DataReturn
(
'压缩包打开失败['
.
$resource
.
']'
,
-
10
);
}
while
((
$temp_resource
=
zip_read
(
$resource
))
!==
false
)
{
if
(
zip_entry_open
(
$resource
,
$temp_resource
))
{
// 当前压缩包中项目名称
$file
=
zip_entry_name
(
$temp_resource
);
// 排除临时文件和临时目录
if
(
!
empty
(
$file
)
&&
strpos
(
$file
,
'/.'
)
===
false
)
{
// 文件实际位置
$file_new
=
ROOT
.
$file
;
// 截取文件路径
$file_path
=
substr
(
$file_new
,
0
,
strrpos
(
$file_new
,
'/'
));
// 路径不存在则创建、根目录文件不创建目录
if
(
strpos
(
$file
,
'/'
)
!==
false
)
{
\
base\FileUtil
::
CreateDir
(
$file_path
);
}
// 如果不是目录则写入文件
if
(
!
is_dir
(
$file_new
))
{
// 读取这个文件
$file_size
=
zip_entry_filesize
(
$temp_resource
);
$file_content
=
zip_entry_read
(
$temp_resource
,
$file_size
);
@
file_put_contents
(
$file_new
,
$file_content
);
}
// 关闭目录项
zip_entry_close
(
$temp_resource
);
}
}
}
return
DataReturn
(
'success'
,
0
);
}
/**
* 下载软件包
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
DownloadHandle
(
$params
=
[])
{
// 获取下载地址
$data
=
session
(
self
::
$package_url_key
);
if
(
empty
(
$data
)
||
!
is_array
(
$data
)
||
empty
(
$data
[
$params
[
'opt'
]]))
{
return
DataReturn
(
'下载地址为空'
,
-
1
);
}
$url
=
$data
[
$params
[
'opt'
]];
// 获取目录文件
$key
=
md5
(
$url
);
$res
=
self
::
DirFileData
(
$key
);
// 目录不存在则创建
\
base\FileUtil
::
CreateDir
(
$res
[
'dir'
]
.
$res
[
'path'
]);
// 下载保存
if
(
@
file_put_contents
(
$res
[
'url'
],
RequestGet
(
$url
,
300000
))
!==
false
)
{
// 存储已下载文件地址session
session
(
self
::
SaveDirPathUrl
(
$params
[
'opt'
]),
$res
[
'url'
]);
return
DataReturn
(
'success'
,
0
);
}
return
DataReturn
(
'包下载失败'
,
-
1
);
}
/**
* 获取存储路径session key
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-23
* @desc description
* @param [string] $opt [操作类型]
*/
public
static
function
SaveDirPathUrl
(
$opt
)
{
$dir_arr
=
[
'download_system'
=>
self
::
$package_system_dir_key
,
'download_upgrade'
=>
self
::
$package_upgrade_dir_key
,
];
return
isset
(
$dir_arr
[
$opt
])
?
$dir_arr
[
$opt
]
:
''
;
}
/**
* 获取下载地址
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
UrlHandle
(
$params
=
[])
{
// 帐号信息
$accounts
=
MyC
(
'common_store_accounts'
);
$password
=
MyC
(
'common_store_password'
);
// 获取信息
$ret
=
StoreService
::
RemoteStoreData
(
$accounts
,
$password
,
self
::
$store_plugins_upgrade_url
,
$params
);
if
(
!
empty
(
$ret
)
&&
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
==
0
)
{
session
(
self
::
$package_url_key
,
$ret
[
'data'
]);
return
DataReturn
(
'获取成功'
,
0
);
}
return
$ret
;
}
/**
* 获取软件存储信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-22
* @desc description
* @param [string] $key [缓存key]
*/
public
static
function
DirFileData
(
$key
)
{
// 将软件包下载到磁盘
$dir
=
ROOT
;
$path
=
'runtime'
.
DS
.
'data'
.
DS
.
'system_upgrade'
.
DS
;
$filename
=
$key
.
'.zip'
;
// 目录不存在则创建
\
base\FileUtil
::
CreateDir
(
$dir
.
$path
);
return
[
'dir'
=>
$dir
,
'path'
=>
$path
,
'file'
=>
$filename
,
'url'
=>
$dir
.
$path
.
$filename
,
];
}
/**
* 输入参数校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
ParamsCheck
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'in'
,
'key_name'
=>
'opt'
,
'checked_data'
=>
[
'url'
,
'download_system'
,
'download_upgrade'
,
'upgrade'
],
'error_msg'
=>
'操作类型有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
self
::
$params
=
$params
;
return
DataReturn
(
'success'
,
0
);
}
}
?>
\ No newline at end of file
application/tags.php
浏览文件 @
0e386733
...
...
@@ -35,19 +35,22 @@ return array (
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
2
=>
'app\\plugins\\store\\Hook'
,
1
=>
'app\\plugins\\shop\\Hook'
,
2
=>
'app\\plugins\\multilingual\\Hook'
,
3
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_js'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
2
=>
'app\\plugins\\store\\Hook'
,
1
=>
'app\\plugins\\shop\\Hook'
,
2
=>
'app\\plugins\\multilingual\\Hook'
,
3
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_navigation_header_handle'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
1
=>
'app\\plugins\\shop\\Hook'
,
2
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_quick_navigation_pc'
=>
array
(
...
...
@@ -82,6 +85,7 @@ return array (
'plugins_service_goods_handle_end'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\shop\\Hook'
,
),
'plugins_view_buy_form_inside'
=>
array
(
...
...
@@ -101,117 +105,150 @@ return array (
'plugins_service_buy_order_insert_end'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
1
=>
'app\\plugins\\shop\\Hook'
,
2
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_order_status_change_history_success_handle'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
1
=>
'app\\plugins\\shop\\Hook'
,
2
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_base_data_return_api_buy_index'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
),
'plugins_
common_page_bottom
'
=>
'plugins_
admin_css
'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\orderpricerevision\\Hook'
,
2
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_users_center_left_menu_handle'
=>
array
(
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_header_navigation_top_right_handle'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
2
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_goods_save_handle'
=>
array
(
0
=>
'app\\plugins\\shop\\Hook'
,
),
'plugins_service_editor_path_type_admin_goods_saveinfo'
=>
array
(
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_view_
common_top
'
=>
'plugins_view_
goods_detail_right_content_bottom
'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_view_
common
_bottom'
=>
'plugins_view_
goods_detail_base
_bottom'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_
service_search_goods_list_where
'
=>
'plugins_
view_goods_detail_base_buy_nav_min_inside_begin
'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_
admin_css
'
=>
'plugins_
service_warehouse_handle_end
'
=>
array
(
0
=>
'app\\plugins\\
orderpricerevision
\\Hook'
,
0
=>
'app\\plugins\\
shop
\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_
admin_js
'
=>
'plugins_
service_buy_handle
'
=>
array
(
0
=>
'app\\plugins\\
orderpricerevision
\\Hook'
,
0
=>
'app\\plugins\\
shop
\\Hook'
,
),
'plugins_
admin_view_common_bottom
'
=>
'plugins_
service_buy_order_insert_begin
'
=>
array
(
0
=>
'app\\plugins\\orderpricerevision\\Hook'
,
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_
view_admin_order_list_operate
'
=>
'plugins_
service_order_aftersale_audit_handle_end
'
=>
array
(
0
=>
'app\\plugins\\
orderpricerevision
\\Hook'
,
0
=>
'app\\plugins\\
shop
\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_
service_users_center_left_menu_handl
e'
=>
'plugins_
view_admin_goods_sav
e'
=>
array
(
0
=>
'app\\plugins\\s
tore
\\Hook'
,
0
=>
'app\\plugins\\s
hop
\\Hook'
,
),
'plugins_
service_warehouse_goods_inventory_deduct
'
=>
'plugins_
module_form_admin_goods_index
'
=>
array
(
0
=>
'app\\plugins\\s
tore
\\Hook'
,
0
=>
'app\\plugins\\s
hop
\\Hook'
,
),
'plugins_
service_warehouse_goods_inventory_rollback
'
=>
'plugins_
module_form_admin_goods_detail
'
=>
array
(
0
=>
'app\\plugins\\s
tore
\\Hook'
,
0
=>
'app\\plugins\\s
hop
\\Hook'
,
),
'plugins_service_
warehouse_goods_inventory_sync
'
=>
'plugins_service_
goods_buy_nav_button_handle
'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
0
=>
'app\\plugins\\shop\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_
service_goods_field_status_update
'
=>
'plugins_
common_page_bottom
'
=>
array
(
0
=>
'app\\plugins\\
store
\\Hook'
,
0
=>
'app\\plugins\\
multilingual
\\Hook'
,
),
'plugins_
service_goods_delete
'
=>
'plugins_
view_common_top
'
=>
array
(
0
=>
'app\\plugins\\
store
\\Hook'
,
0
=>
'app\\plugins\\
multilingual
\\Hook'
,
),
'plugins_
service_goods_save_end
'
=>
'plugins_
view_common_bottom
'
=>
array
(
0
=>
'app\\plugins\\
store
\\Hook'
,
0
=>
'app\\plugins\\
multilingual
\\Hook'
,
),
'plugins_service_
editor_path_type_admin_goods_saveinfo
'
=>
'plugins_service_
search_goods_list_where
'
=>
array
(
0
=>
'app\\plugins\\
store
\\Hook'
,
0
=>
'app\\plugins\\
multilingual
\\Hook'
,
),
'plugins_
view_goods_detail_right_content_bottom
'
=>
'plugins_
admin_js
'
=>
array
(
0
=>
'app\\plugins\\
store
\\Hook'
,
0
=>
'app\\plugins\\
orderpricerevision
\\Hook'
,
),
'plugins_view_goods_detail_base_bottom'
=>
'plugins_admin_view_common_bottom'
=>
array
(
0
=>
'app\\plugins\\orderpricerevision\\Hook'
,
),
'plugins_view_admin_order_list_operate'
=>
array
(
0
=>
'app\\plugins\\orderpricerevision\\Hook'
,
1
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_warehouse_goods_inventory_deduct'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_
view_goods_detail_base_buy_nav_min_inside_begin
'
=>
'plugins_
service_warehouse_goods_inventory_rollback
'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_warehouse_
handle_end
'
=>
'plugins_service_warehouse_
goods_inventory_sync
'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_
buy_order_insert_begin
'
=>
'plugins_service_
goods_field_status_update
'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_
system_begin
'
=>
'plugins_service_
goods_delete
'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_
order_aftersale_audit_handl
e_end'
=>
'plugins_service_
goods_sav
e_end'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
),
'plugins_service_
goods_buy_nav_button_handle
'
=>
'plugins_service_
system_begin
'
=>
array
(
0
=>
'app\\plugins\\store\\Hook'
,
),
...
...
public/static/admin/default/js/index.js
浏览文件 @
0e386733
/**
* 系统更新异步请求步骤
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-02-22
* @desc description
* @param {[string]} url [url地址]
* @param {[string]} opt [操作类型(url 获取下载地址, download_system 下载系统包, download_upgrade 下载升级包, upgrade 更新操作)]
* @param {[string]} msg [提示信息]
*/
function
SystemUpgradeRequestHandle
(
params
)
{
// 参数处理
if
((
params
||
null
)
==
null
)
{
Prompt
(
'
操作参数有误
'
);
return
false
;
}
var
url
=
params
.
url
||
null
;
var
opt
=
params
.
opt
||
'
url
'
;
var
msg
=
params
.
msg
||
'
正在获取中...
'
;
// 加载提示
AMUI
.
dialog
.
loading
({
title
:
msg
});
// ajax
$
.
ajax
({
url
:
url
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
timeout
:
305000
,
data
:
{
"
opt
"
:
opt
},
success
:
function
(
result
)
{
if
((
result
||
null
)
!=
null
&&
result
.
code
==
0
)
{
switch
(
opt
)
{
// 获取下载地址
case
'
url
'
:
params
[
'
opt
'
]
=
'
download_system
'
;
params
[
'
msg
'
]
=
'
系统包正在下载中...
'
;
SystemUpgradeRequestHandle
(
params
);
break
;
// 下载系统包
case
'
download_system
'
:
params
[
'
opt
'
]
=
'
download_upgrade
'
;
params
[
'
msg
'
]
=
'
升级包正在下载中...
'
;
SystemUpgradeRequestHandle
(
params
);
break
;
// 下载升级包
case
'
download_upgrade
'
:
params
[
'
opt
'
]
=
'
upgrade
'
;
params
[
'
msg
'
]
=
'
正在更新中...
'
;
SystemUpgradeRequestHandle
(
params
);
break
;
// 更新完成
case
'
upgrade
'
:
Prompt
(
result
.
msg
,
'
success
'
);
setTimeout
(
function
()
{
window
.
location
.
reload
();
},
1500
);
break
;
}
}
else
{
AMUI
.
dialog
.
loading
(
'
close
'
);
Prompt
(((
result
||
null
)
==
null
)
?
'
返回数据格式错误
'
:
(
result
.
msg
||
'
异常错误
'
));
}
},
error
:
function
(
xhr
,
type
)
{
AMUI
.
dialog
.
loading
(
'
close
'
);
Prompt
(
HtmlToString
(
xhr
.
responseText
)
||
'
异常错误
'
);
}
});
}
$
(
function
()
{
/**
...
...
@@ -179,10 +261,10 @@ $(function()
});
// 检查更新
var
$inspect_upgrade_popup
=
$
(
'
#inspect-upgrade-popup
'
);
$
(
'
.inspect-upgrade-submit
'
).
on
(
'
click
'
,
function
()
{
// 基础信息
var
$inspect_upgrade_popup
=
$
(
'
#inspect-upgrade-popup
'
);
AMUI
.
dialog
.
loading
({
title
:
'
正在获取最新内容、请稍候...
'
});
// ajax请求
...
...
@@ -260,7 +342,7 @@ $(function()
// 系统更新确认
$
(
'
.inspect-upgrade-confirm
'
).
on
(
'
click
'
,
function
()
{
Prompt
(
'
开发中...
'
);
$inspect_upgrade_popup
.
modal
(
'
close
'
);
SystemUpgradeRequestHandle
({
"
url
"
:
$
(
this
).
data
(
'
url
'
)});
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录