yxw 2023-11-24 16:22:00 +08:00
parent 7ab078cf92
commit 663fd786f3
1 changed files with 16 additions and 9 deletions

View File

@ -210,21 +210,28 @@
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: url, url: url,
data: formData, data: postData,
dataType: 'json', dataType: 'json',
type: 'POST',
async: false,
processData: false, // 使数据不做处理
contentType: false, // 不要设置Content-Type请求头
success: function (res) { success: function (res) {
console.log(res) console.log(res)
if (res.success) { if (res.success) {
data = res.content setTimeout(() => {
let url = 'http://192.168.0.116/cgi-bin/test.cgi?action=upgrade_get';
window.location.reload(true); $.ajax({
type: "GET",
url: url,
success: function (res) {
alert('upgrade success!device reboot!')
window.location.reload(true)
},
error: function () {
alert('upgrade failed!upgrade pack invalid!')
window.location.reload(true)
}
})
}, 1500);
} }
else { else {
console.log(res.message)
alert(res.message) alert(res.message)
} }
}, },