/**
 * 管理后台端 管委会相关
 */

import * as guanWeiHuiBiz from '../../biz/admin/user';
import * as asyncHandler from 'express-async-handler';
import { eccReqParamater } from '../../util/verificationParam';

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


/**
 * 管理后台登录
 * @param req 
 * @param res 
 */
async function login(req, res) {
    let reqConf = {loginId:'String', pwd:'String'};
    let {loginId, pwd} = eccReqParamater(reqConf, req.body);

    let userInfo = await guanWeiHuiBiz.login(loginId, pwd);
    res.success(userInfo);
}

