找不到匹配的域名时可以指定默认域名、指定不匹配时的处理动作

This commit is contained in:
刘祥超
2020-11-18 12:17:50 +08:00
parent 850d343809
commit db770ab2a8
7 changed files with 157 additions and 30 deletions

View File

@@ -1,3 +1,32 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
/**
* 域名不匹配动作
*/
this.domainMismatchAction = "page"
this.domainMismatchActionPageOptions = {
statusCode: 404,
contentHTML: `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>404 not found</title>
</head>
<body>
<h4>找不到您要访问的页面.</h4>
<h4>Sorry, page not found.</h4>
</body>
</html>
`
}
if (this.globalConfig.httpAll.domainMismatchAction != null) {
this.domainMismatchAction = this.globalConfig.httpAll.domainMismatchAction.code
if (this.domainMismatchAction == "page") {
this.domainMismatchActionPageOptions = this.globalConfig.httpAll.domainMismatchAction.options;
}
}
})