refactor(系统设置): 新增plugin配置,认证信息返回状态字段

This commit is contained in:
WangXu10 2023-08-09 17:00:02 +08:00 committed by 刘瑞斌
parent 63dfd42ffe
commit 605addfca2
5 changed files with 32 additions and 7 deletions

View File

@ -30,6 +30,27 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>main-class-placement</id>
<phase>generate-resources</phase>
<configuration>
<skip>${skipAntRunForJenkins}</skip>
<target>
<copy todir="target/test-classes/static">
<fileset dir="../../../frontend/dist"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>

View File

@ -17,31 +17,31 @@ import java.io.IOException;
public class BaseDisplayController {
@Resource
private BaseDisplayService displayService;
private BaseDisplayService baseDisplayService;
@Operation(summary = "获取icon图片")
@GetMapping("/get/icon")
public ResponseEntity<byte[]> getIcon() throws IOException {
return displayService.getFile("icon");
return baseDisplayService.getFile("icon");
}
@Operation(summary = "获取loginImage图片")
@GetMapping("/get/login-image")
public ResponseEntity<byte[]> getLoginImage() throws IOException {
return displayService.getFile("loginImage");
return baseDisplayService.getFile("loginImage");
}
@Operation(summary = "获取loginLogo图片")
@GetMapping("/get/login-logo")
public ResponseEntity<byte[]> getLoginLogo() throws IOException {
return displayService.getFile("loginLogo");
return baseDisplayService.getFile("loginLogo");
}
@Operation(summary = "获取logoPlatform图片")
@GetMapping("/get/logo-platform")
public ResponseEntity<byte[]> getLogoPlatform() throws IOException {
return displayService.getFile("logoPlatform");
return baseDisplayService.getFile("logoPlatform");
}
}

View File

@ -27,4 +27,7 @@ public class AuthSourceDTO implements Serializable {
@Schema(title = "认证源配置", requiredMode = Schema.RequiredMode.REQUIRED)
private String configuration;
@Schema(title = "是否启用")
private Boolean enable;
}

View File

@ -87,6 +87,7 @@ public class AuthSourceService {
source.setName(authSource.getName());
source.setDescription(authSource.getDescription());
source.setConfiguration(authSource.getConfiguration().getBytes());
source.setType(authSource.getType());
source.setUpdateTime(System.currentTimeMillis());
authSourceMapper.updateByPrimaryKeySelective(source);
}

View File

@ -50,14 +50,14 @@ public class BaseDisplayService {
bytes = IOUtils.toByteArray(resolver.getResource("/static/favicon.ico").getInputStream());
break;
case "logoPlatform":
bytes = IOUtils.toByteArray(resolver.getResource("/static/svg/MS-full-logo.svg").getInputStream());
bytes = IOUtils.toByteArray(resolver.getResource("/static/images/MS-full-logo.svg").getInputStream());
contentType = MediaType.valueOf("image/svg+xml");
break;
case "loginImage":
bytes = IOUtils.toByteArray(resolver.getResource("/static/images/login-banner.jpg").getInputStream());
break;
default:
bytes = IOUtils.toByteArray(resolver.getResource("/static/svg/login-logo.svg").getInputStream());
bytes = IOUtils.toByteArray(resolver.getResource("/static/images/login-logo.svg").getInputStream());
contentType = MediaType.valueOf("image/svg+xml");
break;
}