eoss-ui 0.5.43 → 0.5.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +929 -0
- package/README.md +18 -0
- package/lib/button-group.js +136 -69
- package/lib/button.js +146 -72
- package/lib/checkbox-group.js +132 -67
- package/lib/data-table-form.js +142 -74
- package/lib/data-table.js +225 -104
- package/lib/date-picker.js +132 -67
- package/lib/dialog.js +145 -71
- package/lib/eoss-ui.common.js +717 -414
- package/lib/flow-group.js +157 -74
- package/lib/flow-list.js +136 -69
- package/lib/flow.js +185 -99
- package/lib/form.js +141 -69
- package/lib/handle-user.js +142 -70
- package/lib/handler.js +165 -93
- package/lib/index.js +1 -1
- package/lib/input-number.js +132 -67
- package/lib/input.js +132 -67
- package/lib/login.js +165 -97
- package/lib/main.js +258 -153
- package/lib/nav.js +132 -67
- package/lib/page.js +132 -67
- package/lib/player.js +132 -67
- package/lib/qr-code.js +132 -67
- package/lib/radio-group.js +132 -67
- package/lib/retrial-auth.js +144 -71
- package/lib/select-ganged.js +132 -67
- package/lib/select.js +132 -67
- package/lib/selector-panel.js +147 -74
- package/lib/selector.js +132 -67
- package/lib/sizer.js +132 -67
- package/lib/steps.js +132 -67
- package/lib/switch.js +132 -67
- package/lib/table-form.js +139 -72
- package/lib/tabs.js +135 -69
- package/lib/theme-chalk/data-table.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/toolbar.css +1 -1
- package/lib/tips.js +132 -67
- package/lib/toolbar.js +7 -1
- package/lib/tree-group.js +167 -71
- package/lib/tree.js +132 -67
- package/lib/upload.js +143 -78
- package/lib/utils/util.js +132 -67
- package/lib/wujie.js +132 -67
- package/lib/wxlogin.js +132 -67
- package/package.json +2 -2
- package/packages/button/src/main.vue +14 -5
- package/packages/button-group/src/main.vue +2 -0
- package/packages/data-table/src/column.vue +4 -0
- package/packages/data-table/src/main.vue +65 -26
- package/packages/data-table-form/src/tbody.vue +3 -0
- package/packages/dialog/src/main.vue +11 -2
- package/packages/flow/src/component/CustomPreset.vue +14 -7
- package/packages/flow/src/component/FileList.vue +4 -2
- package/packages/flow/src/component/Preset.vue +11 -13
- package/packages/flow/src/form.vue +5 -4
- package/packages/flow/src/main.vue +7 -7
- package/packages/flow/src/table.vue +8 -1
- package/packages/flow-group/src/main.vue +23 -5
- package/packages/form/src/main.vue +12 -0
- package/packages/form/src/table.vue +2 -0
- package/packages/handle-user/src/main.vue +8 -1
- package/packages/handler/src/main.vue +35 -28
- package/packages/login/src/main.vue +35 -31
- package/packages/main/src/async-component/index.vue +4 -2
- package/packages/main/src/main.vue +70 -31
- package/packages/main/src/userinfo.vue +29 -25
- package/packages/retrial-auth/src/main.vue +10 -2
- package/packages/selector-panel/src/selection.vue +6 -0
- package/packages/tabs/src/main.vue +1 -0
- package/packages/theme-chalk/lib/base.css +1 -0
- package/packages/theme-chalk/lib/button-group.css +1 -0
- package/packages/theme-chalk/lib/button.css +1 -0
- package/packages/theme-chalk/lib/card.css +1 -0
- package/packages/theme-chalk/lib/cascader.css +0 -0
- package/packages/theme-chalk/lib/checkbox-group.css +1 -0
- package/packages/theme-chalk/lib/clients.css +1 -0
- package/packages/theme-chalk/lib/data-table-form.css +1 -0
- package/packages/theme-chalk/lib/data-table.css +1 -0
- package/packages/theme-chalk/lib/date-picker.css +1 -0
- package/packages/theme-chalk/lib/dialog.css +1 -0
- package/packages/theme-chalk/lib/enterprise.css +1 -0
- package/packages/theme-chalk/lib/error-page.css +1 -0
- package/packages/theme-chalk/lib/flow-chart.css +0 -0
- package/packages/theme-chalk/lib/flow-group.css +1 -0
- package/packages/theme-chalk/lib/flow-list.css +1 -0
- package/packages/theme-chalk/lib/flow.css +1 -0
- package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/lib/form.css +1 -0
- package/packages/theme-chalk/lib/handle-user.css +1 -0
- package/packages/theme-chalk/lib/handler.css +1 -0
- package/packages/theme-chalk/lib/icon.css +1 -0
- package/packages/theme-chalk/lib/icons.css +1 -0
- package/packages/theme-chalk/lib/index.css +1 -0
- package/packages/theme-chalk/lib/input-number.css +0 -0
- package/packages/theme-chalk/lib/input.css +1 -0
- package/packages/theme-chalk/lib/label.css +1 -0
- package/packages/theme-chalk/lib/layout.css +1 -0
- package/packages/theme-chalk/lib/login.css +1 -0
- package/packages/theme-chalk/lib/main.css +1 -0
- package/packages/theme-chalk/lib/mainComp.css +0 -0
- package/packages/theme-chalk/lib/menu.css +1 -0
- package/packages/theme-chalk/lib/nav.css +1 -0
- package/packages/theme-chalk/lib/notify.css +0 -0
- package/packages/theme-chalk/lib/page.css +1 -0
- package/packages/theme-chalk/lib/pagination.css +1 -0
- package/packages/theme-chalk/lib/player.css +1 -0
- package/packages/theme-chalk/lib/qr-code.css +1 -0
- package/packages/theme-chalk/lib/radio-group.css +1 -0
- package/packages/theme-chalk/lib/retrial-auth.css +1 -0
- package/packages/theme-chalk/lib/select-ganged.css +1 -0
- package/packages/theme-chalk/lib/select.css +1 -0
- package/packages/theme-chalk/lib/selector-panel.css +1 -0
- package/packages/theme-chalk/lib/selector.css +1 -0
- package/packages/theme-chalk/lib/sizer.css +1 -0
- package/packages/theme-chalk/lib/steps.css +1 -0
- package/packages/theme-chalk/lib/switch.css +1 -0
- package/packages/theme-chalk/lib/table-form.css +0 -0
- package/packages/theme-chalk/lib/tabs-panel.css +0 -0
- package/packages/theme-chalk/lib/tabs.css +1 -0
- package/packages/theme-chalk/lib/tips.css +1 -0
- package/packages/theme-chalk/lib/toolbar.css +1 -0
- package/packages/theme-chalk/lib/tree-group.css +1 -0
- package/packages/theme-chalk/lib/tree.css +1 -0
- package/packages/theme-chalk/lib/upload.css +1 -0
- package/packages/theme-chalk/lib/wujie.css +0 -0
- package/packages/theme-chalk/lib/wxlogin.css +1 -0
- package/packages/theme-chalk/src/data-table.scss +6 -0
- package/packages/theme-chalk/src/toolbar.scss +3 -0
- package/packages/toolbar/src/main.vue +10 -1
- package/packages/tree-group/src/main.vue +36 -2
- package/packages/upload/src/main.vue +6 -6
- package/src/index.js +1 -1
- package/src/utils/util.js +148 -80
- package/packages/theme-chalk/gulpfile.js +0 -25
package/lib/selector.js
CHANGED
|
@@ -258,7 +258,13 @@ var ajax = function ajax(_ref) {
|
|
|
258
258
|
if (response.status === 200) {
|
|
259
259
|
if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
|
|
260
260
|
removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig', 'jump']);
|
|
261
|
-
|
|
261
|
+
var href = '';
|
|
262
|
+
try {
|
|
263
|
+
href = win.top.location.href;
|
|
264
|
+
} catch (error) {
|
|
265
|
+
href = win.location.href;
|
|
266
|
+
}
|
|
267
|
+
if (href.indexOf('#/login') === -1 && href.indexOf('/login.html') === -1) {
|
|
262
268
|
var remind = sessionStorage.getItem('remind');
|
|
263
269
|
if (!remind) {
|
|
264
270
|
clearTimeout(loginMsg);
|
|
@@ -274,33 +280,37 @@ var ajax = function ajax(_ref) {
|
|
|
274
280
|
closeOnClickModal: false,
|
|
275
281
|
type: 'warning'
|
|
276
282
|
}).then(function () {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
pathname
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
try {
|
|
284
|
+
var loginPage = getStorage('login') || getStorage('loginPage');
|
|
285
|
+
if (loginPage) {
|
|
286
|
+
var src = void 0;
|
|
287
|
+
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
288
|
+
var pathname = win.top.location.pathname;
|
|
289
|
+
if (pathname !== '/') {
|
|
290
|
+
pathname = pathname.split('/');
|
|
291
|
+
pathname.splice(pathname.length - 1);
|
|
292
|
+
pathname = pathname.join('/');
|
|
293
|
+
src = pathname + '/' + loginPage.replace('./', '');
|
|
294
|
+
} else {
|
|
295
|
+
src = pathname + loginPage.replace('./', '');
|
|
296
|
+
}
|
|
287
297
|
} else {
|
|
288
|
-
src =
|
|
298
|
+
src = loginPage;
|
|
289
299
|
}
|
|
300
|
+
win.top.location.href = src;
|
|
301
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
302
|
+
win.top.location.href = './login.html';
|
|
290
303
|
} else {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
if (hash) {
|
|
299
|
-
var len = win.top.location.href.indexOf(hash);
|
|
300
|
-
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
301
|
-
} else {
|
|
302
|
-
win.top.location.href = '/login.html';
|
|
304
|
+
var hash = win.top.location.hash;
|
|
305
|
+
if (hash) {
|
|
306
|
+
var len = win.top.location.href.indexOf(hash);
|
|
307
|
+
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
308
|
+
} else {
|
|
309
|
+
win.top.location.href = '/login.html';
|
|
310
|
+
}
|
|
303
311
|
}
|
|
312
|
+
} catch (error) {
|
|
313
|
+
win.postMessage({ type: 1 }, '*');
|
|
304
314
|
}
|
|
305
315
|
}).catch(function (e) {
|
|
306
316
|
sessionStorage.removeItem('remind');
|
|
@@ -738,7 +748,13 @@ var delUrlParam = function delUrlParam(_ref2) {
|
|
|
738
748
|
var url = _ref2.url,
|
|
739
749
|
key = _ref2.key;
|
|
740
750
|
|
|
741
|
-
var
|
|
751
|
+
var pUrl = '';
|
|
752
|
+
try {
|
|
753
|
+
pUrl = win.top.location.href;
|
|
754
|
+
} catch (error) {
|
|
755
|
+
pUrl = win.location.href;
|
|
756
|
+
}
|
|
757
|
+
var src = url ? decodeURI(url) : decodeURI(pUrl);
|
|
742
758
|
var param = getParams({ url: src });
|
|
743
759
|
if (param && key.length) {
|
|
744
760
|
if (Array.isArray(key)) {
|
|
@@ -1234,6 +1250,21 @@ var getHour = function getHour(datetime) {
|
|
|
1234
1250
|
return datetimeObj.getHours();
|
|
1235
1251
|
};
|
|
1236
1252
|
|
|
1253
|
+
/**
|
|
1254
|
+
* getMyWinTop
|
|
1255
|
+
* @desc 获取同域的top窗口
|
|
1256
|
+
* @param {object} wind - window对象
|
|
1257
|
+
**/
|
|
1258
|
+
var getMyWinTop = function getMyWinTop(wind) {
|
|
1259
|
+
wind = wind ? wind : win;
|
|
1260
|
+
try {
|
|
1261
|
+
wind.parent.document;
|
|
1262
|
+
return getMyWinTop(wind.parent);
|
|
1263
|
+
} catch (error) {
|
|
1264
|
+
return wind;
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1237
1268
|
/**
|
|
1238
1269
|
* getWeekNumber
|
|
1239
1270
|
* @desc 当年第几周
|
|
@@ -1988,7 +2019,12 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1988
2019
|
}).catch(function () {});
|
|
1989
2020
|
return;
|
|
1990
2021
|
}
|
|
1991
|
-
var pathname =
|
|
2022
|
+
var pathname = '';
|
|
2023
|
+
try {
|
|
2024
|
+
pathname = win.top.location.pathname;
|
|
2025
|
+
} catch (error) {
|
|
2026
|
+
pathname = win.location.pathname;
|
|
2027
|
+
}
|
|
1992
2028
|
if (loginPage) {
|
|
1993
2029
|
sessionStorage.setItem('loginPage', loginPage);
|
|
1994
2030
|
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
@@ -2029,22 +2065,38 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2029
2065
|
deviceUnique: results.deviceUnique
|
|
2030
2066
|
}
|
|
2031
2067
|
});
|
|
2032
|
-
|
|
2033
|
-
url
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2068
|
+
try {
|
|
2069
|
+
var url = delUrlParam({
|
|
2070
|
+
url: win.top.location.href,
|
|
2071
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2072
|
+
});
|
|
2073
|
+
win.top.location.href = url;
|
|
2074
|
+
setTimeout(function () {
|
|
2075
|
+
win.top.location.reload();
|
|
2076
|
+
}, 200);
|
|
2077
|
+
} catch (error) {
|
|
2078
|
+
var _url2 = delUrlParam({
|
|
2079
|
+
url: win.location.href,
|
|
2080
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2081
|
+
});
|
|
2082
|
+
win.location.href = _url2;
|
|
2083
|
+
setTimeout(function () {
|
|
2084
|
+
win.location.reload();
|
|
2085
|
+
}, 200);
|
|
2086
|
+
}
|
|
2040
2087
|
break;
|
|
2041
2088
|
case 1:
|
|
2042
2089
|
break;
|
|
2043
2090
|
case 2:
|
|
2044
2091
|
break;
|
|
2045
2092
|
case 3:
|
|
2046
|
-
|
|
2047
|
-
|
|
2093
|
+
try {
|
|
2094
|
+
var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
|
|
2095
|
+
win.top.location.href = href;
|
|
2096
|
+
} catch (error) {
|
|
2097
|
+
var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
|
|
2098
|
+
win.location.href = _href;
|
|
2099
|
+
}
|
|
2048
2100
|
break;
|
|
2049
2101
|
case 4:
|
|
2050
2102
|
eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
|
|
@@ -2052,14 +2104,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2052
2104
|
type: 'error',
|
|
2053
2105
|
callback: function callback() {
|
|
2054
2106
|
sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
win.top.location.href
|
|
2061
|
-
|
|
2062
|
-
|
|
2107
|
+
try {
|
|
2108
|
+
if (loginPage) {
|
|
2109
|
+
win.top.location.replace(loginPage);
|
|
2110
|
+
} else if (document.referrer) {
|
|
2111
|
+
win.top.location.replace(document.referrer);
|
|
2112
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2113
|
+
win.top.location.href = './login.html';
|
|
2114
|
+
} else {
|
|
2115
|
+
next('/login');
|
|
2116
|
+
}
|
|
2117
|
+
} catch (error) {
|
|
2118
|
+
win.postMessage({ type: 1 }, '*');
|
|
2063
2119
|
}
|
|
2064
2120
|
}
|
|
2065
2121
|
});
|
|
@@ -2071,14 +2127,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2071
2127
|
confirmButtonText: '确定',
|
|
2072
2128
|
type: 'error',
|
|
2073
2129
|
callback: function callback() {
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
win.top.location.href
|
|
2080
|
-
|
|
2081
|
-
|
|
2130
|
+
try {
|
|
2131
|
+
if (loginPage) {
|
|
2132
|
+
win.top.location.replace(loginPage);
|
|
2133
|
+
} else if (document.referrer) {
|
|
2134
|
+
win.top.location.replace(document.referrer);
|
|
2135
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2136
|
+
win.top.location.href = './login.html';
|
|
2137
|
+
} else {
|
|
2138
|
+
next('/login');
|
|
2139
|
+
}
|
|
2140
|
+
} catch (error) {
|
|
2141
|
+
win.postMessage({ type: 1 }, '*');
|
|
2082
2142
|
}
|
|
2083
2143
|
}
|
|
2084
2144
|
});
|
|
@@ -2091,14 +2151,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2091
2151
|
next();
|
|
2092
2152
|
}
|
|
2093
2153
|
} else {
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
win.top.location.href
|
|
2100
|
-
|
|
2101
|
-
|
|
2154
|
+
try {
|
|
2155
|
+
if (loginPage) {
|
|
2156
|
+
win.top.location.replace(loginPage);
|
|
2157
|
+
} else if (document.referrer) {
|
|
2158
|
+
win.top.location.replace(document.referrer);
|
|
2159
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2160
|
+
win.top.location.href = './login.html';
|
|
2161
|
+
} else {
|
|
2162
|
+
next('/login');
|
|
2163
|
+
}
|
|
2164
|
+
} catch (error) {
|
|
2165
|
+
win.postMessage({ type: 1 }, '*');
|
|
2102
2166
|
}
|
|
2103
2167
|
}
|
|
2104
2168
|
}
|
|
@@ -2528,30 +2592,30 @@ var setStorage = function setStorage(_ref14) {
|
|
|
2528
2592
|
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
|
|
2529
2593
|
value = JSON.stringify(value);
|
|
2530
2594
|
}
|
|
2531
|
-
if (type ===
|
|
2595
|
+
if (type === 'localStorage') {
|
|
2532
2596
|
if (typeof key === 'string') {
|
|
2533
|
-
|
|
2597
|
+
localStorage.setItem(key, value);
|
|
2534
2598
|
} else if (Array.isArray(key)) {
|
|
2535
2599
|
for (var i in key) {
|
|
2536
|
-
|
|
2600
|
+
localStorage.setItem(key[i], value);
|
|
2537
2601
|
}
|
|
2538
2602
|
} else {
|
|
2539
2603
|
for (var _i6 in key) {
|
|
2540
2604
|
var val = _typeof(key[_i6]) === 'object' ? JSON.stringify(key[_i6]) : key[_i6];
|
|
2541
|
-
|
|
2605
|
+
localStorage.setItem(_i6, val);
|
|
2542
2606
|
}
|
|
2543
2607
|
}
|
|
2544
2608
|
} else {
|
|
2545
2609
|
if (typeof key === 'string') {
|
|
2546
|
-
|
|
2610
|
+
sessionStorage.setItem(key, value);
|
|
2547
2611
|
} else if (Array.isArray(key)) {
|
|
2548
2612
|
for (var _i7 in key) {
|
|
2549
|
-
|
|
2613
|
+
sessionStorage.setItem(key[_i7], value);
|
|
2550
2614
|
}
|
|
2551
2615
|
} else {
|
|
2552
2616
|
for (var _i8 in key) {
|
|
2553
2617
|
var _val = _typeof(key[_i8]) === 'object' ? JSON.stringify(key[_i8]) : key[_i8];
|
|
2554
|
-
|
|
2618
|
+
sessionStorage.setItem(_i8, _val);
|
|
2555
2619
|
}
|
|
2556
2620
|
}
|
|
2557
2621
|
}
|
|
@@ -2954,6 +3018,7 @@ var watermark = function watermark(option) {
|
|
|
2954
3018
|
getCurrentDate: getCurrentDate,
|
|
2955
3019
|
getCurrentDateTime: getCurrentDateTime,
|
|
2956
3020
|
getHour: getHour,
|
|
3021
|
+
getMyWinTop: getMyWinTop,
|
|
2957
3022
|
getWeekNumber: getWeekNumber,
|
|
2958
3023
|
getLength: getLength,
|
|
2959
3024
|
getMainConfig: getMainConfig,
|
package/lib/sizer.js
CHANGED
|
@@ -258,7 +258,13 @@ var ajax = function ajax(_ref) {
|
|
|
258
258
|
if (response.status === 200) {
|
|
259
259
|
if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
|
|
260
260
|
removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig', 'jump']);
|
|
261
|
-
|
|
261
|
+
var href = '';
|
|
262
|
+
try {
|
|
263
|
+
href = win.top.location.href;
|
|
264
|
+
} catch (error) {
|
|
265
|
+
href = win.location.href;
|
|
266
|
+
}
|
|
267
|
+
if (href.indexOf('#/login') === -1 && href.indexOf('/login.html') === -1) {
|
|
262
268
|
var remind = sessionStorage.getItem('remind');
|
|
263
269
|
if (!remind) {
|
|
264
270
|
clearTimeout(loginMsg);
|
|
@@ -274,33 +280,37 @@ var ajax = function ajax(_ref) {
|
|
|
274
280
|
closeOnClickModal: false,
|
|
275
281
|
type: 'warning'
|
|
276
282
|
}).then(function () {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
pathname
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
try {
|
|
284
|
+
var loginPage = getStorage('login') || getStorage('loginPage');
|
|
285
|
+
if (loginPage) {
|
|
286
|
+
var src = void 0;
|
|
287
|
+
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
288
|
+
var pathname = win.top.location.pathname;
|
|
289
|
+
if (pathname !== '/') {
|
|
290
|
+
pathname = pathname.split('/');
|
|
291
|
+
pathname.splice(pathname.length - 1);
|
|
292
|
+
pathname = pathname.join('/');
|
|
293
|
+
src = pathname + '/' + loginPage.replace('./', '');
|
|
294
|
+
} else {
|
|
295
|
+
src = pathname + loginPage.replace('./', '');
|
|
296
|
+
}
|
|
287
297
|
} else {
|
|
288
|
-
src =
|
|
298
|
+
src = loginPage;
|
|
289
299
|
}
|
|
300
|
+
win.top.location.href = src;
|
|
301
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
302
|
+
win.top.location.href = './login.html';
|
|
290
303
|
} else {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
if (hash) {
|
|
299
|
-
var len = win.top.location.href.indexOf(hash);
|
|
300
|
-
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
301
|
-
} else {
|
|
302
|
-
win.top.location.href = '/login.html';
|
|
304
|
+
var hash = win.top.location.hash;
|
|
305
|
+
if (hash) {
|
|
306
|
+
var len = win.top.location.href.indexOf(hash);
|
|
307
|
+
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
308
|
+
} else {
|
|
309
|
+
win.top.location.href = '/login.html';
|
|
310
|
+
}
|
|
303
311
|
}
|
|
312
|
+
} catch (error) {
|
|
313
|
+
win.postMessage({ type: 1 }, '*');
|
|
304
314
|
}
|
|
305
315
|
}).catch(function (e) {
|
|
306
316
|
sessionStorage.removeItem('remind');
|
|
@@ -738,7 +748,13 @@ var delUrlParam = function delUrlParam(_ref2) {
|
|
|
738
748
|
var url = _ref2.url,
|
|
739
749
|
key = _ref2.key;
|
|
740
750
|
|
|
741
|
-
var
|
|
751
|
+
var pUrl = '';
|
|
752
|
+
try {
|
|
753
|
+
pUrl = win.top.location.href;
|
|
754
|
+
} catch (error) {
|
|
755
|
+
pUrl = win.location.href;
|
|
756
|
+
}
|
|
757
|
+
var src = url ? decodeURI(url) : decodeURI(pUrl);
|
|
742
758
|
var param = getParams({ url: src });
|
|
743
759
|
if (param && key.length) {
|
|
744
760
|
if (Array.isArray(key)) {
|
|
@@ -1234,6 +1250,21 @@ var getHour = function getHour(datetime) {
|
|
|
1234
1250
|
return datetimeObj.getHours();
|
|
1235
1251
|
};
|
|
1236
1252
|
|
|
1253
|
+
/**
|
|
1254
|
+
* getMyWinTop
|
|
1255
|
+
* @desc 获取同域的top窗口
|
|
1256
|
+
* @param {object} wind - window对象
|
|
1257
|
+
**/
|
|
1258
|
+
var getMyWinTop = function getMyWinTop(wind) {
|
|
1259
|
+
wind = wind ? wind : win;
|
|
1260
|
+
try {
|
|
1261
|
+
wind.parent.document;
|
|
1262
|
+
return getMyWinTop(wind.parent);
|
|
1263
|
+
} catch (error) {
|
|
1264
|
+
return wind;
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1237
1268
|
/**
|
|
1238
1269
|
* getWeekNumber
|
|
1239
1270
|
* @desc 当年第几周
|
|
@@ -1988,7 +2019,12 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1988
2019
|
}).catch(function () {});
|
|
1989
2020
|
return;
|
|
1990
2021
|
}
|
|
1991
|
-
var pathname =
|
|
2022
|
+
var pathname = '';
|
|
2023
|
+
try {
|
|
2024
|
+
pathname = win.top.location.pathname;
|
|
2025
|
+
} catch (error) {
|
|
2026
|
+
pathname = win.location.pathname;
|
|
2027
|
+
}
|
|
1992
2028
|
if (loginPage) {
|
|
1993
2029
|
sessionStorage.setItem('loginPage', loginPage);
|
|
1994
2030
|
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
@@ -2029,22 +2065,38 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2029
2065
|
deviceUnique: results.deviceUnique
|
|
2030
2066
|
}
|
|
2031
2067
|
});
|
|
2032
|
-
|
|
2033
|
-
url
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2068
|
+
try {
|
|
2069
|
+
var url = delUrlParam({
|
|
2070
|
+
url: win.top.location.href,
|
|
2071
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2072
|
+
});
|
|
2073
|
+
win.top.location.href = url;
|
|
2074
|
+
setTimeout(function () {
|
|
2075
|
+
win.top.location.reload();
|
|
2076
|
+
}, 200);
|
|
2077
|
+
} catch (error) {
|
|
2078
|
+
var _url2 = delUrlParam({
|
|
2079
|
+
url: win.location.href,
|
|
2080
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2081
|
+
});
|
|
2082
|
+
win.location.href = _url2;
|
|
2083
|
+
setTimeout(function () {
|
|
2084
|
+
win.location.reload();
|
|
2085
|
+
}, 200);
|
|
2086
|
+
}
|
|
2040
2087
|
break;
|
|
2041
2088
|
case 1:
|
|
2042
2089
|
break;
|
|
2043
2090
|
case 2:
|
|
2044
2091
|
break;
|
|
2045
2092
|
case 3:
|
|
2046
|
-
|
|
2047
|
-
|
|
2093
|
+
try {
|
|
2094
|
+
var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
|
|
2095
|
+
win.top.location.href = href;
|
|
2096
|
+
} catch (error) {
|
|
2097
|
+
var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
|
|
2098
|
+
win.location.href = _href;
|
|
2099
|
+
}
|
|
2048
2100
|
break;
|
|
2049
2101
|
case 4:
|
|
2050
2102
|
eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
|
|
@@ -2052,14 +2104,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2052
2104
|
type: 'error',
|
|
2053
2105
|
callback: function callback() {
|
|
2054
2106
|
sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
win.top.location.href
|
|
2061
|
-
|
|
2062
|
-
|
|
2107
|
+
try {
|
|
2108
|
+
if (loginPage) {
|
|
2109
|
+
win.top.location.replace(loginPage);
|
|
2110
|
+
} else if (document.referrer) {
|
|
2111
|
+
win.top.location.replace(document.referrer);
|
|
2112
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2113
|
+
win.top.location.href = './login.html';
|
|
2114
|
+
} else {
|
|
2115
|
+
next('/login');
|
|
2116
|
+
}
|
|
2117
|
+
} catch (error) {
|
|
2118
|
+
win.postMessage({ type: 1 }, '*');
|
|
2063
2119
|
}
|
|
2064
2120
|
}
|
|
2065
2121
|
});
|
|
@@ -2071,14 +2127,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2071
2127
|
confirmButtonText: '确定',
|
|
2072
2128
|
type: 'error',
|
|
2073
2129
|
callback: function callback() {
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
win.top.location.href
|
|
2080
|
-
|
|
2081
|
-
|
|
2130
|
+
try {
|
|
2131
|
+
if (loginPage) {
|
|
2132
|
+
win.top.location.replace(loginPage);
|
|
2133
|
+
} else if (document.referrer) {
|
|
2134
|
+
win.top.location.replace(document.referrer);
|
|
2135
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2136
|
+
win.top.location.href = './login.html';
|
|
2137
|
+
} else {
|
|
2138
|
+
next('/login');
|
|
2139
|
+
}
|
|
2140
|
+
} catch (error) {
|
|
2141
|
+
win.postMessage({ type: 1 }, '*');
|
|
2082
2142
|
}
|
|
2083
2143
|
}
|
|
2084
2144
|
});
|
|
@@ -2091,14 +2151,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2091
2151
|
next();
|
|
2092
2152
|
}
|
|
2093
2153
|
} else {
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
win.top.location.href
|
|
2100
|
-
|
|
2101
|
-
|
|
2154
|
+
try {
|
|
2155
|
+
if (loginPage) {
|
|
2156
|
+
win.top.location.replace(loginPage);
|
|
2157
|
+
} else if (document.referrer) {
|
|
2158
|
+
win.top.location.replace(document.referrer);
|
|
2159
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2160
|
+
win.top.location.href = './login.html';
|
|
2161
|
+
} else {
|
|
2162
|
+
next('/login');
|
|
2163
|
+
}
|
|
2164
|
+
} catch (error) {
|
|
2165
|
+
win.postMessage({ type: 1 }, '*');
|
|
2102
2166
|
}
|
|
2103
2167
|
}
|
|
2104
2168
|
}
|
|
@@ -2528,30 +2592,30 @@ var setStorage = function setStorage(_ref14) {
|
|
|
2528
2592
|
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
|
|
2529
2593
|
value = JSON.stringify(value);
|
|
2530
2594
|
}
|
|
2531
|
-
if (type ===
|
|
2595
|
+
if (type === 'localStorage') {
|
|
2532
2596
|
if (typeof key === 'string') {
|
|
2533
|
-
|
|
2597
|
+
localStorage.setItem(key, value);
|
|
2534
2598
|
} else if (Array.isArray(key)) {
|
|
2535
2599
|
for (var i in key) {
|
|
2536
|
-
|
|
2600
|
+
localStorage.setItem(key[i], value);
|
|
2537
2601
|
}
|
|
2538
2602
|
} else {
|
|
2539
2603
|
for (var _i6 in key) {
|
|
2540
2604
|
var val = _typeof(key[_i6]) === 'object' ? JSON.stringify(key[_i6]) : key[_i6];
|
|
2541
|
-
|
|
2605
|
+
localStorage.setItem(_i6, val);
|
|
2542
2606
|
}
|
|
2543
2607
|
}
|
|
2544
2608
|
} else {
|
|
2545
2609
|
if (typeof key === 'string') {
|
|
2546
|
-
|
|
2610
|
+
sessionStorage.setItem(key, value);
|
|
2547
2611
|
} else if (Array.isArray(key)) {
|
|
2548
2612
|
for (var _i7 in key) {
|
|
2549
|
-
|
|
2613
|
+
sessionStorage.setItem(key[_i7], value);
|
|
2550
2614
|
}
|
|
2551
2615
|
} else {
|
|
2552
2616
|
for (var _i8 in key) {
|
|
2553
2617
|
var _val = _typeof(key[_i8]) === 'object' ? JSON.stringify(key[_i8]) : key[_i8];
|
|
2554
|
-
|
|
2618
|
+
sessionStorage.setItem(_i8, _val);
|
|
2555
2619
|
}
|
|
2556
2620
|
}
|
|
2557
2621
|
}
|
|
@@ -2954,6 +3018,7 @@ var watermark = function watermark(option) {
|
|
|
2954
3018
|
getCurrentDate: getCurrentDate,
|
|
2955
3019
|
getCurrentDateTime: getCurrentDateTime,
|
|
2956
3020
|
getHour: getHour,
|
|
3021
|
+
getMyWinTop: getMyWinTop,
|
|
2957
3022
|
getWeekNumber: getWeekNumber,
|
|
2958
3023
|
getLength: getLength,
|
|
2959
3024
|
getMainConfig: getMainConfig,
|