123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 'use strict';
- const Base = require('../base');
- class HomeController extends Base {
-
- get loginValidate() {
- const that = this;
- return {
- username: that.ctx.rules.name('用户名')
- .required(),
- };
- }
-
- async index() {
- const that = this;
- try {
-
- const data = await that.ctx.validate(that.loginValidate, await that.ctx.getParse());
- return that.ctx.appJson(that.app.szjcomo.appResult('hi,szjcomo', data, false));
- } catch (err) {
- console.log(err);
- return that.ctx.appJson(that.app.szjcomo.appResult(err.message));
- }
- }
- }
- module.exports = HomeController;
|