var $=require("jquery"),DialogMobile=require("./dialogMobile.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,DialogMobile):$(i).is("[data-form-no-loading]")||Form.initCommon(i,DialogMobile)})})},initConvenient=function(){Convenient.init(DialogMobile)},Base={init:function(){initForm(),initConvenient()},defaultFormCallback:function(n,i){return Form.defaultCallback(n,i,DialogMobile)},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;