This commit is contained in:
parent
94dd8372a4
commit
9887cf5904
|
@ -85,6 +85,7 @@ public interface ParamConstants {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum MAIL {
|
public static enum MAIL {
|
||||||
HOST("meter.host", 1),
|
HOST("meter.host", 1),
|
||||||
PORT("meter.port", 2),
|
PORT("meter.port", 2),
|
||||||
|
|
|
@ -16,10 +16,12 @@ import java.util.List;
|
||||||
public class SystemParameterController {
|
public class SystemParameterController {
|
||||||
@Resource
|
@Resource
|
||||||
private SystemParameterService SystemParameterService;
|
private SystemParameterService SystemParameterService;
|
||||||
|
|
||||||
@PostMapping("/edit/email")
|
@PostMapping("/edit/email")
|
||||||
public void editMail(@RequestBody List<SystemParameter> SystemParameter){
|
public void editMail(@RequestBody List<SystemParameter> systemParameter) {
|
||||||
SystemParameterService.editMail(SystemParameter);
|
SystemParameterService.editMail(systemParameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/testConnection")
|
@PostMapping("/testConnection")
|
||||||
public void testConnection(@RequestBody HashMap<String, String> hashMap) {
|
public void testConnection(@RequestBody HashMap<String, String> hashMap) {
|
||||||
SystemParameterService.testConnection(hashMap);
|
SystemParameterService.testConnection(hashMap);
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -16,7 +17,6 @@ import java.util.Properties;
|
||||||
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ public class SystemParameterService {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editMail(List<SystemParameter> parameters) {
|
public void editMail(List<SystemParameter> parameters) {
|
||||||
List<SystemParameter> paramList = this.getParamList(ParamConstants.Classify.MAIL.getValue());
|
List<SystemParameter> paramList = this.getParamList(ParamConstants.Classify.MAIL.getValue());
|
||||||
boolean empty = paramList.size() < 2;
|
boolean empty = paramList.size() < 2;
|
||||||
|
@ -54,6 +55,7 @@ public class SystemParameterService {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SystemParameter> getParamList(String type) {
|
public List<SystemParameter> getParamList(String type) {
|
||||||
SystemParameterExample example = new SystemParameterExample();
|
SystemParameterExample example = new SystemParameterExample();
|
||||||
example.createCriteria().andParamKeyLike(type + "%");
|
example.createCriteria().andParamKeyLike(type + "%");
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<el-form-item :label="$t('system_parameter_setting.SMTP_host')" prop="host">
|
<el-form-item :label="$t('system_parameter_setting.SMTP_host')" prop="host">
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-input v-model="formInline.host" :placeholder="$t('system_parameter_setting.SMTP_host')"
|
<el-input v-model="formInline.host" :placeholder="$t('system_parameter_setting.SMTP_host')"
|
||||||
v-on:input="host('host')"></el-input>
|
v-on:input="change()"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
<el-form-item :label="$t('system_parameter_setting.SMTP_port')" prop="port">
|
<el-form-item :label="$t('system_parameter_setting.SMTP_port')" prop="port">
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-input v-model="formInline.port" :placeholder="$t('system_parameter_setting.SMTP_port')"
|
<el-input v-model="formInline.port" :placeholder="$t('system_parameter_setting.SMTP_port')"
|
||||||
v-on:input="port('port')"></el-input>
|
v-on:input="change()"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<el-form-item :label="$t('system_parameter_setting.SMTP_account')" prop="account">
|
<el-form-item :label="$t('system_parameter_setting.SMTP_account')" prop="account">
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-input v-model="formInline.account" :placeholder="$t('system_parameter_setting.SMTP_account')"
|
<el-input v-model="formInline.account" :placeholder="$t('system_parameter_setting.SMTP_account')"
|
||||||
v-on:input="account('account')"></el-input>
|
v-on:input="change()"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
@ -114,30 +114,8 @@
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
host() {
|
change() {
|
||||||
let host = this.formInline.host;
|
if (!this.formInline.host || !this.formInline.port || !this.formInline.account) {
|
||||||
if (!host) {
|
|
||||||
this.disabledConnection = true;
|
|
||||||
this.disabledSave = true;
|
|
||||||
} else {
|
|
||||||
this.disabledConnection = false;
|
|
||||||
this.disabledSave = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
port() {
|
|
||||||
|
|
||||||
let port = this.formInline.port;
|
|
||||||
if (!port) {
|
|
||||||
this.disabledConnection = true;
|
|
||||||
this.disabledSave = true;
|
|
||||||
} else {
|
|
||||||
this.disabledConnection = false;
|
|
||||||
this.disabledSave = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
account() {
|
|
||||||
let account = this.formInline.account;
|
|
||||||
if (!account) {
|
|
||||||
this.disabledConnection = true;
|
this.disabledConnection = true;
|
||||||
this.disabledSave = true;
|
this.disabledSave = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue