o2sword пре 5 година
родитељ
комит
a8abb4292d

+ 0 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/build/CreateConfigSample.java

@@ -33,7 +33,6 @@ public class CreateConfigSample {
 		List<Class<?>> classes = new ArrayList<Class<?>>();
 		classes.add(AppStyle.class);
 		classes.add(CenterServer.class);
-		classes.add(ClientInit.class);
 		classes.add(Collect.class);
 		classes.add(Communicate.class);
 		classes.add(Components.class);

+ 0 - 168
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ClientInit.java

@@ -1,168 +0,0 @@
-package com.x.base.core.project.config;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.BooleanUtils;
-
-import com.x.base.core.project.annotation.FieldDescribe;
-
-public class ClientInit extends ConfigObject {
-
-	@FieldDescribe("是否启用.")
-	private Boolean enable;
-
-	@FieldDescribe("center节点信息.")
-	private List<CenterAddress> center;
-
-	@FieldDescribe("网页底部说明.")
-	private String footer = "";
-
-	@FieldDescribe("网页头部说明.")
-	private String title = "";
-
-	@FieldDescribe("APP使用协议,auto,http,https.")
-	private String app_protocol = "auto";
-
-	@FieldDescribe("登录页面配置.")
-	private LoginPage loginPage;
-
-	@FieldDescribe("是否启用webSocket")
-	private Boolean webSocketEnable;
-
-	public ClientInit() {
-		this.enable = DEFAULT_ENABLE;
-		this.center = new ArrayList<>();
-		this.loginPage = new LoginPage();
-	}
-
-	public static ClientInit defaultInstance() {
-		return new ClientInit();
-	}
-
-	public static final Boolean DEFAULT_ENABLE = false;
-
-	public static class LoginPage extends ConfigObject {
-
-		public static LoginPage defaultInstance() {
-			return new LoginPage();
-		}
-
-		@FieldDescribe("是否启用定制的登录页面.")
-		private Boolean enable;
-		@FieldDescribe("登录的门户.")
-		private String portal;
-		@FieldDescribe("登录页面.")
-		private String page;
-
-		public Boolean getEnable() {
-			return enable;
-		}
-
-		public void setEnable(Boolean enable) {
-			this.enable = enable;
-		}
-
-		public String getPortal() {
-			return portal;
-		}
-
-		public void setPortal(String portal) {
-			this.portal = portal;
-		}
-
-		public String getPage() {
-			return page;
-		}
-
-		public void setPage(String page) {
-			this.page = page;
-		}
-	}
-
-	public static class CenterAddress extends ConfigObject {
-
-
-		public static CenterAddress defaultInstance() {
-			return new CenterAddress();
-		}
-
-		private String port;
-
-		private String host;
-
-		public String getPort() {
-			return port;
-		}
-
-		public void setPort(String port) {
-			this.port = port;
-		}
-
-		public String getHost() {
-			return host;
-		}
-
-		public void setHost(String host) {
-			this.host = host;
-		}
-
-	}
-
-	public Boolean getEnable() {
-		return BooleanUtils.isTrue(this.enable);
-	}
-
-	public void setEnable(Boolean enable) {
-		this.enable = enable;
-	}
-
-	public List<CenterAddress> getCenter() {
-		return center;
-	}
-
-	public void setCenter(List<CenterAddress> center) {
-		this.center = center;
-	}
-
-	public String getFooter() {
-		return footer;
-	}
-
-	public void setFooter(String footer) {
-		this.footer = footer;
-	}
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public String getApp_protocol() {
-		return app_protocol;
-	}
-
-	public void setApp_protocol(String app_protocol) {
-		this.app_protocol = app_protocol;
-	}
-
-	public LoginPage getLoginPage() {
-		return loginPage;
-	}
-
-	public void setLoginPage(LoginPage loginPage) {
-		this.loginPage = loginPage;
-	}
-
-	public Boolean getWebSocketEnable() {
-		return webSocketEnable;
-	}
-
-	public void setWebSocketEnable(Boolean webSocketEnable) {
-		this.webSocketEnable = webSocketEnable;
-	}
-
-}

+ 0 - 13
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Config.java

@@ -1050,19 +1050,6 @@ public class Config {
 		return instance().logLevel;
 	}
 
-	private ClientInit clientInit;
-
-	public static synchronized ClientInit clientInit() throws Exception {
-		if (null == instance().clientInit) {
-			ClientInit obj = BaseTools.readConfigObject(PATH_CONFIG_CLIENTINIT, ClientInit.class);
-			if (null == obj) {
-				obj = ClientInit.defaultInstance();
-			}
-			instance().clientInit = obj;
-		}
-		return instance().clientInit;
-	}
-
 	private byte[] bindLogo;
 
 	public static synchronized byte[] bindLogo() throws Exception {

+ 3 - 0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/collect/ActionValidateDirect.java

@@ -16,6 +16,9 @@ class ActionValidateDirect extends BaseAction {
 
 	ActionResult<Wo> execute(JsonElement jsonElement) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
+		if (!Config.nodes().centerServers().first().getValue().getConfigApiEnable()) {
+			throw new ExceptionModifyConfig();
+		}
 		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 		Wo wo = new Wo();
 		wo.setValue(true);