//提交表单
$("#finished_button").on("click", function(){
  var serialkey = $("#detail_form").find("input[name='serialkey']");
  if($(serialkey).val()==""){
    layer.tips('请填写序列号', $(serialkey), {tips: [1, '#FF5722']});
    return false;
  }
  $("#detail_form").ajaxSubmit({
    url: '/glconfig/serialkey/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}, function(){window.location.reload();});
      }else{
        layer.msg(data.msg, {icon: 2});
      }
    },
    error: function(){
      layer.msg("系统错误，请联系管理员", {icon: 2});
    },
    complete: function(){
      layer.closeAll('loading');
    }
  });
  return false;
});