//提交表单
$("#finished_button").on("click", function(){
  var title = $("#detail_form").find("input[name='title']");
  var domain = $("#detail_form").find("input[name='domain']");
  if($(title).val()==""){
    layer.msg("请填写网站名称", {icon:2});
    return false;
  }
  if($(domain).val()==""){
    layer.msg("请填写网站域名", {icon:2});
    return false;
  }
  $("#detail_form").ajaxSubmit({
      url: '/glconfig/default/basicok', 
      type: 'POST',
      dataType: "json", 
      beforeSend: function(){
        layer.load(0, {shade: [0.2, '#393D49']});
      },
      success: function(data){
        if(data.code=="success"){
            layer.msg('成功', {icon: 1});
        }else{
            layer.msg(data.msg, {icon: 2});
        }
      },
      error: function(){
        layer.msg("系统错误，请联系管理员", {icon: 2});
      },
      complete: function(){
        layer.closeAll('loading');
      }
  });
  return false;
});