yapi/server_dist/controllers/base.js

49 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-07-05 17:47:51 +08:00
'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) {
(0, _classCallCheck3.default)(this, baseController);
console.log('baseControler init...');
}
(0, _createClass3.default)(baseController, [{
key: 'getUid',
value: function getUid() {
return 0;
}
}, {
key: 'getLoginStatus',
value: function getLoginStatus() {
2017-07-07 12:04:14 +08:00
// let token = getCookie('_yapi_token');
// let uid = getCookie('_yapi_uid');
// let usermodel
// usermode.token === token
// return true
2017-07-05 17:47:51 +08:00
return true;
}
2017-07-06 19:21:54 +08:00
}, {
key: 'getRole',
value: function getRole() {
return 'admin';
}
2017-07-05 17:47:51 +08:00
}]);
return baseController;
}();
module.exports = baseController;