其余文件
This commit is contained in:
141
app/admin/view/system/upgrade/choose_page.html
Normal file
141
app/admin/view/system/upgrade/choose_page.html
Normal file
@ -0,0 +1,141 @@
|
||||
{layout name="layout1" /}
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.container p {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.container button {
|
||||
margin-top: 10px;
|
||||
width: 300px;
|
||||
}
|
||||
.layui-btn + .layui-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
<p>系统是否进行过二次开发?</p>
|
||||
<button class="layui-btn layui-btn-normal" id="update">未做过二次开发,直接更新</button>
|
||||
<button class="layui-btn layui-btn-primary" id="secondary">已做过二次开发</button>
|
||||
<button class="layui-btn layui-btn-primary" id="cancle">取消更新</button>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var versionData = [];
|
||||
|
||||
function setVersionData(data) {
|
||||
versionData = data;
|
||||
}
|
||||
|
||||
layui.config({
|
||||
version:"{$front_version}",
|
||||
base: '/static/plug/layui-admin/dist/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index','layer', 'like'], function() {
|
||||
var layer = layui.layer;
|
||||
var $ = layui.$;
|
||||
var like = layui.like;
|
||||
|
||||
|
||||
// 更新
|
||||
$('#update').click(function() {
|
||||
layer.confirm('一键更新导致的系统问题,欢迎前往社区反馈,请做好系统备份!', {
|
||||
time: 0, //不自动关闭
|
||||
btn: ['确定更新', '取消更新'],
|
||||
title: '注意',
|
||||
area: ['60%','60%'],
|
||||
yes: function(index) {
|
||||
like.ajax({
|
||||
url:'{:url("system.Upgrade/handleUpgrade")}',
|
||||
data:versionData,
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 2000
|
||||
},function () {
|
||||
layer.close(index);
|
||||
window.parent.location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 已做过二次开发
|
||||
$('#secondary').click(function() {
|
||||
layer.confirm('二次开发后请谨慎使用一键更新功能!\n' +
|
||||
'\n' + '二次开发后一键更新导致的系统问题,官方无法处理,请做好系统备份', {
|
||||
time: 0, //不自动关闭
|
||||
btn: ['确定更新', '下载更新包,手动更新','取消更新'],
|
||||
title: '注意',
|
||||
area: ['60%','60%'],
|
||||
yes: function(index) {
|
||||
like.ajax({
|
||||
url:'{:url("system.Upgrade/handleUpgrade")}',
|
||||
data:versionData,
|
||||
type:"post",
|
||||
success:function(res)
|
||||
{
|
||||
if(res.code == 1)
|
||||
{
|
||||
layui.layer.msg(res.msg, {
|
||||
offset: '15px'
|
||||
, icon: 1
|
||||
, time: 2000
|
||||
},function () {
|
||||
layer.close(index);
|
||||
window.parent.location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
btn2: function(index, layero) {
|
||||
versionData.update_type = 2; //服务端更新包类型
|
||||
// 写入更新日志
|
||||
$.ajax({
|
||||
url: '{:url("system.upgrade/getPkg")}',
|
||||
type: 'post',
|
||||
data: versionData,
|
||||
success: function(res) {
|
||||
if(res.code == 1) {
|
||||
// 下载更新包
|
||||
window.location.href = res.data.link;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
btn3: function(index, layero) {
|
||||
layer.close(index);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// 取消更新
|
||||
$('#cancle').click(function() {
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
247
app/admin/view/system/upgrade/index.html
Normal file
247
app/admin/view/system/upgrade/index.html
Normal file
@ -0,0 +1,247 @@
|
||||
{layout name="layout1" /}
|
||||
|
||||
<style>
|
||||
.layui-table-cell { height: auto; }
|
||||
.tips { color: red}
|
||||
.mag-10 { margin-top: 10px}
|
||||
</style>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="layui-card layui-form">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-collapse like-layui-collapse" style="border:1px dashed #c4c4c4">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<p>* 版本更新需要逐个版本更新,<font class="tips">更新前请备份好系统和数据库</font>,更新成功后需要强制刷新站点;</p>
|
||||
<p>* 系统没有做二次开发,可以直接选择在线更新功能;</p>
|
||||
<p>* 系统已做二次开发,进行了功能修改,请谨慎选择在线更新功能,推荐以更新包的形式手动更新;</p>
|
||||
<p>* <a href="https://home.likeshop.cn/article/95.html" target="_blank" class ="doc">关于后续版本的升级说明(推荐阅读)</a></p>
|
||||
<p>* <font class="tips">更新至v1.3.0版本后,请执行 www.example.com/admin/distribution.center/updateTable, www.example.com为你的域名。</font></p>
|
||||
<p>* <font class="tips">更新至v1.3.0版本后,商品分销比例需在分销应用-分销设置-分销商品单独设置。</font></p>
|
||||
<p>* <font class="tips">更新至v1.4.1版本后,请执行 www.example.com/api/distribution/fixAncestorRelation, www.example.com为你的域名。</font></p>
|
||||
<p>* v1.4.1版本新增商家移动端,支持打包发布为H5、小程序、APP。H5访问地址为 www.example.com/business, www.example.com为你的商城域名。</p>
|
||||
<p>* <font class="tips">更新至v1.9.2版本后,客服域名配置请参考最新文档。</font></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<table id="lists" lay-filter="lists"></table>
|
||||
<script type="text/html" id="operation">
|
||||
|
||||
<!--一键更新-->
|
||||
{{# if(d.able_update === 1){ }}
|
||||
<a class="layui-btn layui-btn-sm layui-btn-normal mag-10" lay-event="update">一键更新</a> <br/>
|
||||
{{# } }}
|
||||
|
||||
<!--服务端更新包-->
|
||||
{{# if(d.package_link != "undefined" && d.package_link != null && d.package_link != ""){ }}
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary mag-10" lay-event="download-server">服务端更新包</a> <br/>
|
||||
{{# } }}
|
||||
|
||||
<!--pc更新包-->
|
||||
{{# if(d.pc_package_link != "undefined" && d.pc_package_link != null && d.pc_package_link != ""){ }}
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary mag-10" lay-event="download-pc">pc更新包</a> <br/>
|
||||
{{# } }}
|
||||
|
||||
<!--uniapp更新包-->
|
||||
{{# if(d.uniapp_package_link != "undefined" && d.uniapp_package_link != null && d.uniapp_package_link != ""){ }}
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary mag-10" lay-event="download-uniapp">uniapp更新包</a> <br/>
|
||||
{{# } }}
|
||||
|
||||
<!--商家后台移动端更新包-->
|
||||
{{# if(d.business_package_link != "undefined" && d.business_package_link != null && d.business_package_link != ""){ }}
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary mag-10" lay-event="download-business">商家移动端更新包</a> <br/>
|
||||
{{# } }}
|
||||
|
||||
<!--客服端更新包-->
|
||||
{{# if(d.kefu_package_link != "undefined" && d.kefu_package_link != null && d.kefu_package_link != ""){ }}
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary mag-10" lay-event="download-kefu">客服端更新包</a> <br/>
|
||||
{{# } }}
|
||||
|
||||
<a class="layui-btn layui-btn-sm layui-btn-primary mag-10" lay-event="download-full">完整安装包</a>
|
||||
</script>
|
||||
|
||||
<!--更新内容-->
|
||||
<script type="text/html" id="content">
|
||||
<div style="text-align: left">
|
||||
{{# layui.each(d.add, function(index, item){ }}
|
||||
<li>
|
||||
<span>{{ item }}</span>
|
||||
<li>
|
||||
{{# }); }}
|
||||
|
||||
{{# layui.each(d.optimize, function(index, item){ }}
|
||||
<li>
|
||||
<span>{{ item }}</span>
|
||||
</li>
|
||||
{{# }); }}
|
||||
|
||||
{{# layui.each(d.repair, function(index, item){ }}
|
||||
<li>
|
||||
<span>{{ item }}</span>
|
||||
</li>
|
||||
{{# }); }}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!--版本-->
|
||||
<script type="text/html" id="version">
|
||||
{{# if(d.new_version === 1){ }}
|
||||
<span style="color: red">new-</span><span>{{d.version_no}}</span>
|
||||
{{# } else { }}
|
||||
<span>{{d.version_no}}</span>
|
||||
{{# } }}
|
||||
<p>{{d.version_str}}</p>
|
||||
</script>
|
||||
|
||||
<!--更新注意提示-->
|
||||
<script type="text/html" id="notice">
|
||||
{{# layui.each(d.notice, function(index, item){ }}
|
||||
<li>
|
||||
<span>{{ item }}</span>
|
||||
</li>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['table'], function () {
|
||||
var table = layui.table;
|
||||
var layer = layui.layer;
|
||||
var $ = layui.$;
|
||||
|
||||
|
||||
like.tableLists('#lists', '{:url("system.Upgrade/index")}', [
|
||||
{field: 'create_time', title: '发布日期', width: 200, align: 'center'}
|
||||
, {field: 'version_no', title: '版本', width: 200, align: 'center', templet: '#version'}
|
||||
, {field: 'content', title: '版本内容', width: 300, align: 'center', templet: '#content'}
|
||||
, {field: 'notice', title: '注意事项', width: 300, align: 'center', templet: '#notice'}
|
||||
, {title: '操作', align: 'center', width: 300, toolbar: '#operation'}
|
||||
]);
|
||||
|
||||
|
||||
// 监听行工具栏按钮
|
||||
table.on('tool(lists)', function (obj) {
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
|
||||
// 一键更新
|
||||
if (layEvent === 'update') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '请选择操作',
|
||||
content: '{:url("system.upgrade/choosePage")}',
|
||||
area: ['60%', '60%'],
|
||||
success: function(layero, index){
|
||||
var iframe = window['layui-layer-iframe'+index];
|
||||
iframe.setVersionData(obj.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 下载服务端更新包
|
||||
if (layEvent === 'download-server') {
|
||||
data.update_type = 2; //服务端更新包类型
|
||||
like.ajax({
|
||||
url: '{:url("system.upgrade/getPkg")}',
|
||||
type: 'post',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if(res.code == 1) {
|
||||
// 下载更新包
|
||||
window.location.href = res.data.link;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//下载pc端更新包
|
||||
if (layEvent === 'download-pc') {
|
||||
data.update_type = 3; // pc端更新包类型
|
||||
like.ajax({
|
||||
url: '{:url("system.upgrade/getPkg")}',
|
||||
type: 'post',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if(res.code == 1) {
|
||||
// 下载更新包
|
||||
window.location.href = res.data.link;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//下载uniapp更新包
|
||||
if (layEvent === 'download-uniapp') {
|
||||
data.update_type = 4;
|
||||
like.ajax({
|
||||
url: '{:url("system.upgrade/getPkg")}',
|
||||
type: 'post',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if(res.code == 1) {
|
||||
// 下载更新包
|
||||
window.location.href = res.data.link;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 下载商家移动端更新包 download-business
|
||||
if (layEvent === 'download-business') {
|
||||
data.update_type = 7;
|
||||
like.ajax({
|
||||
url: '{:url("system.upgrade/getPkg")}',
|
||||
type: 'post',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if(res.code == 1) {
|
||||
// 下载更新包
|
||||
window.location.href = res.data.link;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 下载客服端更新包 download-kefu
|
||||
if (layEvent === 'download-kefu') {
|
||||
data.update_type = 8;
|
||||
like.ajax({
|
||||
url: '{:url("system.upgrade/getPkg")}',
|
||||
type: 'post',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if(res.code == 1) {
|
||||
// 下载更新包
|
||||
window.location.href = res.data.link;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 下载完整安装包
|
||||
if (layEvent === 'download-full') {
|
||||
data.update_type = 6;
|
||||
like.ajax({
|
||||
url: '{:url("system.upgrade/getPkg")}',
|
||||
type: 'post',
|
||||
data: data,
|
||||
success: function(res) {
|
||||
if(res.code == 1) {
|
||||
window.open(res.data.link);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user