Browse Source

修复页签属性refresh为undefined时页面被刷新问题

RuoYi 3 years ago
parent
commit
c92ed66436

+ 1 - 1
ruoyi-admin/src/main/resources/static/ruoyi/index.js

@@ -440,7 +440,7 @@ $(function() {
             $('.mainContent .RuoYi_iframe').each(function() {
                 if ($(this).data('id') == currentId) {
                     $(this).show().siblings('.RuoYi_iframe').hide();
-                    isRefresh = $(this).data('refresh');
+                    isRefresh = $.common.nullToDefault($(this).data('refresh'), false);
                     return false;
                 }
             });

+ 4 - 0
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -1563,6 +1563,10 @@ var table = {
             isNotEmpty: function (value) {
                 return !$.common.isEmpty(value);
             },
+            // 如果值是空,则返回指定默认字符串,否则返回字符串本身
+            nullToDefault: function (value, defaultValue) {
+                return $.common.isEmpty(value) ? defaultValue : value;
+            },
             // 空对象转字符串
             nullToStr: function(value) {
                 if ($.common.isEmpty(value)) {