修改 - 后端更改版本

This commit is contained in:
suwings 2018-04-26 10:21:28 +08:00
parent 658aab7e6b
commit 12478a7d9f
3 changed files with 37 additions and 25 deletions

31
helper/version.js Normal file
View File

@ -0,0 +1,31 @@
const {
WebSocketObserver
} = require('../../model/WebSocketModel');
const response = require('../../helper/Response');
const permssion = require('../../helper/Permission');
const os = require("os");
//前端显示版本
//每次更新之后,修改此处,表明修改
//这样, 用户截图时, 可以知道具体的版本
const oversion = "Beta_8.3.0.0"; //前端
const tversion = "Beta_8.3.0.0"; //后端
//首页
// WebSocketObserver().listener('index/update', (data) => {
// if (!permssion.isMaster(data.WsSession)) return;
// response.wsSend(data.ws, 'index/update', {
// system: os.type() + " " + os.arch(),
// root: process.cwd(),
// oneversion: oversion,
// twoversion: tversion
// })
// });
module.exports = {
system: os.type() + " " + os.arch(),
root: process.cwd(),
oneversion: oversion,
twoversion: tversion
}

View File

@ -10,6 +10,8 @@ const permssion = require('../../helper/Permission');
const userModel = require('../../model/UserModel');
const os = require("os");
const mversion = require('../../helper/version');
const MB_SIZE = 1024 * 1024;
let serverM = serverModel.ServerManager();
let userM = userModel.userCenter();
@ -88,8 +90,10 @@ setInterval(function () {
banip: banipc, //封的ip
passwordError: counter.get('passwordError'), //密码错误次数
csrfCounter: counter.get('csrfCounter'), //可能存在的CSRF攻击次数
notPermssionCounter: counter.get('notPermssionCounter') //API的无权访问
notPermssionCounter: counter.get('notPermssionCounter'), //API的无权访问
root: mversion.root,
oneversion: mversion.oneversion,
twoversion: mversion.twoversion
}
let useMemBai = ((os.freemem() / 1024) / (os.totalmem() / 1024) * 100).toFixed(0);

View File

@ -1,23 +0,0 @@
const {
WebSocketObserver
} = require('../../model/WebSocketModel');
const response = require('../../helper/Response');
const permssion = require('../../helper/Permission');
const os = require("os");
//前端显示版本
//每次更新之后,修改此处,表明修改
//这样, 用户截图时, 可以知道具体的版本
const oversion = "Release_8.2.8.1"; //前端
const tversion = "Release_8.2.8.1"; //后端
//首页
WebSocketObserver().listener('index/update', (data) => {
if (!permssion.isMaster(data.WsSession)) return;
response.wsSend(data.ws, 'index/update', {
system: os.type() + " " + os.arch(),
root: process.cwd(),
oneversion: oversion,
twoversion: tversion
})
});