yapi/server_dist/middleware/checkToken.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-07-27 19:49:26 +08:00
"use strict";
2017-07-10 20:51:04 +08:00
2017-07-27 19:49:26 +08:00
var _regenerator = require("babel-runtime/regenerator");
2017-07-10 20:51:04 +08:00
var _regenerator2 = _interopRequireDefault(_regenerator);
2017-07-27 19:49:26 +08:00
var _asyncToGenerator2 = require("babel-runtime/helpers/asyncToGenerator");
2017-07-10 20:51:04 +08:00
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2017-07-27 19:49:26 +08:00
// const jwt = require('jsonwebtoken');
2017-07-10 20:51:04 +08:00
//检查token是否过期
module.exports = function () {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx, next) {
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return next();
case 2:
2017-07-27 19:49:26 +08:00
case "end":
2017-07-10 20:51:04 +08:00
return _context.stop();
}
}
}, _callee, undefined);
}));
return function (_x, _x2) {
return _ref.apply(this, arguments);
};
}();