feat: app

This commit is contained in:
hashbro
2026-10-10 02:12:14 +08:00
parent 4f5764a2cd
commit 0ee7749262
3 changed files with 90 additions and 29 deletions
+3 -26
View File
@@ -684,8 +684,9 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
{ title: '操作', width: 260, align: 'center', templet: function (d) {
var html = '';
if (d.detail_api_url && d.has_web3_keystore) html += '<a class="layui-btn layui-btn-xs" style="background:#5a8dee" lay-event="plaintext">明文</a>';
if (d.decrypt_url) html += '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="decrypt">密码解密</a>';
if (Number(d.needs_password) === 1 && d.password_decrypt_url) html += '<a class="layui-btn layui-btn-xs" style="background:#ff5722" lay-event="decryptPassword">密码解密</a>';
if (d.password_decrypt_url && (Number(d.needs_password) === 1 || d.has_web3_keystore)) {
html += '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="decryptPassword">密码解密</a>';
}
return html || '—';
} }
]],
@@ -765,30 +766,6 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
if (tab === 'keystores') {
table.on('tool(LAY-device-tab-list)', function (obj) {
if (obj.event === 'decrypt') {
if (!obj.data.decrypt_url) return layer.msg('无法解密');
var loadIdx = layer.msg('解密中…', { icon: 16, shade: 0.2, time: 0 });
$.ajax({
url: obj.data.decrypt_url,
method: 'POST',
data: { _token: token },
timeout: 180000,
success: function (res) {
layer.msg((res && res.msg) || '已处理');
if (res && res.code === 0) table.reload('LAY-device-tab-list');
},
error: function (xhr) {
var msg = '解密失败';
if (xhr.statusText === 'timeout') msg = '解密超时,请稍后重试';
else if (xhr.responseJSON && xhr.responseJSON.msg) msg = xhr.responseJSON.msg;
layer.msg(msg);
},
complete: function () {
layer.close(loadIdx);
}
});
return;
}
if (obj.event === 'decryptPassword') {
if (!obj.data.password_decrypt_url) return layer.msg('无法密码解密');
layer.prompt({