|
@@ -8,6 +8,15 @@ const pool = mysql.createPool({
|
|
keepAliveInitialDelay: 0, enableKeepAlive: true,
|
|
keepAliveInitialDelay: 0, enableKeepAlive: true,
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const Kind = {
|
|
|
|
+ 0: "去和声伴奏",
|
|
|
|
+ 1: "和声伴奏",
|
|
|
|
+ 2: "人声",
|
|
|
|
+ 3: "贝斯",
|
|
|
|
+ 4: "鼓",
|
|
|
|
+ 5: "其他",
|
|
|
|
+}
|
|
|
|
+
|
|
const db = mysql.createConnection({
|
|
const db = mysql.createConnection({
|
|
host: 'mc.andyxie.cn',
|
|
host: 'mc.andyxie.cn',
|
|
user: 'instrunet',
|
|
user: 'instrunet',
|
|
@@ -168,7 +177,7 @@ function Submit(req, res) {
|
|
to: req.body.email,
|
|
to: req.body.email,
|
|
subject: "你的音频已处理完成。",
|
|
subject: "你的音频已处理完成。",
|
|
text: "你的音频已处理完成。",
|
|
text: "你的音频已处理完成。",
|
|
- html: fs.readFileSync("./Template.html", "utf8").toString().replace("{song_name}", req.body.name).replace("{href_link}", "https://andyxie.cn:4000/player?play=" + uuid)
|
|
|
|
|
|
+ html: fs.readFileSync("./Template.html", "utf8").toString().replace("{song_name}", req.body.name).replace("{href_link}", "https://andyxie.cn:4000/player?play=" + uuid).replace("{kind}", Kind[req.body.kind]).replace("{album}", req.body.albumName)
|
|
}).then((result) => {
|
|
}).then((result) => {
|
|
console.log("Message sent: %s", result.messageId)
|
|
console.log("Message sent: %s", result.messageId)
|
|
|
|
|
|
@@ -203,7 +212,7 @@ function SubmitWrapper(req, res) {
|
|
|
|
|
|
if (result.length === 0) {
|
|
if (result.length === 0) {
|
|
// Verify
|
|
// Verify
|
|
- if(req.body.file.substring(0,5) !=="data:"){
|
|
|
|
|
|
+ if (req.body.file.substring(0, 5) !== "data:") {
|
|
res.status(500).header("Access-Control-Allow-Origin", "*").end("想都别想");
|
|
res.status(500).header("Access-Control-Allow-Origin", "*").end("想都别想");
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -229,13 +238,11 @@ function SubmitWrapper(req, res) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
if (req.body.link === undefined) {
|
|
if (req.body.link === undefined) {
|
|
req.body.link = ""
|
|
req.body.link = ""
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
queue.add(() => {
|
|
queue.add(() => {
|
|
Submit(req, res)
|
|
Submit(req, res)
|
|
})
|
|
})
|