web登录注册修改
This commit is contained in:
@@ -104,4 +104,13 @@ public class ConfigController {
|
||||
public ResultDomain<TbSysConfig> getConfigById(@PathVariable String id) {
|
||||
return sysConfigService.getConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取系统基础信息(公开接口,无需登录)
|
||||
* @return ResultDomain<Map> 基础配置信息
|
||||
*/
|
||||
@GetMapping("/baseinfo")
|
||||
public ResultDomain<Map<String, Object>> getBaseInfo() {
|
||||
return sysConfigService.getBaseInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.system.TbSysConfig;
|
||||
import org.xyzh.system.mapper.SysConfigMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -371,4 +372,31 @@ public class SysConfigServiceImpl implements SysConfigService {
|
||||
return resultDomain;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Map<String, Object>> getBaseInfo() {
|
||||
ResultDomain<Map<String, Object>> resultDomain = new ResultDomain<>();
|
||||
try {
|
||||
Map<String, Object> baseInfo = new HashMap<>();
|
||||
|
||||
// 基础信息配置
|
||||
baseInfo.put("systemName", getStringConfig("system.name"));
|
||||
baseInfo.put("systemShortName", getStringConfig("system.shortName"));
|
||||
baseInfo.put("loginLogo", getStringConfig("system.logo.login"));
|
||||
baseInfo.put("homeLogo", getStringConfig("system.logo.home"));
|
||||
baseInfo.put("adminLogo", getStringConfig("system.logo.admin"));
|
||||
baseInfo.put("favicon", getStringConfig("system.favicon"));
|
||||
|
||||
// 登录相关开关(从各自分组获取)
|
||||
baseInfo.put("smsLoginEnabled", getBooleanConfig("sms.login.enabled"));
|
||||
baseInfo.put("emailLoginEnabled", getBooleanConfig("email.login.enabled"));
|
||||
|
||||
resultDomain.success("获取成功", baseInfo);
|
||||
return resultDomain;
|
||||
} catch (Exception e) {
|
||||
logger.error("获取系统基础信息失败", e);
|
||||
resultDomain.fail("获取系统基础信息失败: " + e.getMessage());
|
||||
return resultDomain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user