Showing
1 changed file
with
18 additions
and
3 deletions
@@ -2034,14 +2034,29 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions | @@ -2034,14 +2034,29 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions | ||
2034 | type: "get", | 2034 | type: "get", |
2035 | success: function (res) { | 2035 | success: function (res) { |
2036 | if (res.success) { | 2036 | if (res.success) { |
2037 | - var lgn = localStorage.getItem("lgn"); | ||
2038 | - if (res.str && res.str.indexOf(lgn) != -1) { | ||
2039 | - refresh(); | 2037 | + if (res.str && res.str.length>0) { |
2038 | + var lgn = localStorage.getItem("lgn"); | ||
2039 | + var userNames = res.str.split(","); | ||
2040 | + if (isStrInArray(lgn,userNames)){ //当当前用户是配置的永久登录用户时,进行首页自动刷新 | ||
2041 | + refresh(); | ||
2042 | + } | ||
2040 | } | 2043 | } |
2041 | } | 2044 | } |
2042 | } | 2045 | } |
2043 | }); | 2046 | }); |
2044 | } | 2047 | } |
2048 | + /** | ||
2049 | + * 判定数组包含指定字符串 | ||
2050 | + * */ | ||
2051 | + function isStrInArray(str, arr) { | ||
2052 | + let n = arr.length; | ||
2053 | + for (let i = 0; i < n; i++) { | ||
2054 | + if (arr[i] == str) { | ||
2055 | + return true; | ||
2056 | + } | ||
2057 | + } | ||
2058 | + return false; | ||
2059 | + } | ||
2045 | function refresh(){ | 2060 | function refresh(){ |
2046 | setInterval(function (){ | 2061 | setInterval(function (){ |
2047 | loadBizInfo(); | 2062 | loadBizInfo(); |
-
Please register or login to post a comment