From eca1e05aeed3c51cce36bbce80c71bc3cbcea87d Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 12 十一月 2021 14:40:39 +0800 Subject: [PATCH] 维护目录订阅消息与接口 --- src/main/java/com/genersoft/iot/vmp/web/AuthController.java | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/web/AuthController.java b/src/main/java/com/genersoft/iot/vmp/web/AuthController.java index 8fd66ca..f4a2af8 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/AuthController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/AuthController.java @@ -1,10 +1,8 @@ package com.genersoft.iot.vmp.web; -import com.genersoft.iot.vmp.gb28181.bean.Device; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.util.StringUtils; +import com.genersoft.iot.vmp.service.IUserService; +import com.genersoft.iot.vmp.storager.dao.dto.User; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @CrossOrigin @@ -12,16 +10,13 @@ @RequestMapping(value = "/auth") public class AuthController { - @Value("${auth.username}") - private String username; - - @Value("${auth.password}") - private String password; + @Autowired + private IUserService userService; @RequestMapping("/login") public String devices(String name, String passwd){ - if (!StringUtils.isEmpty(name) && name.equals(username) - && !StringUtils.isEmpty(passwd) && passwd.equals(password)) { + User user = userService.getUser(name, passwd); + if (user != null) { return "success"; }else { return "fail"; -- Gitblit v1.8.0