/**
 * 用户路由
 */

import * as asyncHandler from 'express-async-handler';
import * as tools from '../util/tools';
import * as userBiz from '../biz/user';
import { checkFuHuaQiToken } from '../middleware/user';

export function setRouter(httpServer) {
    httpServer.post('/user/login', asyncHandler(login));
}


async function login(req, res) {
    let reqConf = {loginId:'String', pwd:'String'};
    let {loginId, pwd} = tools.checkReqParam(reqConf, req.body);

    let userInfo = await userBiz.login(loginId, pwd);

    res.success(userInfo);
}
