webpackJsonp([11],{ /***/ "6Ne4": /***/ (function(module, exports) { module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAGCAYAAAD37n+BAAAAAXNSR0IArs4c6QAAAGlJREFUGBljYMADzNb/32yz5b8SshImZA46+z8Dg8+vPwxXzTb+r3fY/58DJM9ouv4/UJwocI+RmSEfrw3YjGHEJggTA9nOyMjwg+E/QyeXAEPHAUfGHywwSWw00LQtbCwM+Ud8GO/B5AGtthyEfV9L2gAAAABJRU5ErkJggg==" /***/ }), /***/ "AdUx": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm.js var vuex_esm = __webpack_require__("NYxO"); // EXTERNAL MODULE: ./src/common/util.js var util = __webpack_require__("s0MJ"); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/pages/siteManagement/addSiteFolder/First.vue // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var First = ({ components: {}, data: function data() { var _this = this; var that = this; var validateDomianBack = function validateDomianBack(rule, value, callback) { var domainRex = /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/; if (value != null && value != "") { if (!domainRex.test(value)) { callback(new Error('请填写正确的域名')); } else { callback(); } } else { callback(); } }; var validateIPBack = function validateIPBack(rule, value, callback) { if (value != null && value != "") { var IPRex = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/; var ips = value.split(","); var length = ips.length; var isvalid = true; var errorText = '请填写正确的源站IP'; if (length >= 2) { that.balancingflag = false; } else { that.balancingflag = true; that.form.balancing = 0; } for (var i = 0; i < length; i++) { if (!IPRex.test(ips[i]) && length <= 20) { isvalid = false; } if (length > 20) { isvalid = false; errorText = '源站IP最多输入20个'; } } if (!isvalid) { callback(new Error(errorText)); } else { callback(); } } else { callback(); } }; var validateDomainBack = function validateDomainBack(rule, value, callback) { var domainRex = /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/; if (value != null && value != "") { if (!domainRex.test(value)) { callback(new Error('请填写正确的回源域名')); } else { callback(); } } else { callback(); } }; var validatePortStyle = function validatePortStyle(rule, value, callback) { var portRex = /^[0-9,]{0,}$/; var ports = _this.Meta.httpPorts; var valueArray = []; if (value != null && value != "") { if (!portRex.test(value)) { callback(new Error('输入格式不正确')); } else { if (value.toString().indexOf(",") > -1) { valueArray = value.split(","); } else { valueArray[0] = value; } var outArray = util["a" /* default */].arrayContainsArray(valueArray, ports).toString(); if (outArray != '') { callback(new Error('您输入的端口不在可用范围内')); } else { if (valueArray.length > 10) { callback(new Error('最多填写10个端口')); } else { callback(); } } } } else { callback(); } }; var validatehttpsPortStyle = function validatehttpsPortStyle(rule, value, callback) { var portRex = /^[0-9,]{0,}$/; var ports = _this.Meta.httpsPorts; var valueArray = []; if (value != null && value != "") { if (!portRex.test(value)) { callback(new Error('输入格式不正确')); } else { if (value.toString().indexOf(",") > -1) { valueArray = value.split(","); } else { valueArray[0] = value; } var outArray = util["a" /* default */].arrayContainsArray(valueArray, ports).toString(); if (outArray != '') { callback(new Error('您输入的端口不在可用范围内')); } else { if (valueArray.length > 10) { callback(new Error('最多填写10个端口')); } else { callback(); } } } } else { callback(); } }; return { provinces: [], areaFlagprovinces: [], isHttp: false, ports: '', isHttps: false, httpsTip: false, balancingflag: true, showDetailSearch: false, httpPorts: this.Meta.httpPorts, httpsPorts: this.Meta.httpsPorts, isDone: false, siteFormRules: { account: [{ required: true, message: '用户名不能为空', trigger: ['blur', 'change'] }, { min: 1, max: 11, message: '用户名不存在', trigger: ['blur', 'change'] }], property: [{ required: true, message: '省份不能为空', trigger: ['blur', 'change'] }], areaFlag: [{ required: true, message: '下发配置省份不能为空', trigger: ['blur', 'change'] }], areaCode: [{ required: true, message: '区域不能为空', trigger: ['blur', 'change'] }], domain: [{ required: true, message: '域名不能为空', trigger: ['blur', 'change'] }, { validator: validateDomianBack, trigger: ['blur', 'change'] }], isHttps: [{ required: true, message: '协议类型不能为空', trigger: ['blur', 'change'] }], backendAddrIP: [{ required: true, message: '源站IP不能为空', trigger: ['blur', 'change'] }, { validator: validateIPBack, trigger: ['blur', 'change'] }], backendAddrDomain: [{ required: true, message: '服务器回源域名不能为空', trigger: ['blur', 'change'] }, { validator: validateDomainBack, trigger: ['blur', 'change'] }], httpsCrt: [{ required: true, message: '证书文件不能为空', trigger: ['blur', 'change'] }], httpsKey: [{ required: true, message: '私钥文件不能为空', trigger: ['blur', 'change'] }], port: [{ required: true, message: 'HTTP端口不能为空', trigger: ['blur', 'change'] }, { validator: validatePortStyle, trigger: ['blur', 'change'] }], httpsPort: [{ required: true, message: 'HTTPS端口不能为空', trigger: ['blur', 'change'] }, { validator: validatehttpsPortStyle, trigger: ['blur', 'change'] }] }, form: { account: "", property: "", areaFlag: "", areaCode: [], domain: "", isHttps: [], httpsForcedJump: false, httpSource: false, httpsCrt: "", httpsKey: "", port: 80, httpsPort: 443, backType: 0, backendAddrDomain: '', backendAddrIP: '', agentState: 0, balancing: 0 }, URL: { getArea: '/website/rest/queryArea', getProvince: '/admin/common/getProvinces', createDomain: '/website/createWebsiteInfo', getWafNode: '/website/rest/queryWafNode', checkDomain: '/website/createWebsiteInfo' } }; }, computed: Object(vuex_esm["b" /* mapState */])({ contextPath: 'urlHost', roleAction: 'roleAction' }), mounted: function mounted() { var first = this.$route.query.data; if (first != 'first') { this.clearForm(); } else { this.form = this.$store.getters.getAddForm; this.handleHttpsChange(this.form.isHttps); if (this.form.httpsForcedJump || this.form.httpSource) { this.showDetailSearch = true; } } if (this.roleAction.province) { this.getProvince(); this.getAreaProvince(); } }, methods: { openHideArea: function openHideArea() { this.showDetailSearch = !this.showDetailSearch; }, radioChange: function radioChange(val) { if (val == 0) { this.$refs['backendAddrIP'].clearValidate(); } if (val == 1) { this.$refs['backendAddrDomain'].clearValidate(); } }, changeState: function changeState(val) { if (val) { var that = this; this.$confirm('勾选后,部分浏览器将被缓存设置为使用HTTPS请求访问该网站,请确保网站支持HTTPS业务', '提示', { customClass: 'wafConfirm', confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(function () {}).catch(function () { that.form.httpsForcedJump = false; }); } }, getProvince: function getProvince() { var that = this; this.$axios({ method: 'get', url: that.contextPath + that.URL.getArea + "?type=''", needInterceptors: true, showError: true, loader: true }).then(function (res) { that.provinces = res; }); }, getAreaProvince: function getAreaProvince() { var that = this; this.$axios({ method: 'get', url: that.contextPath + that.URL.getArea + "?type=QUERY", needInterceptors: true, showError: true, loader: true }).then(function (res) { that.areaFlagprovinces = res; }); }, clearForm: function clearForm() { this.$refs['form'].resetFields(); }, handleHttpsChange: function handleHttpsChange(value) { this.httpsTip = false; this.isHttp = false; this.isHttps = false; var length = value.length; for (var i = 0; i < length; i++) { if (value[i] == 0) { this.httpsTip = true; this.isHttps = true; } if (value[i] == 1) { this.isHttp = true; this.form.httpsForcedJump = false; } } if (!this.isHttps) { this.form.httpsForcedJump = false; this.form.httpSource = false; this.showDetailSearch = false; } }, cancel: function cancel() { this.clearForm(); this.$router.push({ path: '/siteSet' }); }, next: function next() { this.addDomain(); }, addDomain: function addDomain() { var _this2 = this; var that = this; that.$refs['form'].validate(function (valid) { if (valid) { _this2.isDone = true; that.$store.commit('$_setSiteForm', that.form); that.$store.commit('$_setCheckForm', that.form); that.$axios({ method: 'post', url: that.contextPath + that.URL.createDomain, data: that.$store.getters.getCheckForm, needInterceptors: true, showError: true }).then(function (res) { that.$store.commit('$_setActive', 1); that.$router.push({ path: '/secondSite' }); }).catch(function () { that.isDone = false; }); } }); } } }); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-167ea706","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/pages/siteManagement/addSiteFolder/First.vue var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"addSiteArea"},[_c('el-form',{ref:"form",attrs:{"model":_vm.form,"rules":_vm.siteFormRules,"label-width":"160px"}},[_c('el-form-item',{attrs:{"label":"用户名","prop":"account"}},[_c('el-input',{attrs:{"placeholder":"请输入用户名"},model:{value:(_vm.form.account),callback:function ($$v) {_vm.$set(_vm.form, "account", $$v)},expression:"form.account"}})],1),_vm._v(" "),(_vm.roleAction.province)?_c('el-form-item',{attrs:{"label":"省份","prop":"property"}},[(_vm.roleAction.province)?_c('el-select',{attrs:{"size":"small","collapse-tags":"","placeholder":"请选择省份"},model:{value:(_vm.form.property),callback:function ($$v) {_vm.$set(_vm.form, "property", $$v)},expression:"form.property"}},_vm._l((_vm.provinces),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1):_vm._e()],1):_vm._e(),_vm._v(" "),(_vm.roleAction.province)?_c('el-form-item',{attrs:{"label":"下发配置省份","prop":"areaFlag"}},[(_vm.roleAction.province)?_c('el-select',{attrs:{"size":"small","collapse-tags":"","placeholder":"请选择省份"},model:{value:(_vm.form.areaFlag),callback:function ($$v) {_vm.$set(_vm.form, "areaFlag", $$v)},expression:"form.areaFlag"}},_vm._l((_vm.areaFlagprovinces),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1):_vm._e()],1):_vm._e(),_vm._v(" "),_c('el-form-item',{attrs:{"label":"域名","prop":"domain"}},[_c('el-input',{attrs:{"placeholder":"输入您想要保护的域名,例如apkshield.komect.com"},model:{value:(_vm.form.domain),callback:function ($$v) {_vm.$set(_vm.form, "domain", $$v)},expression:"form.domain"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"协议类型","prop":"isHttps"}},[_c('el-checkbox-group',{staticStyle:{"width":"100%"},on:{"change":_vm.handleHttpsChange},model:{value:(_vm.form.isHttps),callback:function ($$v) {_vm.$set(_vm.form, "isHttps", $$v)},expression:"form.isHttps"}},[_c('el-checkbox',{attrs:{"label":1}},[_vm._v("HTTP")]),_vm._v(" "),_c('el-checkbox',{attrs:{"label":0}},[_vm._v("HTTPS")]),_vm._v(" "),(_vm.isHttps)?_c('div',{staticClass:"siteSearch",on:{"click":_vm.openHideArea}},[_vm._v("高级设置\n "),_c('div',{class:{'el-icon-arrow-down': !_vm.showDetailSearch, 'el-icon-arrow-up': _vm.showDetailSearch}})]):_vm._e()],1),_vm._v(" "),(_vm.httpsTip)?_c('span',{staticClass:"httpsAlert"},[_vm._v("当前域名的类型为HTTPS,需要进行证书和私钥才能正常防护网站")]):_vm._e()],1),_vm._v(" "),(_vm.showDetailSearch && _vm.isHttps)?_c('el-form-item',{staticClass:"setHinfo",attrs:{"label":"","prop":""}},[_c('el-row',{attrs:{"gutter":2}},[_c('el-col',{attrs:{"span":12}},[_c('el-row',[_c('el-switch',{attrs:{"disabled":_vm.isHttp,"inactive-text":"开启HTTPS的强制跳转"},on:{"change":_vm.changeState},model:{value:(_vm.form.httpsForcedJump),callback:function ($$v) {_vm.$set(_vm.form, "httpsForcedJump", $$v)},expression:"form.httpsForcedJump"}})],1),_vm._v(" "),_c('el-row',[(!_vm.isHttp && _vm.isHttps)?_c('span',{staticClass:"swithSpan"},[_vm._v("开启后,HTTP请求将显示为HTTPS,端口只支持填写1个,默认跳转到443端口")]):_vm._e(),_vm._v(" "),(_vm.isHttp)?_c('span',{staticClass:"swithSpan"},[_vm._v("请先取消HTTP协议")]):_vm._e()]),_vm._v(" "),_c('el-row',[_c('el-switch',{attrs:{"inactive-text":"开启HTTP回源"},model:{value:(_vm.form.httpSource),callback:function ($$v) {_vm.$set(_vm.form, "httpSource", $$v)},expression:"form.httpSource"}})],1),_vm._v(" "),_c('el-row',[_c('span',{staticClass:"swithSpan"},[_vm._v("若您的网站不支持HTTPS回源,请务必开启此项,端口只支持填写1个,默认回源端口为80")])])],1),_vm._v(" "),_c('el-col',{staticClass:"tipArea",attrs:{"span":12}},[_c('el-row',[_c('span',{staticClass:"swithSpan"},[_vm._v("示意图:")])]),_vm._v(" "),_c('el-row',[_c('el-col',{attrs:{"span":4.5}},[_c('span',{staticClass:"swithSpanB"},[_vm._v("客户端浏览器")])]),_vm._v(" "),_c('el-col',{attrs:{"span":6}},[(!_vm.form.httpsForcedJump)?_c('span',{staticClass:"swithSpanT"},[_vm._v("HTTPS")]):_vm._e(),_vm._v(" "),(_vm.form.httpsForcedJump)?_c('span',{staticClass:"swithSpanT"},[_vm._v("强制HTTPS访问")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"swithSpanI"},[_c('img',{attrs:{"src":__webpack_require__("6Ne4")}})])]),_vm._v(" "),_c('el-col',{attrs:{"span":2}},[_c('span',{staticClass:"swithSpanB"},[_vm._v("WAF")])]),_vm._v(" "),_c('el-col',{attrs:{"span":4}},[(!_vm.form.httpSource)?_c('span',{staticClass:"swithSpanT"},[_vm._v("HTTPS")]):_vm._e(),_vm._v(" "),(_vm.form.httpSource)?_c('span',{staticClass:"swithSpanT"},[_vm._v("HTTP")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"swithSpanI"},[_c('img',{attrs:{"src":__webpack_require__("6Ne4")}})])]),_vm._v(" "),_c('el-col',{attrs:{"span":3}},[_c('span',{staticClass:"swithSpanB"},[_vm._v("服务器")])])],1)],1)],1)],1):_vm._e(),_vm._v(" "),(_vm.httpsTip)?_c('el-form-item',{attrs:{"label":"证书文件","prop":"httpsCrt"}},[_c('el-input',{attrs:{"type":"textarea"},model:{value:(_vm.form.httpsCrt),callback:function ($$v) {_vm.$set(_vm.form, "httpsCrt", $$v)},expression:"form.httpsCrt"}})],1):_vm._e(),_vm._v(" "),(_vm.httpsTip)?_c('el-form-item',{attrs:{"label":"私钥文件","prop":"httpsKey"}},[_c('el-input',{attrs:{"type":"textarea"},model:{value:(_vm.form.httpsKey),callback:function ($$v) {_vm.$set(_vm.form, "httpsKey", $$v)},expression:"form.httpsKey"}})],1):_vm._e(),_vm._v(" "),_c('el-form-item',{attrs:{"label":"服务器地址"}},[_c('el-radio-group',{on:{"change":_vm.radioChange},model:{value:(_vm.form.backType),callback:function ($$v) {_vm.$set(_vm.form, "backType", $$v)},expression:"form.backType"}},[_c('el-radio',{attrs:{"label":0}},[_vm._v("IP")]),_vm._v(" "),_c('el-radio',{attrs:{"label":1}},[_vm._v("其它地址")])],1)],1),_vm._v(" "),(_vm.form.backType == 0)?_c('el-form-item',{ref:"backendAddrIP",attrs:{"label":"","prop":"backendAddrIP"}},[_c('el-input',{attrs:{"type":"textarea","placeholder":"输入源站IP地址,例如112.13.96.133,不支持网段,请以英文“,”隔开,最多20个"},model:{value:(_vm.form.backendAddrIP),callback:function ($$v) {_vm.$set(_vm.form, "backendAddrIP", $$v)},expression:"form.backendAddrIP"}})],1):_vm._e(),_vm._v(" "),(_vm.form.backType == 1)?_c('el-form-item',{ref:"backendAddrDomain",attrs:{"label":"","prop":"backendAddrDomain"}},[_c('el-input',{attrs:{"type":"textarea","rows":1,"placeholder":"请输入服务器回源域名"},model:{value:(_vm.form.backendAddrDomain),callback:function ($$v) {_vm.$set(_vm.form, "backendAddrDomain", $$v)},expression:"form.backendAddrDomain"}})],1):_vm._e(),_vm._v(" "),_c('el-form-item',{attrs:{"label":"服务器端口"}},[(!_vm.isHttp && !_vm.isHttps)?_c('span',[_vm._v("--")]):_vm._e(),_vm._v(" "),(_vm.isHttp)?_c('el-form-item',{staticStyle:{"margin-bottom":"18px"},attrs:{"prop":"port"}},[_c('el-input',{staticClass:"port",attrs:{"placeholder":"请输入内容"},model:{value:(_vm.form.port),callback:function ($$v) {_vm.$set(_vm.form, "port", $$v)},expression:"form.port"}},[_c('template',{slot:"prepend"},[_vm._v("HTTP端口")])],2)],1):_vm._e(),_vm._v(" "),(_vm.isHttps)?_c('el-form-item',{attrs:{"prop":"httpsPort"}},[_c('el-input',{attrs:{"placeholder":"请输入内容"},model:{value:(_vm.form.httpsPort),callback:function ($$v) {_vm.$set(_vm.form, "httpsPort", $$v)},expression:"form.httpsPort"}},[_c('template',{slot:"prepend"},[_vm._v("HTTPS端口")])],2)],1):_vm._e(),_vm._v(" "),(_vm.isHttp || _vm.isHttps)?_c('span',{staticStyle:{"color":"#96A5BC","margin-top":"10px","display":"block"}},[_vm._v("如有其他端口,请补充并以英文“,”隔开,最多10个;查看服务器端口\n "),_c('el-popover',{ref:"popover1",attrs:{"popper-class":"addSitePoper","placement":"top-start","title":"","width":"500","trigger":"hover"}},[_c('p',[_vm._v("1.除80和443端口外,其余非标端口生效需3个工作日")]),_vm._v(" "),_c('p',[_vm._v("2.HTTP协议支持以下端口")]),_vm._v(" "),_c('p',[_vm._v(_vm._s(_vm.httpPorts))]),_vm._v(" "),_c('p',[_vm._v("3.HTTPS协议支持以下端口:")]),_vm._v(" "),_c('p',[_vm._v(_vm._s(_vm.httpsPorts))])]),_vm._v(" "),_c('span',{directives:[{name:"popover",rawName:"v-popover:popover1",arg:"popover1"}],staticStyle:{"color":"#357FFF"}},[_vm._v("支持范围")]),_vm._v("\n ;")],1):_vm._e()],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"WAF前是否有七层代理","prop":"resource"}},[_c('el-radio-group',{model:{value:(_vm.form.agentState),callback:function ($$v) {_vm.$set(_vm.form, "agentState", $$v)},expression:"form.agentState"}},[_c('el-radio',{attrs:{"label":1}},[_vm._v("是")]),_vm._v(" "),_c('el-radio',{attrs:{"label":0}},[_vm._v("否")])],1)],1),_vm._v(" "),(_vm.form.backType == 0)?_c('el-form-item',{attrs:{"label":"负载均衡算法","prop":"resource"}},[_c('el-radio-group',{attrs:{"disabled":_vm.balancingflag},model:{value:(_vm.form.balancing),callback:function ($$v) {_vm.$set(_vm.form, "balancing", $$v)},expression:"form.balancing"}},[_c('el-radio',{attrs:{"label":0}},[_vm._v("轮询")]),_vm._v(" "),_c('el-radio',{attrs:{"label":1}},[_vm._v("IP hash")])],1)],1):_vm._e(),_vm._v(" "),_c('el-row',[_c('el-col',{attrs:{"span":24}},[_c('div',{staticClass:"grid-content",staticStyle:{"text-align":"center","height":"50px"}},[_c('el-button',{attrs:{"size":"small"},on:{"click":_vm.cancel}},[_vm._v("取消")]),_vm._v(" "),_c('el-button',{attrs:{"size":"small","type":"primary","disabled":_vm.isDone},on:{"click":_vm.next},nativeOn:{"keyup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.next($event)}}},[_vm._v("下一步")])],1)])],1)],1)],1)])} var staticRenderFns = [] var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ var addSiteFolder_First = (esExports); // CONCATENATED MODULE: ./src/pages/siteManagement/addSiteFolder/First.vue function injectStyle (ssrContext) { __webpack_require__("lbyt") } var normalizeComponent = __webpack_require__("VU/8") /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( First, addSiteFolder_First, __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ var siteManagement_addSiteFolder_First = __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ "lbyt": /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }) });