|
@@ -16,6 +16,8 @@ import com.fs.common.utils.ip.IpUtils;
|
|
|
import com.fs.framework.web.service.TokenService;
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.hisStore.config.MedicalMallConfig;
|
|
import com.fs.hisStore.config.MedicalMallConfig;
|
|
|
|
|
+import com.fs.system.domain.SysConfig;
|
|
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.system.service.ISysRoleService;
|
|
import com.fs.system.service.ISysRoleService;
|
|
|
import com.fs.system.service.ISysUserService;
|
|
import com.fs.system.service.ISysUserService;
|
|
|
import lombok.Synchronized;
|
|
import lombok.Synchronized;
|
|
@@ -71,6 +73,9 @@ public class SysLoginController
|
|
|
@Autowired
|
|
@Autowired
|
|
|
RedisCache redisCache;
|
|
RedisCache redisCache;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysUserService userService;
|
|
private ISysUserService userService;
|
|
|
|
|
|
|
@@ -166,6 +171,23 @@ public class SysLoginController
|
|
|
return AjaxResult.success(adminMenuService.buildAdminMenus(menus));
|
|
return AjaxResult.success(adminMenuService.buildAdminMenus(menus));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("getFirstLogin")
|
|
|
|
|
+ public AjaxResult getFirstLogin()
|
|
|
|
|
+ {
|
|
|
|
|
+ SysConfig config = configService.selectConfigByConfigKey("his.login");
|
|
|
|
|
+ if (config != null && config.getConfigValue() != null) {
|
|
|
|
|
+ String configValue = config.getConfigValue();
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(configValue);
|
|
|
|
|
+ Boolean disabled = jsonObject.getBoolean("disabled");
|
|
|
|
|
+ if (Boolean.TRUE.equals(disabled)) {
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
|
+ Boolean isFirstLogin = redisCache.getCacheObject("firstLogin:admin:" + loginUser.getUser().getUserId());
|
|
|
|
|
+ return AjaxResult.success(isFirstLogin != null && isFirstLogin);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return AjaxResult.success(false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@PostMapping("/checkIsNeedCheck")
|
|
@PostMapping("/checkIsNeedCheck")
|
|
|
public boolean checkIsNeedCheck(@RequestBody LoginBody loginBody)
|
|
public boolean checkIsNeedCheck(@RequestBody LoginBody loginBody)
|
|
|
{
|
|
{
|