|
@@ -8,12 +8,13 @@ module.exports = () => {
|
|
|
const { url, method, body } = ctx.request;
|
|
|
let mondel = '';
|
|
|
let methods = '';
|
|
|
- // token
|
|
|
- const str = ctx.request.header.authorization;
|
|
|
- const token = str.substring(7);
|
|
|
- const decode = ctx.app.jwt.verify(token, ctx.app.config.secret);
|
|
|
+ let decode = {};
|
|
|
const date = moment().format('YYYY-MM-DD HH:mm:ss');
|
|
|
if (url.indexOf('power') === -1 && method !== 'GET') {
|
|
|
+ // token
|
|
|
+ const tokenstr = ctx.request.header.authorization;
|
|
|
+ const token = tokenstr.substring(7);
|
|
|
+ decode = ctx.app.jwt.verify(token, ctx.app.config.secret);
|
|
|
const str = url.split('/');
|
|
|
for (let i = 0; i < str.length; i++) {
|
|
|
const e = str[i];
|