23 lines
512 B
TypeScript
23 lines
512 B
TypeScript
import { Controller } from 'egg';
|
|
|
|
export default class HomeController extends Controller {
|
|
public async index() {
|
|
const { ctx } = this;
|
|
ctx.body = await ctx.service.test.sayHi('egg');
|
|
}
|
|
|
|
public async dev() {
|
|
const { ctx } = this;
|
|
let time1 = new Date();
|
|
let time2 = Number(time1);
|
|
let offset = time1.getTimezoneOffset();
|
|
|
|
let today = time1.setHours(0, 0, 0, 0);
|
|
|
|
console.log(time1, time2, offset, today);
|
|
await ctx.render('index',{
|
|
title: 'xxx'
|
|
});
|
|
}
|
|
}
|