Commit c02b1b11 by chenjinjing

no message

parent 274dcc5e
<config>
<port>40004</port>
<dbPort>40002</dbPort>
<dbHost>localhost</dbHost>
<dbHost>192.168.0.71</dbHost>
<sign>xxx90909082fsdahfjosadjfpoiwausjorip2hjklrhn1ioud0u124rx0qwejfokasjfolksaujfoas</sign>
<fileIP>http://192.168.0.71:40004</fileIP>
</config>
<!-- -->
\ No newline at end of file
......@@ -17,7 +17,7 @@ export async function authentication(req, res, next) {
return next(new BizError(ERRORENUM.非法登录, `上传时候${userId} ${token}`));
}
if (userId == "admin" || userId == "admin2") {
if (userId == "admin" || userId == "superAdmin") {
let userInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.后台用户表, {uId:userId}, null);
if (!userInfo || !userInfo.uId) return next(new BizError(ERRORENUM.身份验证失败));
if (!userInfo.token || userInfo.token != token) return next(new BizError(ERRORENUM.身份验证过期));
......
......@@ -5,6 +5,8 @@ import compression = require('compression');
import { watch } from '../middleware/watch';
import { httpErrorHandler } from '../middleware/httpErrorHandler';
import { authentication } from '../middleware/user';
import * as path from "path";
import * as fallback from 'express-history-api-fallback';
export class httpServer {
......@@ -29,6 +31,9 @@ export class httpServer {
httpServer.use( express.static("./files") );
const root = path.join(__dirname, "../../public");
httpServer.use(express.static(root));
httpServer.use(fallback('index.html', { root }));
httpServer.use(compression());
......
......@@ -27,3 +27,4 @@ async function upFiles(req, res) {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment