首页>代码>springboot整合thymeleaf+layui实现简单的商品后台管理系统>/简单点JAVA架构/beliefframework/src/main/java/com/javaer/beliefframework/controller/HomeController.java
package com.javaer.beliefframework.controller;

import com.javaer.beliefframework.common.CommonResult;
import com.javaer.beliefframework.mapper.entity.User;
import com.javaer.beliefframework.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HomeController {
    @Autowired
    UserService userService;

    
    //登入页面
    @RequestMapping({"/","/information"})
    public String index(){
    	System.out.println("进来了额");
        return "system/login";
    }

    //触发登入页面    判断用户登入
    @ResponseBody
    @RequestMapping("/system/login")
    public CommonResult<User> login(User user){
        User loginUser = userService.getUserByAccount(user.getUserAccount());
        System.out.println("触发登入页面"+user.getUserAccount());
        if(loginUser == null || !loginUser.getUserPwd().equals(user.getUserPwd())){
           return  CommonResult.generateFailureResult("帐号或密码不正确", 1, null);
        }else{
            return CommonResult.generateSuccessResult(1, loginUser);
        }
    }
}
最近下载更多
wanglinddad  LV54 3月19日
yangyang567  LV1 3月8日
吞吞吐吐她  LV5 1月18日
withyouatdusk  LV1 2023年12月30日
pangzhihui  LV12 2023年12月26日
lwqzyx  LV1 2023年12月22日
ysugxx  LV9 2023年12月13日
吴锦松 2023年12月9日
暂无贡献等级
zhangjiale  LV1 2023年12月7日
290196127  LV1 2023年11月15日
最近浏览更多
whb5566  LV10 4月24日
2716804680  LV9 4月20日
chirsbey2 4月17日
暂无贡献等级
lingtiejing  LV15 4月12日
Luck_ZDM  LV11 4月12日
zolscy  LV12 3月21日
wanglinddad  LV54 3月19日
sunlzh888888  LV28 3月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友