系统:停服维护逻辑
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import {Application, RouteRecord, FrontendOrBackendSession, HandlerCallback} from "pinus";
|
||||
import {checkEvent} from '../../../services/eventSercive';
|
||||
import { refresh } from '../../../services/refreshService';
|
||||
module.exports = function(app: Application) {
|
||||
return new Filter(app);
|
||||
}
|
||||
|
||||
var Filter = function(this: any, app: Application) {
|
||||
this.app = app;
|
||||
};
|
||||
|
||||
Filter.prototype.before = function (routeRecord: RouteRecord, msg: any, session: FrontendOrBackendSession, next: HandlerCallback) {
|
||||
|
||||
next(null);
|
||||
};
|
||||
|
||||
Filter.prototype.after = function (err: Error, routeRecord: RouteRecord, msg: any, session: FrontendOrBackendSession, resp: any, next: HandlerCallback) {
|
||||
//刷新
|
||||
refresh(session);
|
||||
return checkEvent(session).then(()=>{
|
||||
next(err);
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
next(err);
|
||||
}); // 奇遇本检查
|
||||
};
|
||||
Reference in New Issue
Block a user