Skip to content

Commit

Permalink
调整js
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyecommerce committed Nov 26, 2018
1 parent 3be58ea commit bfae7e5
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 58 deletions.
7 changes: 0 additions & 7 deletions controllers/LogoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
*/
class LogoutController extends Controller
{



public function actionIndex()
{
$isGuest = Yii::$app->user->isGuest;
Expand All @@ -34,8 +31,4 @@ public function actionIndex()
Yii::$app->getResponse()->redirect("/fecadmin/login/index")->send();
//$this->redirect("/fecadmin/login/index",200)->send();
}




}
29 changes: 27 additions & 2 deletions myassets/dwz_jui-master/js/dwz.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,31 @@ function ajaxTodo(url, callback){
});
}


function ajaxTodoPost(url, thisE, callback){
var csrfVal = thisE.attr("csrfVal");
var csrfName = thisE.attr("csrfName");
var $callback = callback || navTabAjaxDone;
if (! $.isFunction($callback)) $callback = eval('(' + callback + ')');
$.ajax({
type:'POST',
url:url,
dataType:"json",
data: function(){
var _data = {};
if (csrfName && csrfVal) {
_data[csrfName] = csrfVal;
}

return _data;
}(),
cache: false,
success: $callback,
error: DWZ.ajaxError
});
}


/**
* http://www.uploadify.com/documentation/uploadify/onqueuecomplete/
*/
Expand Down Expand Up @@ -412,11 +437,11 @@ $.fn.extend({
if (title) {
alertMsg.confirm(title, {
okCall: function(){
ajaxTodo(url, $this.attr("callback"));
ajaxTodoPost(url, $this, $this.attr("callback"));
}
});
} else {
ajaxTodo(url, $this.attr("callback"));
ajaxTodoPost(url, $this, $this.attr("callback"));
}
event.preventDefault();
});
Expand Down
8 changes: 7 additions & 1 deletion myassets/dwz_jui-master/js/dwz.database.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@

$this.click(function(){
var targetType = $this.attr("targetType");
var csrfName = $this.attr("csrfName");
var csrfVal = $this.attr("csrfVal");
var ids = _getIds(selectedIds, targetType);
if (!ids) {
alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
Expand All @@ -412,7 +414,7 @@

function _doPost(){
$.ajax({
type:'GET', url:$this.attr('href'), dataType:'json', cache: false,
type:'POST', url:$this.attr('href'), dataType:'json', cache: false,
data: function(){
if (postType == 'map'){
return $.map(ids.split(','), function(val, i) {
Expand All @@ -421,6 +423,10 @@
} else {
var _data = {};
_data[selectedIds] = ids;
if (csrfName && csrfVal) {
_data[csrfName] = csrfVal;
}

return _data;
}
}(),
Expand Down
48 changes: 24 additions & 24 deletions myassets/dwz_jui-master/js/dwz.regional.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
// jQuery validate
if ($.validator) {
$.extend($.validator.messages, {
required: "必填字段",
remote: "请修正该字段",
email: "请输入正确格式的电子邮件",
url: "请输入合法的网址",
date: "请输入合法的日期",
dateISO: "请输入合法的日期 (ISO).",
number: "请输入合法的数字",
digits: "只能输入整数",
creditcard: "请输入合法的信用卡号",
equalTo: "请再次输入相同的值",
accept: "请输入拥有合法后缀名的字符串",
maxlength: $.validator.format("长度最多是 {0} 的字符串"),
minlength: $.validator.format("长度最少是 {0} 的字符串"),
rangelength: $.validator.format("长度介于 {0} {1} 之间的字符串"),
range: $.validator.format("请输入一个介于 {0} {1} 之间的值"),
max: $.validator.format("请输入一个最大为 {0} 的值"),
min: $.validator.format("请输入一个最小为 {0} 的值"),
required: "Required field",
remote: "Please fix this field",
email: "Please enter the correct format email",
url: "Please enter the correct URL",
date: "Please enter the correct date",
dateISO: "Please enter the correct date (ISO).",
number: "Please enter the correct number",
digits: "Can only enter integers",
creditcard: "Please enter the correct credit card number",
equalTo: "Please enter the same value again",
accept: "Please enter a string with the correct suffix",
maxlength: $.validator.format("a string of up to {0} in length"),
minlength: $.validator.format("a string with a minimum length of {0}"),
rangelength: $.validator.format("a string between {0} and {1}"),
range: $.validator.format("Please enter a value between {0} and {1}"),
max: $.validator.format("Please enter a value of up to {0}"),
min: $.validator.format("Please enter a value with a minimum of {0}"),

alphanumeric: "字母、数字、下划线",
lettersonly: "必须是字母",
phone: "数字、空格、括号"
alphanumeric: "Letters, numbers, underscores",
lettersonly: "Must be a letter",
phone: "Numbers, spaces, parentheses"
});
}

// DWZ regional
$.setRegional("datepicker", {
dayNames: ['', '', '', '', '', '', ''],
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
dayNames: ['seven', 'one', 'two', 'three', 'four', 'five', 'six'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
});
$.setRegional("alertMsg", {
title:{error:"错误", info:"提示", warn:"警告", correct:"成功", confirm:"确认提示"},
butMsg:{ok:"确定", yes:"", no:"", cancel:"取消"}
title:{error:"Error", info:"Prompt", warn:"Warning", correct:"Success", confirm:"Confirm Prompt"},
butMsg:{ok:"Ok", yes:"Yes", no:"No", cancel:"Cancel"}
});
})(jQuery);
48 changes: 24 additions & 24 deletions myassets/dwz_jui-master/js/dwz.regional.zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
// jQuery validate
if ($.validator) {
$.extend($.validator.messages, {
required: "Required field",
remote: "Please fix this field",
email: "Please enter the correct format email",
url: "Please enter the correct URL",
date: "Please enter the correct date",
dateISO: "Please enter the correct date (ISO).",
number: "Please enter the correct number",
digits: "Can only enter integers",
creditcard: "Please enter the correct credit card number",
equalTo: "Please enter the same value again",
accept: "Please enter a string with the correct suffix",
maxlength: $.validator.format("a string of up to {0} in length"),
minlength: $.validator.format("a string with a minimum length of {0}"),
rangelength: $.validator.format("a string between {0} and {1}"),
range: $.validator.format("Please enter a value between {0} and {1}"),
max: $.validator.format("Please enter a value of up to {0}"),
min: $.validator.format("Please enter a value with a minimum of {0}"),
required: "必填字段",
remote: "请修正该字段",
email: "请输入正确格式的电子邮件",
url: "请输入合法的网址",
date: "请输入合法的日期",
dateISO: "请输入合法的日期 (ISO).",
number: "请输入合法的数字",
digits: "只能输入整数",
creditcard: "请输入合法的信用卡号",
equalTo: "请再次输入相同的值",
accept: "请输入拥有合法后缀名的字符串",
maxlength: $.validator.format("长度最多是 {0} 的字符串"),
minlength: $.validator.format("长度最少是 {0} 的字符串"),
rangelength: $.validator.format("长度介于 {0} {1} 之间的字符串"),
range: $.validator.format("请输入一个介于 {0} {1} 之间的值"),
max: $.validator.format("请输入一个最大为 {0} 的值"),
min: $.validator.format("请输入一个最小为 {0} 的值"),

alphanumeric: "Letters, numbers, underscores",
lettersonly: "Must be a letter",
phone: "Numbers, spaces, parentheses"
alphanumeric: "字母、数字、下划线",
lettersonly: "必须是字母",
phone: "数字、空格、括号"
});
}

// DWZ regional
$.setRegional("datepicker", {
dayNames: ['seven', 'one', 'two', 'three', 'four', 'five', 'six'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
dayNames: ['', '', '', '', '', '', ''],
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
});
$.setRegional("alertMsg", {
title:{error:"Error", info:"Prompt", warn:"Warning", correct:"Success", confirm:"Confirm Prompt"},
butMsg:{ok:"Ok", yes:"Yes", no:"No", cancel:"Cancel"}
title:{error:"错误", info:"提示", warn:"警告", correct:"成功", confirm:"确认提示"},
butMsg:{ok:"确定", yes:"", no:"", cancel:"取消"}
});
})(jQuery);

0 comments on commit bfae7e5

Please sign in to comment.