diff --git a/public/static/login.js b/public/static/login.js index 2ea5e9678..4cee8a680 100644 --- a/public/static/login.js +++ b/public/static/login.js @@ -33,14 +33,14 @@ $(function () { /*! 登录图形验证码刷新 */ $body.on('click', '[data-captcha]', function () { - var type, token, $that, verify, uniqid, url; - $that = $(this), url = this.getAttribute('data-captcha') || ''; - if (url.length < 5) return $.msg.tips('请设置验证码请求地址'); + var type, token, verify, uniqid, action, $that = $(this); + action = this.getAttribute('data-captcha') || location.href; + if (action.length < 5) return $.msg.tips('请设置验证码请求地址'); type = this.getAttribute('data-captcha-type') || 'captcha-type'; token = this.getAttribute('data-captcha-token') || 'captcha-token'; uniqid = this.getAttribute('data-field-uniqid') || 'uniqid'; verify = this.getAttribute('data-field-verify') || 'verify'; - $.form.load(url, {type: type, token: token}, 'post', function (ret) { + $.form.load(action, {type: type, token: token}, 'post', function (ret) { if (ret.code) { $that.html(''); $that.append($('img').attr('src', ret.data.image));