(function (mod) { if (typeof exports == "object" && typeof module == "object") // commonjs 规范 module.exports = mod; else if (typeof define == "function" && define.amd) // amd 规范 return define(["jquery", "tools"], mod); // plain browser env 浏览器 else mod($, tools); })(function ($, tools) { // var $ = require(['jquery']); // var tools = require(['tools']); // 对分页的链接添加处理 if (!tools.isemptyvalue($(".pagination").toarray())) { $(".pagination>a ").each(function (index, el) { if ($(el).attr("href") != "#") { el.href += location.search; } }); } // 验证码 $('input[name="captcha"]').one("focusin", function (e) { var img = $(this).nextall("img.captcha"); if (tools.isemptyvalue(img)) { var imgstr = ' 3 && code.length < 8 && !_self.attr("readonly")) { $.ajax({ url: site_url + "service/captcha_ajax", type: "get", datatype: "json", data: { code: code, }, }) .done(function (data) { console.log("success"); if (data.status) { _self.removeclass("error").addclass("success"); _self.next("img").remove(); _self.attr("readonly", true); _self.nextall(".captcha_no").remove(); _self.nextall(".captcha_ok").remove(); _self.after( '' ); } else { _self.removeclass("success").addclass("error"); _self.nextall(".captcha_ok").remove(); _self.nextall(".captcha_no").remove(); _self .next() .after( '×' ); } }) .fail(function () { console.log("error"); }) .always(function () { console.log("complete"); }); } }); // 默认加载验证码 function pic() { var imgstr = '