mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 11:52:07 +08:00
modified by james 20210104
This commit is contained in:
@@ -1,28 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
const BaseController = require('../base');
|
||||
|
||||
class HomeController extends BaseController {
|
||||
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
|
||||
const data = {
|
||||
title: 'hello electron-egg'
|
||||
};
|
||||
|
||||
await ctx.render('index.ejs', data);
|
||||
}
|
||||
|
||||
async hello() {
|
||||
const { ctx } = this;
|
||||
|
||||
const data = {
|
||||
title: 'hello'
|
||||
};
|
||||
|
||||
await ctx.render('hello.ejs', data);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = HomeController;
|
||||
'use strict';
|
||||
|
||||
const BaseController = require('../base');
|
||||
|
||||
class HomeController extends BaseController {
|
||||
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
|
||||
const data = {
|
||||
title: 'hello electron-egg'
|
||||
};
|
||||
|
||||
await ctx.render('index.ejs', data);
|
||||
}
|
||||
|
||||
async hello() {
|
||||
const { ctx } = this;
|
||||
|
||||
const data = {
|
||||
title: 'hello'
|
||||
};
|
||||
|
||||
this.sendSuccess(data);
|
||||
}
|
||||
|
||||
async helloPage() {
|
||||
const { ctx } = this;
|
||||
|
||||
const data = {
|
||||
title: 'hello'
|
||||
};
|
||||
|
||||
await ctx.render('hello.ejs', data);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = HomeController;
|
||||
|
||||
Reference in New Issue
Block a user