new Vue({
	el: "#app",
	data: {
		code: "securitySetting"
	},
	mounted: function() {

	},
	methods: {

	}
});

$.validator.setDefaults({
	highlight: function(e) {
		$(e).closest(".form-group").removeClass("has-success").addClass("has-error")
	},
	success: function(e) {
		e.closest(".form-group").removeClass("has-error").addClass("has-success")
	},
	errorElement: "span",
	errorPlacement: function(e, r) {
		e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
	},
	errorClass: "help-block m-b-none",
	validClass: "help-block m-b-none"
}), $().ready(function() {
	var e = "<i class='fa fa-times-circle'></i> ";
	$("#passwordForm").validate({
		rules: {
			oldpassword: {
				required: !0,
				noNull: !0,
			},
			newpassword: {
				required: !0,
				noNull: !0,
			},
			confirm_password: {
				required: !0,
				noNull: !0,
				equalTo:"#newpassword"
			},
		},
		messages: {
			oldpassword: {
				required: e + "请输入旧密码",
			},
			newpassword: {
				required: e + "请输入新密码",
			},
			confirm_password: {
				required: e + "请再次输入新密码",
				equalTo:e+"两次输入的密码不一致"
			},
		}
	})
	$("#phoneForm").validate({
		rules: {
			phone: {
				required: !0,
				noNull: !0,
				regexPhone:!0
			}
		},
		messages: {
			phone: {
				required: e + "请输入手机号码",
			},
		}
	})
});
jQuery.validator.addMethod("noNull", function(value, element) {
	return this.optional(element) || !isNull(value)
}, "此项必填，不得为空！");
jQuery.validator.addMethod("regexPhone", function(value, element) {return this.optional(element) || /0?(13|14|15|18|17)[0-9]{9}/.test(value); }, "请输入正确的手机号码！"); 