创建网站服务时强制填写域名/优化源站未填写时交互

This commit is contained in:
GoEdgeLab
2022-05-07 20:26:40 +08:00
parent fefb46c77e
commit ce497e8822
4 changed files with 44 additions and 15 deletions

View File

@@ -6,6 +6,32 @@ Tea.context(function () {
this.success = NotifySuccess("保存成功", "/servers");
this.fail = function (resp) {
if (resp.errors != null && resp.errors.length > 0) {
let isFiltered = false
let that = this
resp.errors.forEach(function (err) {
if (err.param == "emptyDomain") {
isFiltered = true
teaweb.warn(err.messages[0], function () {
that.$refs.serverNameBox.addServerName()
})
} else if (err.param == "emptyOrigin") {
isFiltered = true
teaweb.warn(err.messages[0], function () {
that.addOrigin()
})
}
})
if (isFiltered) {
return
}
}
Tea.failResponse(resp)
}
this.changeServerType = function () {
this.origins = []
this.tlsProtocolName = ""