var $=require("jquery"),DialogPC=require("./dialogPC.js"),Form=require("./form.js"),Convenient=require("./convenient.js"),initForm=function(){$(function(){"__env"in window&&"token"in window.__env&&$.ajaxSetup({headers:{"X-CSRF-TOKEN":window.__env.token}}),$("form").each(function(n,i){$(i).unbind("submit"),void 0!==$(i).attr("data-ajax-form")?Form.initAjax(i,DialogPC):$(i).is("[data-form-no-loading]")||Form.initCommon(i,DialogPC)})})},initConvenient=function(){Convenient.init(DialogPC)},Base={init:function(){initForm(),initConvenient()},defaultFormCallback:function(n,i){return Form.defaultCallback(n,i,DialogPC)},post:function(n,i,o){$.ajax({type:"post",url:n,dataType:"json",timeout:6e5,data:i,success:function(n){o&&o(n)},error:function(){o&&o({code:-999,msg:"请求出现错误 T_T"})}})}};module.exports=Base;