系统在线更新+插件在线更新开发优化
parent
0e3867336e
commit
1e4c5d60c8
|
|
@ -270,9 +270,11 @@ class Common extends Controller
|
|||
|
||||
// 站点商店信息
|
||||
$site_store_info = StoreService::SiteStoreInfo();
|
||||
//print_r($site_store_info);
|
||||
if(empty($site_store_info))
|
||||
{
|
||||
$res = StoreService::SiteStoreAccountsBindHandle();
|
||||
|
||||
if($res['code'] == 0)
|
||||
{
|
||||
$site_store_info = StoreService::SiteStoreInfo();
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
{{if !empty($site_store_info) and !empty($site_store_info['user'])}}
|
||||
<i class="am-icon-user"></i>
|
||||
<span>{{$site_store_info.user.user_name_view}}</span>
|
||||
<a href="javascript:;" class="am-margin-left-xs" data-am-modal="{target: '#store-accounts-popup'}">修改</a>
|
||||
<a href="javascript:;" class="am-margin-left-xs store-accounts-event">修改</a>
|
||||
{{else /}}
|
||||
<a href="javascript:;" class="am-margin-left-xs" data-am-modal="{target: '#store-accounts-popup'}">绑定ShopXO商店账户</a>
|
||||
<a href="javascript:;" class="am-margin-left-xs store-accounts-event">绑定ShopXO商店账户</a>
|
||||
{{/if}}
|
||||
|
||||
<!-- 广告 -->
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@
|
|||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-xs am-margin-left-xs am-icon-check submit-move-sort-save am-hide"> 保存</button>
|
||||
<button type="button" class="am-btn am-btn-danger am-radius am-btn-xs am-margin-left-xs am-icon-close submit-move-sort-cancel am-hide"> 取消</button>
|
||||
</p>
|
||||
{{if empty($site_store_info)}}
|
||||
{{if empty($site_store_info) or empty($site_store_info['user'])}}
|
||||
<p>
|
||||
<span>3. 绑定ShopXO应用商店帐号、获取插件最新版本信息、在线安装及更新</span>
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-xs am-margin-left-xs am-icon-gg" data-am-modal="{target: '#store-accounts-popup'}"> 绑定ShopXO商店账户</button>
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-xs am-margin-left-xs am-icon-gg store-accounts-event"> 绑定ShopXO商店账户</button>
|
||||
</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<!-- 应用商店账户绑定 -->
|
||||
<div class="am-popup popup-not-title" id="store-accounts-popup">
|
||||
<div class="am-popup-inner">
|
||||
<span data-am-modal-close class="am-close am-close-alt am-icon-times"></span>
|
||||
{{if empty($site_store_info) or empty($site_store_info['base']) or !isset($site_store_info['base']['is_user_not_cloae_accounts_popup']) or $site_store_info['base']['is_user_not_cloae_accounts_popup'] eq 0}}
|
||||
<span data-am-modal-close class="am-close am-close-alt am-icon-times"></span>
|
||||
{{/if}}
|
||||
<div class="am-popup-bd">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation-store-accounts view-save" action="{{:MyUrl('admin/index/storeaccountsbind')}}" method="POST" request-type="ajax-reload">
|
||||
|
|
@ -164,4 +166,14 @@
|
|||
{{$hook|raw}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function()
|
||||
{
|
||||
// 绑定商店帐号
|
||||
{{if !empty($site_store_info) and !empty($site_store_info['base']) and isset($site_store_info['base']['is_user_force_bind_accounts']) and $site_store_info['base']['is_user_force_bind_accounts'] eq 1 and !in_array($module_name.$controller_name.$action_name, ['adminindexindex', 'adminadminlogininfo']) and empty($site_store_info['user'])}}
|
||||
StoreAccountsPopupOpen();
|
||||
{{/if}}
|
||||
});
|
||||
</script>
|
||||
|
|
@ -189,6 +189,10 @@ class PluginsUpgradeService
|
|||
// 帐号信息
|
||||
$accounts = MyC('common_store_accounts');
|
||||
$password = MyC('common_store_password');
|
||||
if(empty($accounts) || empty($password))
|
||||
{
|
||||
return DataReturn('请先绑定应用商店帐号', -1);
|
||||
}
|
||||
|
||||
// 获取信息
|
||||
$ret = StoreService::RemoteStoreData($accounts, $password, self::$store_plugins_upgrade_url, $params);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class StoreService
|
|||
*/
|
||||
public static function SiteStoreAccountsBindHandle($accounts = '', $password = '')
|
||||
{
|
||||
// 帐号信息
|
||||
// 帐号信息、站点初始化信息接口、帐号信息可以为空
|
||||
if(empty($accounts))
|
||||
{
|
||||
$accounts = MyC('common_store_accounts');
|
||||
|
|
@ -189,7 +189,7 @@ class StoreService
|
|||
}
|
||||
|
||||
/**
|
||||
* 检查更新
|
||||
* 站点检查更新
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
|
|
@ -227,6 +227,10 @@ class StoreService
|
|||
// 帐号信息
|
||||
$accounts = MyC('common_store_accounts');
|
||||
$password = MyC('common_store_password');
|
||||
if(empty($accounts) || empty($password))
|
||||
{
|
||||
return DataReturn('请先绑定应用商店帐号', -1);
|
||||
}
|
||||
|
||||
// 获取信息
|
||||
$request_params = [
|
||||
|
|
@ -255,6 +259,10 @@ class StoreService
|
|||
// 帐号信息
|
||||
$accounts = MyC('common_store_accounts');
|
||||
$password = MyC('common_store_password');
|
||||
if(empty($accounts) || empty($password))
|
||||
{
|
||||
return DataReturn('请先绑定应用商店帐号', -1);
|
||||
}
|
||||
|
||||
// 获取更新信息
|
||||
return self::RemoteStoreData($accounts, $password, self::$store_plugins_upgrade_info_url, $params);
|
||||
|
|
@ -277,12 +285,6 @@ class StoreService
|
|||
*/
|
||||
public static function RemoteStoreData($accounts, $password, $url, $params = [])
|
||||
{
|
||||
// 帐号信息
|
||||
if(empty($accounts) || empty($password))
|
||||
{
|
||||
return DataReturn('请先绑定应用商店帐号', -1);
|
||||
}
|
||||
|
||||
// 基础数据获取
|
||||
$bo = new \base\Behavior();
|
||||
|
||||
|
|
|
|||
|
|
@ -301,6 +301,10 @@ class SystemUpgradeService
|
|||
// 帐号信息
|
||||
$accounts = MyC('common_store_accounts');
|
||||
$password = MyC('common_store_password');
|
||||
if(empty($accounts) || empty($password))
|
||||
{
|
||||
return DataReturn('请先绑定应用商店帐号', -1);
|
||||
}
|
||||
|
||||
// 获取信息
|
||||
$ret = StoreService::RemoteStoreData($accounts, $password, self::$store_plugins_upgrade_url, $params);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,21 @@
|
|||
+=========================================================+
|
||||
ShopXO 2.0.1 20210412 --- http://shopxo.net
|
||||
ShopXO 2.0.2 Release 000000 http://shopxo.net
|
||||
+=========================================================+
|
||||
全局
|
||||
1.
|
||||
|
||||
web端
|
||||
1. 系统、功能插件、支付插件、web端主题、小程序主题支持在线安装更新
|
||||
|
||||
小程序
|
||||
1.
|
||||
|
||||
插件
|
||||
1.
|
||||
|
||||
|
||||
+=========================================================+
|
||||
ShopXO 2.0.1 Release 20210412 http://shopxo.net
|
||||
+=========================================================+
|
||||
全局
|
||||
1. 公共图片上传重绘加开关
|
||||
|
|
|
|||
|
|
@ -163,6 +163,21 @@ function PackageUpgradeRequestHandle(params)
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开商店帐号绑定弹窗
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2021-04-24
|
||||
* @desc description
|
||||
*/
|
||||
function StoreAccountsPopupOpen()
|
||||
{
|
||||
$('#store-accounts-popup').modal({
|
||||
closeViaDimmer: false
|
||||
});
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
// 插件更新操作事件
|
||||
|
|
@ -193,7 +208,7 @@ $(function()
|
|||
$modal.find('.package-upgrade-submit').attr('data-type', type).attr('data-value', value).attr('data-terminal', terminal);
|
||||
$modal.modal({
|
||||
closeViaDimmer: false,
|
||||
width: 330,
|
||||
width: 310,
|
||||
height: 257
|
||||
});
|
||||
});
|
||||
|
|
@ -215,6 +230,12 @@ $(function()
|
|||
PackageUpgradeRequestHandle({"url":url, "type":type, "value":value, "terminal":terminal});
|
||||
});
|
||||
|
||||
// 商店帐号绑定事件
|
||||
$(document).on('click', '.store-accounts-event', function()
|
||||
{
|
||||
StoreAccountsPopupOpen();
|
||||
});
|
||||
|
||||
// 商品规格和参数上下移动
|
||||
$('.specifications-table,.parameters-table').on('click', '.line-move', function()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue