Skip to content

Commit

Permalink
修复第三方插件免费版未生成订单,导致无法安装的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
songchudong committed Apr 1, 2022
1 parent 346bcea commit f7b7770
Showing 1 changed file with 39 additions and 28 deletions.
67 changes: 39 additions & 28 deletions BTPanel/static/js/public_backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5430,34 +5430,45 @@ bt.soft = {

get_install_plugin: function (item) {
var plugin_info = bt.load('正在获取插件安装信息,请稍候<img src="/static/img/ing.gif" />');
bt.send('install_plugin', 'plugin/install_plugin', {
sName: item.name,
version: item.install_version.m_version,
min_version: item.install_version.version,
type: item.install_type
}, function (rdata) {
plugin_info.close();
if (rdata.install_opt) {
bt.soft.show_plugin_info(rdata);
return
}
if (rdata.size) {
bt.soft.install_other(rdata, status);
return;
}
bt.pub.get_task_count(function (rdata) {
if (rdata > 0 && item.type === 5) messagebox();
});
if (typeof soft != "undefined") soft.get_list();
if (!rdata.status) layer.closeAll()
if (rdata.msg.indexOf('依赖以下软件,请先安装') > -1) {
layer.msg(rdata.msg.replace(/.*\[([A-z]*)].*/, function () {
return '依赖以下软件,请先安装[' + arguments[1] + '],<a href="javascript:;" onclick="bt.soft.install(\'' + arguments[1] + '\',this)" class="btlink">点击安装软件</a>'
}), { icon: 0, time: 0, closeBtn: 2, shade: .3 })
return false;
}
bt.msg(rdata);
})
var fn = function () {
bt.send('install_plugin', 'plugin/install_plugin', {
sName: item.name,
version: item.install_version.m_version,
min_version: item.install_version.version,
type: item.install_type
}, function (rdata) {
plugin_info.close();
if (rdata.install_opt) {
bt.soft.show_plugin_info(rdata);
return
}
if (rdata.size) {
bt.soft.install_other(rdata, status);
return;
}
bt.pub.get_task_count(function (rdata) {
if (rdata > 0 && item.type === 5) messagebox();
});
if (typeof soft != "undefined") soft.get_list();
if (!rdata.status) layer.closeAll()
if (rdata.msg.indexOf('依赖以下软件,请先安装') > -1) {
layer.msg(rdata.msg.replace(/.*\[([A-z]*)].*/, function () {
return '依赖以下软件,请先安装[' + arguments[1] + '],<a href="javascript:;" onclick="bt.soft.install(\'' + arguments[1] + '\',this)" class="btlink">点击安装软件</a>'
}), { icon: 0, time: 0, closeBtn: 2, shade: .3 })
return false;
}
bt.msg(rdata);
})
}
if(item.type === 10 && item.endtime === 0){
bt.send('create_plugin_other_order', 'auth/create_plugin_other_order', {
pid: item.pid,
cycle: 999,
type: 0
},fn)
}else{
fn()
}
},

/**
Expand Down

0 comments on commit f7b7770

Please sign in to comment.