|
@@ -27,8 +27,8 @@ const Kind = {
|
|
|
|
|
|
|
|
|
|
const db = mysql.createConnection({
|
|
const db = mysql.createConnection({
|
|
- host: 'localhost',
|
|
|
|
- user: 'root',
|
|
|
|
|
|
+ host: 'andyxie.cn',
|
|
|
|
+ user: 'external',
|
|
password: 'moyingren2015',
|
|
password: 'moyingren2015',
|
|
database: "instrunet_data",
|
|
database: "instrunet_data",
|
|
pool: pool,
|
|
pool: pool,
|
|
@@ -54,6 +54,7 @@ import nrc from "node-run-cmd";
|
|
import bodyParser from "body-parser";
|
|
import bodyParser from "body-parser";
|
|
|
|
|
|
import UserInteractions from "./UserInteractions.js";
|
|
import UserInteractions from "./UserInteractions.js";
|
|
|
|
+import cwh from "./Singletons.js";
|
|
|
|
|
|
webp.grant_permission()
|
|
webp.grant_permission()
|
|
let queue = new Queue();
|
|
let queue = new Queue();
|
|
@@ -550,6 +551,15 @@ setInterval(() => {
|
|
})
|
|
})
|
|
}, 10000)
|
|
}, 10000)
|
|
|
|
|
|
|
|
+app.get("/avatar", async (req, res) => {
|
|
|
|
+ if(!req.query.uuid){
|
|
|
|
+ res.set(cwh).status(500).json({code: 500, R: "IO"})
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ db.execute("SELECT avatar from user where uuid = ?", [req.query.uuid], (err, result) => {
|
|
|
|
+ res.set(cwh).end(result[0].avatar);
|
|
|
|
+ })
|
|
|
|
+})
|
|
// Fetch
|
|
// Fetch
|
|
app.get('/:uuid', async function (req, res) {
|
|
app.get('/:uuid', async function (req, res) {
|
|
|
|
|