yxw 2023-11-21 18:35:48 +08:00
parent 95bf3b5af8
commit 09efe92ab3
2 changed files with 54 additions and 47 deletions

View File

@ -195,13 +195,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
let res = $.parseJSON(res) let resData = $.parseJSON(res)
if (res.success) { if (resData.success) {
data.mic1 = res.content.mic1 data.mic1 = resData.content.mic1
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -227,13 +227,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
let res = $.parseJSON(res) let resData = $.parseJSON(res)
if (res.success) { if (resData.success) {
data.mic2 = res.content.mic2 data.mic2 = resData.content.mic2
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -257,13 +257,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
let res = $.parseJSON(res) let resData = $.parseJSON(res)
if (res.success) { if (resData.success) {
data.mic1 = res.content.mic1 data.mic1 = resData.content.mic1
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -287,13 +287,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
let res = $.parseJSON(res) let resData = $.parseJSON(res)
if (res.success) { if (resData.success) {
data.mic2 = res.content.mic2 data.mic2 = resData.content.mic2
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -318,18 +318,18 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
let res = $.parseJSON(res) let resData = $.parseJSON(res)
if (res.success) { if (resData.success) {
if (module == 'mic1') { if (module == 'mic1') {
data.mic1 = res.content.mic1 data.mic1 = resData.content.mic1
} }
else { else {
data.mic2 = res.content.mic2 data.mic2 = resData.content.mic2
} }
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -343,9 +343,9 @@
type: "GET", type: "GET",
url: url, url: url,
success: function (res) { success: function (res) {
let res = $.parseJSON(res) let resData = $.parseJSON(res)
if (res.success) { if (resData.success) {
data = res.content data = resData.content
bindData() bindData()
} }
else { else {

View File

@ -983,12 +983,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
if (res.success) { let resData = $.parseJSON(res)
data.lineinput = res.content.lineinput if (resData.success) {
data.lineinput = resData.content.lineinput
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -1023,12 +1024,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
if (res.success) { let resData = $.parseJSON(res)
data.lineinput = res.content.lineinput if (resData.success) {
data.lineinput = resData.content.lineinput
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -1065,12 +1067,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
if (res.success) { let resData = $.parseJSON(res)
data.mic1 = res.content.mic1 if (resData.success) {
data.mic1 = resData.content.mic1
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -1108,12 +1111,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
if (res.success) { let resData = $.parseJSON(res)
data.mic2 = res.content.mic2 if (resData.success) {
data.mic2 = resData.content.mic2
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -1149,12 +1153,13 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
if (res.success) { let resData = $.parseJSON(res)
data.output = res.content.output if (resData.success) {
data.output = resData.content.output
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -1180,30 +1185,31 @@
dataType: "json", dataType: "json",
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
if (res.success) { let resData = $.parseJSON(res)
if (resData.success) {
if (module == 'lineinput') { if (module == 'lineinput') {
data.lineinput = res.content.lineinput data.lineinput = resData.content.lineinput
lineinputValue = data.lineinput.audio lineinputValue = data.lineinput.audio
} }
else if (module == 'mic1') { else if (module == 'mic1') {
data.mic1 = res.content.mic1 data.mic1 = resData.content.mic1
mic1Value = data.mic1.audio mic1Value = data.mic1.audio
} }
else if (module == 'mic2') { else if (module == 'mic2') {
data.mic2 = res.content.mic2 data.mic2 = resData.content.mic2
mic2Value = data.mic2.audio mic2Value = data.mic2.audio
} }
else { else {
data.output = res.content.output data.output = resData.content.output
outputValue = data.mic2.audio outputValue = data.mic2.audio
} }
bindData() bindData()
} }
else { else {
alert(res.message) alert(resData.message)
} }
}, },
error: function (res) { error: function (res) {
@ -1219,8 +1225,9 @@
type: "GET", type: "GET",
url: url, url: url,
success: function (res) { success: function (res) {
if (res.success) { let resData = $.parseJSON(res)
data = res.content if (resData.success) {
data = resData.content
lineinputValue = data.lineinput.audio lineinputValue = data.lineinput.audio
mic1Value = data.mic1.audio mic1Value = data.mic1.audio
mic2Value = data.mic2.audio mic2Value = data.mic2.audio