Min il y a 2 ans
Parent
commit
23e6a6b288

+ 4 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -342,17 +342,12 @@ public class UserController {
 
 
     @RequestMapping(value = "/loginForAd", method = RequestMethod.POST)
-    public HttpRespMsg loginForAd(@RequestParam String username, @RequestParam String passWord) {
+    public HttpRespMsg loginForAd(@RequestParam String username, @RequestParam String password) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
-        User user = userService.getOne(new QueryWrapper<User>().eq("phone", username+"@"+dcFirst+"."+dcSecond));
         if(username.equals("sysadmin")){
-            if(user!=null){
-                return loginByUserId(user.getId());
-            }else {
-                httpRespMsg.setError("账号不存在");
-                return httpRespMsg;
-            }
+             return loginAdmin(username,password);
         }
+        User user = userService.getOne(new QueryWrapper<User>().eq("phone", username+"@"+dcFirst+"."+dcSecond));
         LdapContext ldapContext = null;
         Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
@@ -361,7 +356,7 @@ public class UserController {
         //用户名称,cn,ou,dc 分别:用户,组,域
         env.put(Context.SECURITY_PRINCIPAL, username+"@"+dcFirst+"."+dcSecond);
         //用户密码 cn 的密码
-        env.put(Context.SECURITY_CREDENTIALS, passWord);
+        env.put(Context.SECURITY_CREDENTIALS, password);
         //url 格式:协议://ip:端口/组,域   ,直接连接到域或者组上面
         env.put(Context.PROVIDER_URL,ldapUrl);
 //        //协议

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-meenyi.yml

@@ -105,6 +105,7 @@ referer:
   refererDomain:
     - localhost
     - mytime.ttkuaiban.com
+    - 172.10.21.185
 
 ##actuator健康检查配置
 management: