diff --git a/db/session.js b/db/session.js deleted file mode 100644 index 6f5a54d..0000000 --- a/db/session.js +++ /dev/null @@ -1,9 +0,0 @@ -const mongoose = require('mongoose') -const model = mongoose.model('Session', new mongoose.Schema({})) -async function clearAll() { - return await model.deleteMany({}) -} -module.exports = { - model, - clearAll -} \ No newline at end of file diff --git a/index.js b/index.js index 4fc4fe1..286afd5 100644 --- a/index.js +++ b/index.js @@ -95,28 +95,6 @@ app } res.json(u) }) - .post("/clear-session/", async (req, res) => { - let { username, password } = req.body - let u = await User.login({ username, password }) - if (u.success && await User.isUserAdmin(u.user)) { - try { - await require('./db/session').clearAll() - } catch (e) { - return res.json({ success: false, e }) - } - res.json({ success: true }) - - addLog({ - level: "warn", - type: "system", - event: "Session cleared.", - user: req.session.user, - description: `User {${req.session.user}} clearned session` - }) - } else { - res.json({ success: false, e: 'Permission Denied Desu' }) - } - }) .get("/logout/", (req, res) => { // 登出 if (req.session.user) { diff --git a/package-lock.json b/package-lock.json index ead773d..4f7f8c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pokaplayer", - "version": "3.4.12", + "version": "3.4.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 14b98db..e0592e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pokaplayer", - "version": "3.4.12", + "version": "3.4.13", "description": "", "main": "index.js", "scripts": {