Skip to content
Permalink
Browse files

bug fix

  • Loading branch information...
gyteng committed Apr 23, 2019
1 parent 41adc46 commit 731fd163f90c66b0ed43b96f4fd88b377821035c
Showing with 7 additions and 59 deletions.
  1. +1 −1 package-lock.json
  2. +1 −1 package.json
  3. +1 −54 plugins/webgui/server/adminServer.js
  4. +4 −3 plugins/webgui/server/home.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,6 +1,6 @@
{
"name": "shadowsocks-manager",
"version": "0.32.3",
"version": "0.32.4",
"description": "A shadowsocks manager tool for multi user and traffic control.",
"main": "server.js",
"scripts": {
@@ -106,7 +106,7 @@ exports.editServer = async (req, res) => {
req.checkBody('scale', 'Invalid scale').notEmpty();
req.checkBody('shift', 'Invalid shift').isInt();
const result = await req.getValidationResult();
if(!result.isEmpty()) { return Promise.reject('Invalid Body'); }
if(!result.isEmpty()) { return Promise.reject(result.array()); }
const serverId = req.params.serverId;
const type = req.body.type;
const isWG = type === 'WireGuard';
@@ -151,59 +151,6 @@ exports.editServer = async (req, res) => {
console.log(err);
res.status(403).end();
}


// req.checkBody('name', 'Invalid name').notEmpty();
// req.checkBody('address', 'Invalid address').notEmpty();
// req.checkBody('port', 'Invalid port').isInt({min: 1, max: 65535});
// req.checkBody('password', 'Invalid password').notEmpty();
// req.checkBody('method', 'Invalid method').notEmpty();
// req.checkBody('scale', 'Invalid scale').notEmpty();
// req.checkBody('shift', 'Invalid shift').isInt();
// req.getValidationResult().then(result => {
// if(result.isEmpty()) {
// const address = req.body.address;
// const port = +req.body.port;
// const password = req.body.password;
// return manager.send({
// command: 'flow',
// options: { clear: false, },
// }, {
// host: address,
// port,
// password,
// });
// }
// result.throw();
// }).then(success => {
// const serverId = req.params.serverId;
// const name = req.body.name;
// const comment = req.body.comment;
// const address = req.body.address;
// const port = +req.body.port;
// const password = req.body.password;
// const method = req.body.method;
// const scale = req.body.scale;
// const shift = req.body.shift;
// const check = +req.body.check;
// return serverManager.edit({
// id: serverId,
// name,
// host: address,
// port,
// password,
// method,
// scale,
// comment,
// shift,
// check,
// });
// }).then(success => {
// res.send('success');
// }).catch(err => {
// console.log(err);
// res.status(403).end();
// });
};

exports.deleteServer = (req, res) => {
@@ -30,9 +30,10 @@ exports.signup = async (req, res) => {
req.checkBody('password', 'Invalid password').notEmpty();
let type = 'normal';
const validation = await req.getValidationResult();
if(!validation.isEmpty()) {
return Promise.reject('invalid body');
}
// if(!validation.isEmpty()) {
// return Promise.reject('invalid body');
// }
if(!validation.isEmpty()) { return Promise.reject(validation.array()); }
const email = req.body.email.toString().toLowerCase();
const code = req.body.code;
await emailPlugin.checkCode(email, code);

0 comments on commit 731fd16

Please sign in to comment.
You can’t perform that action at this time.