mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-13 11:53:34 +08:00
创建网站服务时强制填写域名/优化源站未填写时交互
This commit is contained in:
@@ -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 = ""
|
||||
|
||||
Reference in New Issue
Block a user