mirror of https://gitee.com/karson/fastadmin.git
Compare commits
5 Commits
76024147aa
...
d4c866cb55
| Author | SHA1 | Date |
|---|---|---|
|
|
d4c866cb55 | |
|
|
47c4115a53 | |
|
|
5a29c4eeed | |
|
|
7898b811b2 | |
|
|
0de3858c90 |
|
|
@ -8,7 +8,7 @@
|
|||
<div class="input-group">
|
||||
<input type="text" name="captcha" class="form-control" data-rule="required;length({$Think.config.captcha.length})" />
|
||||
<span class="input-group-btn" style="padding:0;border:none;">
|
||||
<img src="{:captcha_src()}" width="107" height="32" onclick="this.src = '{:captcha_src()}?r=' + Math.random();"/>
|
||||
<img src="{:captcha_src()}" width="107" height="32" class="captcha-img" onclick="this.src = '{:captcha_src()}?r=' + Math.random();"/>
|
||||
</span>
|
||||
</div>
|
||||
<span class="msg-box n-right" style="left:0;top:33px;text-align: left;" for="captcha"></span>
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
|
|||
//如果登录已经超时,重新提醒登录
|
||||
if (uid && uid != ret.data.uid) {
|
||||
Controller.api.userinfo.set(null);
|
||||
$(".operate[data-name='" + name + "'] .btn-install").trigger("click");
|
||||
$(".operate[data-name='" + name + "'] .btn-install:first").trigger("click");
|
||||
return;
|
||||
}
|
||||
top.Fast.api.open(ret.data.payurl, __('Pay now'), {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ define(['fast', 'template', 'moment'], function (Fast, Template, Moment) {
|
|||
var Frontend = {
|
||||
api: {
|
||||
//发送验证码
|
||||
sendcaptcha: function (btn, type, data, callback) {
|
||||
sendcaptcha: function (btn, type, data, success, error) {
|
||||
$(btn).addClass("disabled", true).text("发送中...");
|
||||
var si = {};
|
||||
Frontend.api.ajax({url: $(btn).data("url"), data: data}, function (data, ret) {
|
||||
|
|
@ -17,11 +17,15 @@ define(['fast', 'template', 'moment'], function (Fast, Template, Moment) {
|
|||
$(btn).addClass("disabled").text(seconds + "秒后可再次发送");
|
||||
}
|
||||
}, 1000);
|
||||
if (typeof callback == 'function') {
|
||||
callback.call(this, data, ret);
|
||||
if (typeof success == 'function') {
|
||||
success.call(this, data, ret);
|
||||
}
|
||||
}, function () {
|
||||
}, function (data, ret) {
|
||||
$(btn).removeClass("disabled").text('发送验证码');
|
||||
|
||||
if (typeof error == 'function') {
|
||||
error.call(this, data, ret);
|
||||
}
|
||||
});
|
||||
},
|
||||
//准备验证码
|
||||
|
|
@ -39,6 +43,8 @@ define(['fast', 'template', 'moment'], function (Fast, Template, Moment) {
|
|||
data.captcha = $("input[name=captcha]", form).val();
|
||||
Frontend.api.sendcaptcha(btn, type, data, function (data, ret) {
|
||||
Layer.close(index);
|
||||
}, function (data, ret) {
|
||||
$("img.captcha-img", form).trigger("click");
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
|||
};
|
||||
var origincallback = function (start, end) {
|
||||
$(this.element).val(start.format(this.locale.format) + " - " + end.format(this.locale.format));
|
||||
$(this.element).trigger('change');
|
||||
$(this.element).trigger('change').trigger('validate');
|
||||
};
|
||||
$(".datetimerange", form).each(function () {
|
||||
var callback = typeof $(this).data('callback') == 'function' ? $(this).data('callback') : origincallback;
|
||||
|
|
@ -227,7 +227,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
|||
callback.call(picker, picker.startDate, picker.endDate);
|
||||
});
|
||||
$(this).on('cancel.daterangepicker', function (ev, picker) {
|
||||
$(this).val('').trigger('change');
|
||||
$(this).val('').trigger('change').trigger('validate');
|
||||
});
|
||||
$(this).daterangepicker($.extend(true, {}, options, $(this).data() || {}, $(this).data("daterangepicker-options") || {}));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -833,8 +833,11 @@ define(['jquery', 'bootstrap'], function ($, undefined) {
|
|||
},
|
||||
search: function (value, row, index) {
|
||||
var field = this.field;
|
||||
if (typeof this.customField !== 'undefined' && typeof row[this.customField] !== 'undefined') {
|
||||
value = row[this.customField];
|
||||
if (typeof this.customField !== 'undefined') {
|
||||
var customValue = this.customField.split('.').reduce(function (obj, key) {
|
||||
return obj === null || obj === undefined ? '' : obj[key];
|
||||
}, row);
|
||||
value = Fast.api.escape(customValue);
|
||||
field = this.customField;
|
||||
}
|
||||
return '<a href="javascript:;" class="searchit" data-toggle="tooltip" title="' + __('Click to search %s', value) + '" data-field="' + field + '" data-value="' + value + '">' + value + '</a>';
|
||||
|
|
@ -858,8 +861,11 @@ define(['jquery', 'bootstrap'], function ($, undefined) {
|
|||
colorArr = $.extend(colorArr, this.custom);
|
||||
}
|
||||
var field = this.field;
|
||||
if (typeof this.customField !== 'undefined' && typeof row[this.customField] !== 'undefined') {
|
||||
value = row[this.customField];
|
||||
if (typeof this.customField !== 'undefined') {
|
||||
var customValue = this.customField.split('.').reduce(function (obj, key) {
|
||||
return obj === null || obj === undefined ? '' : obj[key];
|
||||
}, row);
|
||||
value = Fast.api.escape(customValue);
|
||||
field = this.customField;
|
||||
}
|
||||
if (typeof that.searchList === 'object' && typeof that.custom === 'undefined') {
|
||||
|
|
@ -1011,17 +1017,11 @@ define(['jquery', 'bootstrap'], function ($, undefined) {
|
|||
url + (url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + '{ids}' : url;
|
||||
url = url.replace(/\{(.*?)\}/gi, function (matched) {
|
||||
matched = matched.substring(1, matched.length - 1);
|
||||
if (matched.indexOf(".") !== -1) {
|
||||
var temp = row;
|
||||
var arr = matched.split(/\./);
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (typeof temp[arr[i]] !== 'undefined') {
|
||||
temp = temp[arr[i]];
|
||||
}
|
||||
}
|
||||
return typeof temp === 'object' ? '' : temp;
|
||||
}
|
||||
return row[matched];
|
||||
var temp = matched.split('.').reduce(function (obj, key) {
|
||||
return obj === null || obj === undefined ? '' : obj[key];
|
||||
}, row);
|
||||
temp = Fast.api.escape(temp);
|
||||
return temp;
|
||||
});
|
||||
return url;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue