Compare commits

..

No commits in common. "sample" and "master" have entirely different histories.

2 changed files with 12 additions and 10 deletions

View File

@ -1,10 +1,13 @@
import d from "../models/user";
import Koa from "koa";
export async function register(ctx: any, next: any) {
ctx.body = { code: 0, message: "success" };
}
export async function getUserList(ctx: any, next: any) {
ctx.body = { code: 0, message: "success" };
}
// class UserController {
export async function register(ctx: any, next: any) {
ctx.json({ code: 0, message: "success" });
}
export function getUserList(ctx: any, next: any) {
ctx.json('{ "code": 0, "message": "success" }')
}
// }
// export default new UserController();

View File

@ -1,7 +1,6 @@
import { getUserList, register } from "../controller/user";
import { getUserList } from "../controller/user";
import Router from "koa-router";
export const router = new Router({ prefix: "/user" });
router.post("/list", getUserList);
router.post("/register", register);
router.get("/list", getUserList);