package com.ankaibei.workFlow.webadmin.ankaibei.controller;

import com.ankaibei.workFlow.common.core.object.TokenData;
import com.ankaibei.workFlow.webadmin.ankaibei.api.LoginApi;
import com.ankaibei.workFlow.webadmin.ankaibei.enums.CodeEnum;
import com.ankaibei.workFlow.webadmin.ankaibei.vo.ResMsg;
import com.ankaibei.workFlow.webadmin.ankaibei.vo.UserInfoVo;
import com.ankaibei.workFlow.webadmin.upms.model.SysUser;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author lwq
 * @version 1.0
 * @description: 登录页
 * @date 2022/9/5 14:13
 */
@RestController
public class LoginAnKaiBeiController {

    @Resource
    private LoginApi loginApi;

    /**
     * 登录
     *
     * @param  userInfoVo
     * @return ResMsg
     */
    @RequestMapping("/login")
    public ResMsg login(@RequestBody UserInfoVo userInfoVo){

        return loginApi.login(userInfoVo);
    }
    /**
     *
     *  重新登录提示
     * @param
     * @return ResMsg
     */
    @RequestMapping("/errorLogin")
    public ResMsg error(){

        return new ResMsg(CodeEnum.PLEASE_LOG_IN_AGAIN);
    }

}
