yapi/server_dist/controllers/base.js
2017-07-10 11:11:35 +08:00

60 lines
1.5 KiB
JavaScript

'use strict';
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = require('babel-runtime/helpers/createClass');
var _createClass3 = _interopRequireDefault(_createClass2);
var _yapi = require('../yapi.js');
var _yapi2 = _interopRequireDefault(_yapi);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var baseController = function () {
function baseController(ctx) {
// console.log('baseControler init...')
// let router;
// if(router === 'user/reg' || 'router/login'){
// }else{
// var a = this.getLoginStatus()
// if(a === false){
// return ctx.body = {};
// }
// }
// this.auth = false;
(0, _classCallCheck3.default)(this, baseController);
}
(0, _createClass3.default)(baseController, [{
key: 'getUid',
value: function getUid() {
return 0;
}
}, {
key: 'getLoginStatus',
value: function getLoginStatus() {
// let token = getCookie('_yapi_token');
// let uid = getCookie('_yapi_uid');
// let usermodel
// usermode.token === token
// return true
return true;
}
}, {
key: 'getRole',
value: function getRole() {
return 'admin';
}
}]);
return baseController;
}();
module.exports = baseController;