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";
// class UserController {
export async function register(ctx: any, next: any) { export async function register(ctx: any, next: any) {
ctx.body = { code: 0, message: "success" }; ctx.json({ code: 0, message: "success" });
} }
export async function getUserList(ctx: any, next: any) { export function getUserList(ctx: any, next: any) {
ctx.body = { code: 0, message: "success" }; ctx.json('{ "code": 0, "message": "success" }')
} }
// }
// export default new UserController(); // 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"; import Router from "koa-router";
export const router = new Router({ prefix: "/user" }); export const router = new Router({ prefix: "/user" });
router.post("/list", getUserList); router.get("/list", getUserList);
router.post("/register", register);