提交 73acaff8 编写于 作者: sq3536's avatar sq3536

nav visable

上级 aff10b75
......@@ -95,8 +95,10 @@ public class SysPSSystemAspect
system.getSysstructure().getSysApps(true).forEach(appNode -> {
if(oldApps.containsKey(appNode.getId()))
newList.add(oldApps.get(appNode.getId()));
else
else {
appNode.setVisabled(1);
newList.add(appNode);
}
});
if(old!=null&&old.getApps()!=null)
old.getApps().forEach(app->{
......
......@@ -56,17 +56,19 @@ public class SysAppService extends SysAppServiceImpl
JSONArray.parseArray(jo.get("model").toString(),SysApp.class).forEach(sysApp -> {
SysApp def=defApps.get(sysApp.getId());
if(def==null)return;
if(1!=def.getVisabled())return;
sysApp.setAddr(def.getAddr());
sysApp.setIcon(def.getIcon());
sysApp.setFullname(def.getFullname());
sysApp.setType(def.getType());
sysApp.setVisabled(1);
sysApp.setGroup(def.getGroup());
list.add(sysApp);
defApps.remove(def.getId());
});
final boolean flag=nullSwitcher;
defApps.values().forEach(sysApp -> {
if(1!=sysApp.getVisabled())return;
if(flag&&id.equalsIgnoreCase("default"))
sysApp.setVisabled(1);
else
......
......@@ -17,8 +17,12 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
......@@ -33,6 +37,12 @@ public class ClientAuthenticationResource
@Value("${ibiz.jwt.header:Authorization}")
private String tokenHeader;
@Value("${ibiz.auth.cookie.domain}")
private String cookiedomain;
@Value("${ibiz.jwt.expiration:7200000}")
private Long expiration;
@Autowired
private AuthTokenUtil jwtTokenUtil;
......@@ -43,13 +53,18 @@ public class ClientAuthenticationResource
@PostMapping(value = "v7/login")
public ResponseEntity<AuthenticationInfo> login(@Validated @RequestBody AuthorizationLogin authorizationLogin){
public ResponseEntity<AuthenticationInfo> login(@Validated @RequestBody AuthorizationLogin authorizationLogin, HttpServletResponse response){
userDetailsService.resetByUsername(authorizationLogin.getUsername());
AuthenticationUser user = userDetailsService.loadUserByLogin(authorizationLogin.getUsername(),authorizationLogin.getPassword());
final String token = jwtTokenUtil.generateToken(user);
user.setPermissionList(null);
Cookie cookie=new Cookie("ibzuaa-token",token);
if(!StringUtils.isEmpty(cookiedomain))
cookie.setDomain(cookiedomain);
cookie.setMaxAge(0);
response.addCookie(cookie);
// 返回 token
return ResponseEntity.ok().body(new AuthenticationInfo(token,user));
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册