mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	WAF增加“跳转”动作
This commit is contained in:
		@@ -96,6 +96,9 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
			pageBody: defaultPageBody,
 | 
								pageBody: defaultPageBody,
 | 
				
			||||||
			defaultPageBody: defaultPageBody,
 | 
								defaultPageBody: defaultPageBody,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								redirectStatus: 307,
 | 
				
			||||||
 | 
								redirectURL: "",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			goGroupName: "",
 | 
								goGroupName: "",
 | 
				
			||||||
			goGroupId: 0,
 | 
								goGroupId: 0,
 | 
				
			||||||
			goGroup: null,
 | 
								goGroup: null,
 | 
				
			||||||
@@ -272,6 +275,9 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
			this.pageStatus = 403
 | 
								this.pageStatus = 403
 | 
				
			||||||
			this.pageBody = this.defaultPageBody
 | 
								this.pageBody = this.defaultPageBody
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								this.redirectStatus = 307
 | 
				
			||||||
 | 
								this.redirectURL = ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			this.goGroupName = ""
 | 
								this.goGroupName = ""
 | 
				
			||||||
			this.goGroupId = 0
 | 
								this.goGroupId = 0
 | 
				
			||||||
			this.goGroup = null
 | 
								this.goGroup = null
 | 
				
			||||||
@@ -398,7 +404,16 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
					if (config.options.body != null) {
 | 
										if (config.options.body != null) {
 | 
				
			||||||
						this.pageBody = config.options.body
 | 
											this.pageBody = config.options.body
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									case "redirect":
 | 
				
			||||||
 | 
										this.redirectStatus = 307
 | 
				
			||||||
 | 
										this.redirectURL = ""
 | 
				
			||||||
 | 
										if (config.options.status != null) {
 | 
				
			||||||
 | 
											this.redirectStatus = config.options.status
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										if (config.options.url != null) {
 | 
				
			||||||
 | 
											this.redirectURL = config.options.url
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
				case "go_group":
 | 
									case "go_group":
 | 
				
			||||||
					if (config.options != null) {
 | 
										if (config.options != null) {
 | 
				
			||||||
@@ -485,6 +500,23 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
					status: pageStatus,
 | 
										status: pageStatus,
 | 
				
			||||||
					body: this.pageBody
 | 
										body: this.pageBody
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
								} else if (this.actionCode == "redirect") {
 | 
				
			||||||
 | 
									let redirectStatus = this.redirectStatus.toString()
 | 
				
			||||||
 | 
									if (!redirectStatus.match(/^\d{3}$/)) {
 | 
				
			||||||
 | 
										redirectStatus = 307
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										redirectStatus = parseInt(redirectStatus)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (this.redirectURL.length == 0) {
 | 
				
			||||||
 | 
										teaweb.warn("请输入跳转到URL")
 | 
				
			||||||
 | 
										return
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									this.actionOptions = {
 | 
				
			||||||
 | 
										status: redirectStatus,
 | 
				
			||||||
 | 
										url: this.redirectURL
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			} else if (this.actionCode == "go_group") { // go_group
 | 
								} else if (this.actionCode == "go_group") { // go_group
 | 
				
			||||||
				let groupId = this.goGroupId
 | 
									let groupId = this.goGroupId
 | 
				
			||||||
				if (typeof (groupId) == "string") {
 | 
									if (typeof (groupId) == "string") {
 | 
				
			||||||
@@ -832,6 +864,18 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
				</td>
 | 
									</td>
 | 
				
			||||||
			</tr>
 | 
								</tr>
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
 | 
								<!-- redirect -->
 | 
				
			||||||
 | 
								<tr v-if="actionCode == 'redirect'">
 | 
				
			||||||
 | 
									<td>状态码 *</td>
 | 
				
			||||||
 | 
									<td><input type="text" style="width: 4em" maxlength="3" v-model="redirectStatus"/></td>
 | 
				
			||||||
 | 
								</tr>
 | 
				
			||||||
 | 
								<tr v-if="actionCode == 'redirect'">
 | 
				
			||||||
 | 
									<td>跳转到URL</td>
 | 
				
			||||||
 | 
									<td>
 | 
				
			||||||
 | 
										<input type="text" v-model="redirectURL"/>
 | 
				
			||||||
 | 
									</td>
 | 
				
			||||||
 | 
								</tr>
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			<!-- 规则分组 -->
 | 
								<!-- 规则分组 -->
 | 
				
			||||||
			<tr v-if="actionCode == 'go_group'">
 | 
								<tr v-if="actionCode == 'go_group'">
 | 
				
			||||||
				<td>下一个分组 *</td>
 | 
									<td>下一个分组 *</td>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user