tokentime的输入大小进行限制

This commit is contained in:
weiweiw 2024-11-12 10:53:58 +08:00
parent ae4a120987
commit 2ee58cefb0
2 changed files with 10 additions and 3 deletions

View File

@ -81,7 +81,7 @@ export default {
]
},
socket: null,
wsUrl: 'ws://localhost:18082/ws', // WebSocket
wsUrl: JSON.parse(localStorage.getItem('systemConfig')).webSocketurl,//'ws://localhost:18082/ws', // WebSocket
isConnected: false, //
reconnectInterval: 5000 //
@ -120,7 +120,9 @@ export default {
},
created() {
this.checkPasswordStatus()
if (this.roles.includes("audit") || this.roles.includes("systemAdmin")) {
console.log("*******************")
console.log(this.roles)
if (this.roles.includes("audit") || this.roles.includes("systemAdmin")|| this.roles.includes("admin")) {
this.connectWebSocket();
}
},
@ -158,7 +160,7 @@ export default {
console.log("WebSocket 已连接");
return;
}
console.log("WebSocket URL:{}",this.wsUrl)
this.socket = new WebSocket(this.wsUrl);
// WebSocket

View File

@ -300,6 +300,11 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.configKey === "sys.visit.tokentime" && (this.form.configValue <=0 || this.form.configValue > 30 ))
{
this.$modal.msgError("系统访问token有效期必须在0-30分钟之间");
return;
}
if (this.form.configId != undefined) {
updateConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");