eoss-ui 0.5.43 → 0.5.44
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 +120 -69
- package/lib/button.js +133 -72
- package/lib/checkbox-group.js +116 -67
- package/lib/data-table-form.js +126 -74
- package/lib/data-table.js +210 -104
- package/lib/date-picker.js +116 -67
- package/lib/dialog.js +132 -71
- package/lib/eoss-ui.common.js +704 -411
- package/lib/flow-group.js +144 -74
- package/lib/flow-list.js +120 -69
- package/lib/flow.js +169 -99
- package/lib/form.js +125 -69
- package/lib/handle-user.js +127 -70
- package/lib/handler.js +145 -92
- package/lib/index.js +1 -1
- package/lib/input-number.js +116 -67
- package/lib/input.js +116 -67
- package/lib/login.js +149 -97
- package/lib/main.js +234 -152
- package/lib/nav.js +116 -67
- package/lib/page.js +116 -67
- package/lib/player.js +116 -67
- package/lib/qr-code.js +116 -67
- package/lib/radio-group.js +116 -67
- package/lib/retrial-auth.js +130 -71
- package/lib/select-ganged.js +116 -67
- package/lib/select.js +116 -67
- package/lib/selector-panel.js +131 -74
- package/lib/selector.js +116 -67
- package/lib/sizer.js +116 -67
- package/lib/steps.js +116 -67
- package/lib/switch.js +116 -67
- package/lib/table-form.js +123 -72
- package/lib/tabs.js +119 -69
- package/lib/theme-chalk/data-table.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/tips.js +116 -67
- package/lib/tree-group.js +151 -71
- package/lib/tree.js +116 -67
- package/lib/upload.js +136 -78
- package/lib/utils/util.js +116 -67
- package/lib/wujie.js +116 -67
- package/lib/wxlogin.js +116 -67
- package/package.json +2 -2
- package/packages/button/src/main.vue +17 -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 +66 -26
- package/packages/data-table-form/src/tbody.vue +3 -0
- package/packages/dialog/src/main.vue +14 -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 +26 -5
- package/packages/form/src/main.vue +12 -0
- package/packages/form/src/table.vue +2 -0
- package/packages/handle-user/src/main.vue +9 -1
- package/packages/handler/src/main.vue +31 -27
- package/packages/login/src/main.vue +35 -31
- package/packages/main/src/async-component/index.vue +4 -2
- package/packages/main/src/main.vue +62 -30
- package/packages/main/src/userinfo.vue +29 -25
- package/packages/retrial-auth/src/main.vue +12 -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/tree-group/src/main.vue +36 -2
- package/packages/upload/src/main.vue +15 -6
- package/src/index.js +1 -1
- package/src/utils/util.js +132 -80
- package/packages/theme-chalk/gulpfile.js +0 -25
package/lib/utils/util.js
CHANGED
|
@@ -175,7 +175,13 @@ var ajax = function ajax(_ref) {
|
|
|
175
175
|
if (response.status === 200) {
|
|
176
176
|
if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
|
|
177
177
|
removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig', 'jump']);
|
|
178
|
-
|
|
178
|
+
var href = '';
|
|
179
|
+
try {
|
|
180
|
+
href = win.top.location.href;
|
|
181
|
+
} catch (error) {
|
|
182
|
+
href = win.location.href;
|
|
183
|
+
}
|
|
184
|
+
if (href.indexOf('#/login') === -1 && href.indexOf('/login.html') === -1) {
|
|
179
185
|
var remind = sessionStorage.getItem('remind');
|
|
180
186
|
if (!remind) {
|
|
181
187
|
clearTimeout(loginMsg);
|
|
@@ -191,33 +197,37 @@ var ajax = function ajax(_ref) {
|
|
|
191
197
|
closeOnClickModal: false,
|
|
192
198
|
type: 'warning'
|
|
193
199
|
}).then(function () {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
pathname
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
try {
|
|
201
|
+
var loginPage = getStorage('login') || getStorage('loginPage');
|
|
202
|
+
if (loginPage) {
|
|
203
|
+
var src = void 0;
|
|
204
|
+
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
205
|
+
var pathname = win.top.location.pathname;
|
|
206
|
+
if (pathname !== '/') {
|
|
207
|
+
pathname = pathname.split('/');
|
|
208
|
+
pathname.splice(pathname.length - 1);
|
|
209
|
+
pathname = pathname.join('/');
|
|
210
|
+
src = pathname + '/' + loginPage.replace('./', '');
|
|
211
|
+
} else {
|
|
212
|
+
src = pathname + loginPage.replace('./', '');
|
|
213
|
+
}
|
|
204
214
|
} else {
|
|
205
|
-
src =
|
|
215
|
+
src = loginPage;
|
|
206
216
|
}
|
|
217
|
+
win.top.location.href = src;
|
|
218
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
219
|
+
win.top.location.href = './login.html';
|
|
207
220
|
} else {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if (hash) {
|
|
216
|
-
var len = win.top.location.href.indexOf(hash);
|
|
217
|
-
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
218
|
-
} else {
|
|
219
|
-
win.top.location.href = '/login.html';
|
|
221
|
+
var hash = win.top.location.hash;
|
|
222
|
+
if (hash) {
|
|
223
|
+
var len = win.top.location.href.indexOf(hash);
|
|
224
|
+
win.top.location.href = win.location.href.slice(0, len) + '#/login';
|
|
225
|
+
} else {
|
|
226
|
+
win.top.location.href = '/login.html';
|
|
227
|
+
}
|
|
220
228
|
}
|
|
229
|
+
} catch (error) {
|
|
230
|
+
win.postMessage({ type: 1 }, '*');
|
|
221
231
|
}
|
|
222
232
|
}).catch(function (e) {
|
|
223
233
|
sessionStorage.removeItem('remind');
|
|
@@ -655,7 +665,13 @@ var delUrlParam = function delUrlParam(_ref2) {
|
|
|
655
665
|
var url = _ref2.url,
|
|
656
666
|
key = _ref2.key;
|
|
657
667
|
|
|
658
|
-
var
|
|
668
|
+
var pUrl = '';
|
|
669
|
+
try {
|
|
670
|
+
pUrl = win.top.location.href;
|
|
671
|
+
} catch (error) {
|
|
672
|
+
pUrl = win.location.href;
|
|
673
|
+
}
|
|
674
|
+
var src = url ? decodeURI(url) : decodeURI(pUrl);
|
|
659
675
|
var param = getParams({ url: src });
|
|
660
676
|
if (param && key.length) {
|
|
661
677
|
if (Array.isArray(key)) {
|
|
@@ -1905,7 +1921,12 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1905
1921
|
}).catch(function () {});
|
|
1906
1922
|
return;
|
|
1907
1923
|
}
|
|
1908
|
-
var pathname =
|
|
1924
|
+
var pathname = '';
|
|
1925
|
+
try {
|
|
1926
|
+
pathname = win.top.location.pathname;
|
|
1927
|
+
} catch (error) {
|
|
1928
|
+
pathname = win.location.pathname;
|
|
1929
|
+
}
|
|
1909
1930
|
if (loginPage) {
|
|
1910
1931
|
sessionStorage.setItem('loginPage', loginPage);
|
|
1911
1932
|
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
@@ -1946,22 +1967,38 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1946
1967
|
deviceUnique: results.deviceUnique
|
|
1947
1968
|
}
|
|
1948
1969
|
});
|
|
1949
|
-
|
|
1950
|
-
url
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1970
|
+
try {
|
|
1971
|
+
var url = delUrlParam({
|
|
1972
|
+
url: win.top.location.href,
|
|
1973
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
1974
|
+
});
|
|
1975
|
+
win.top.location.href = url;
|
|
1976
|
+
setTimeout(function () {
|
|
1977
|
+
win.top.location.reload();
|
|
1978
|
+
}, 200);
|
|
1979
|
+
} catch (error) {
|
|
1980
|
+
var _url2 = delUrlParam({
|
|
1981
|
+
url: win.location.href,
|
|
1982
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
1983
|
+
});
|
|
1984
|
+
win.location.href = _url2;
|
|
1985
|
+
setTimeout(function () {
|
|
1986
|
+
win.location.reload();
|
|
1987
|
+
}, 200);
|
|
1988
|
+
}
|
|
1957
1989
|
break;
|
|
1958
1990
|
case 1:
|
|
1959
1991
|
break;
|
|
1960
1992
|
case 2:
|
|
1961
1993
|
break;
|
|
1962
1994
|
case 3:
|
|
1963
|
-
|
|
1964
|
-
|
|
1995
|
+
try {
|
|
1996
|
+
var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
|
|
1997
|
+
win.top.location.href = href;
|
|
1998
|
+
} catch (error) {
|
|
1999
|
+
var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
|
|
2000
|
+
win.location.href = _href;
|
|
2001
|
+
}
|
|
1965
2002
|
break;
|
|
1966
2003
|
case 4:
|
|
1967
2004
|
_eossElement.MessageBox.alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
|
|
@@ -1969,14 +2006,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1969
2006
|
type: 'error',
|
|
1970
2007
|
callback: function callback() {
|
|
1971
2008
|
sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
win.top.location.href
|
|
1978
|
-
|
|
1979
|
-
|
|
2009
|
+
try {
|
|
2010
|
+
if (loginPage) {
|
|
2011
|
+
win.top.location.replace(loginPage);
|
|
2012
|
+
} else if (document.referrer) {
|
|
2013
|
+
win.top.location.replace(document.referrer);
|
|
2014
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2015
|
+
win.top.location.href = './login.html';
|
|
2016
|
+
} else {
|
|
2017
|
+
next('/login');
|
|
2018
|
+
}
|
|
2019
|
+
} catch (error) {
|
|
2020
|
+
win.postMessage({ type: 1 }, '*');
|
|
1980
2021
|
}
|
|
1981
2022
|
}
|
|
1982
2023
|
});
|
|
@@ -1988,14 +2029,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1988
2029
|
confirmButtonText: '确定',
|
|
1989
2030
|
type: 'error',
|
|
1990
2031
|
callback: function callback() {
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
win.top.location.href
|
|
1997
|
-
|
|
1998
|
-
|
|
2032
|
+
try {
|
|
2033
|
+
if (loginPage) {
|
|
2034
|
+
win.top.location.replace(loginPage);
|
|
2035
|
+
} else if (document.referrer) {
|
|
2036
|
+
win.top.location.replace(document.referrer);
|
|
2037
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2038
|
+
win.top.location.href = './login.html';
|
|
2039
|
+
} else {
|
|
2040
|
+
next('/login');
|
|
2041
|
+
}
|
|
2042
|
+
} catch (error) {
|
|
2043
|
+
win.postMessage({ type: 1 }, '*');
|
|
1999
2044
|
}
|
|
2000
2045
|
}
|
|
2001
2046
|
});
|
|
@@ -2008,14 +2053,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2008
2053
|
next();
|
|
2009
2054
|
}
|
|
2010
2055
|
} else {
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
win.top.location.href
|
|
2017
|
-
|
|
2018
|
-
|
|
2056
|
+
try {
|
|
2057
|
+
if (loginPage) {
|
|
2058
|
+
win.top.location.replace(loginPage);
|
|
2059
|
+
} else if (document.referrer) {
|
|
2060
|
+
win.top.location.replace(document.referrer);
|
|
2061
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2062
|
+
win.top.location.href = './login.html';
|
|
2063
|
+
} else {
|
|
2064
|
+
next('/login');
|
|
2065
|
+
}
|
|
2066
|
+
} catch (error) {
|
|
2067
|
+
win.postMessage({ type: 1 }, '*');
|
|
2019
2068
|
}
|
|
2020
2069
|
}
|
|
2021
2070
|
}
|
|
@@ -2445,30 +2494,30 @@ var setStorage = function setStorage(_ref14) {
|
|
|
2445
2494
|
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
|
|
2446
2495
|
value = JSON.stringify(value);
|
|
2447
2496
|
}
|
|
2448
|
-
if (type ===
|
|
2497
|
+
if (type === 'localStorage') {
|
|
2449
2498
|
if (typeof key === 'string') {
|
|
2450
|
-
|
|
2499
|
+
localStorage.setItem(key, value);
|
|
2451
2500
|
} else if (Array.isArray(key)) {
|
|
2452
2501
|
for (var i in key) {
|
|
2453
|
-
|
|
2502
|
+
localStorage.setItem(key[i], value);
|
|
2454
2503
|
}
|
|
2455
2504
|
} else {
|
|
2456
2505
|
for (var _i6 in key) {
|
|
2457
2506
|
var val = _typeof(key[_i6]) === 'object' ? JSON.stringify(key[_i6]) : key[_i6];
|
|
2458
|
-
|
|
2507
|
+
localStorage.setItem(_i6, val);
|
|
2459
2508
|
}
|
|
2460
2509
|
}
|
|
2461
2510
|
} else {
|
|
2462
2511
|
if (typeof key === 'string') {
|
|
2463
|
-
|
|
2512
|
+
sessionStorage.setItem(key, value);
|
|
2464
2513
|
} else if (Array.isArray(key)) {
|
|
2465
2514
|
for (var _i7 in key) {
|
|
2466
|
-
|
|
2515
|
+
sessionStorage.setItem(key[_i7], value);
|
|
2467
2516
|
}
|
|
2468
2517
|
} else {
|
|
2469
2518
|
for (var _i8 in key) {
|
|
2470
2519
|
var _val = _typeof(key[_i8]) === 'object' ? JSON.stringify(key[_i8]) : key[_i8];
|
|
2471
|
-
|
|
2520
|
+
sessionStorage.setItem(_i8, _val);
|
|
2472
2521
|
}
|
|
2473
2522
|
}
|
|
2474
2523
|
}
|
package/lib/wujie.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)) {
|
|
@@ -1988,7 +2004,12 @@ var isLogined = function isLogined(_ref8) {
|
|
|
1988
2004
|
}).catch(function () {});
|
|
1989
2005
|
return;
|
|
1990
2006
|
}
|
|
1991
|
-
var pathname =
|
|
2007
|
+
var pathname = '';
|
|
2008
|
+
try {
|
|
2009
|
+
pathname = win.top.location.pathname;
|
|
2010
|
+
} catch (error) {
|
|
2011
|
+
pathname = win.location.pathname;
|
|
2012
|
+
}
|
|
1992
2013
|
if (loginPage) {
|
|
1993
2014
|
sessionStorage.setItem('loginPage', loginPage);
|
|
1994
2015
|
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
@@ -2029,22 +2050,38 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2029
2050
|
deviceUnique: results.deviceUnique
|
|
2030
2051
|
}
|
|
2031
2052
|
});
|
|
2032
|
-
|
|
2033
|
-
url
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2053
|
+
try {
|
|
2054
|
+
var url = delUrlParam({
|
|
2055
|
+
url: win.top.location.href,
|
|
2056
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2057
|
+
});
|
|
2058
|
+
win.top.location.href = url;
|
|
2059
|
+
setTimeout(function () {
|
|
2060
|
+
win.top.location.reload();
|
|
2061
|
+
}, 200);
|
|
2062
|
+
} catch (error) {
|
|
2063
|
+
var _url2 = delUrlParam({
|
|
2064
|
+
url: win.location.href,
|
|
2065
|
+
key: ['serverId', 'authType', 'code', 'sessionId']
|
|
2066
|
+
});
|
|
2067
|
+
win.location.href = _url2;
|
|
2068
|
+
setTimeout(function () {
|
|
2069
|
+
win.location.reload();
|
|
2070
|
+
}, 200);
|
|
2071
|
+
}
|
|
2040
2072
|
break;
|
|
2041
2073
|
case 1:
|
|
2042
2074
|
break;
|
|
2043
2075
|
case 2:
|
|
2044
2076
|
break;
|
|
2045
2077
|
case 3:
|
|
2046
|
-
|
|
2047
|
-
|
|
2078
|
+
try {
|
|
2079
|
+
var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
|
|
2080
|
+
win.top.location.href = href;
|
|
2081
|
+
} catch (error) {
|
|
2082
|
+
var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
|
|
2083
|
+
win.location.href = _href;
|
|
2084
|
+
}
|
|
2048
2085
|
break;
|
|
2049
2086
|
case 4:
|
|
2050
2087
|
eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
|
|
@@ -2052,14 +2089,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2052
2089
|
type: 'error',
|
|
2053
2090
|
callback: function callback() {
|
|
2054
2091
|
sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
win.top.location.href
|
|
2061
|
-
|
|
2062
|
-
|
|
2092
|
+
try {
|
|
2093
|
+
if (loginPage) {
|
|
2094
|
+
win.top.location.replace(loginPage);
|
|
2095
|
+
} else if (document.referrer) {
|
|
2096
|
+
win.top.location.replace(document.referrer);
|
|
2097
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2098
|
+
win.top.location.href = './login.html';
|
|
2099
|
+
} else {
|
|
2100
|
+
next('/login');
|
|
2101
|
+
}
|
|
2102
|
+
} catch (error) {
|
|
2103
|
+
win.postMessage({ type: 1 }, '*');
|
|
2063
2104
|
}
|
|
2064
2105
|
}
|
|
2065
2106
|
});
|
|
@@ -2071,14 +2112,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2071
2112
|
confirmButtonText: '确定',
|
|
2072
2113
|
type: 'error',
|
|
2073
2114
|
callback: function callback() {
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
win.top.location.href
|
|
2080
|
-
|
|
2081
|
-
|
|
2115
|
+
try {
|
|
2116
|
+
if (loginPage) {
|
|
2117
|
+
win.top.location.replace(loginPage);
|
|
2118
|
+
} else if (document.referrer) {
|
|
2119
|
+
win.top.location.replace(document.referrer);
|
|
2120
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2121
|
+
win.top.location.href = './login.html';
|
|
2122
|
+
} else {
|
|
2123
|
+
next('/login');
|
|
2124
|
+
}
|
|
2125
|
+
} catch (error) {
|
|
2126
|
+
win.postMessage({ type: 1 }, '*');
|
|
2082
2127
|
}
|
|
2083
2128
|
}
|
|
2084
2129
|
});
|
|
@@ -2091,14 +2136,18 @@ var isLogined = function isLogined(_ref8) {
|
|
|
2091
2136
|
next();
|
|
2092
2137
|
}
|
|
2093
2138
|
} else {
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
win.top.location.href
|
|
2100
|
-
|
|
2101
|
-
|
|
2139
|
+
try {
|
|
2140
|
+
if (loginPage) {
|
|
2141
|
+
win.top.location.replace(loginPage);
|
|
2142
|
+
} else if (document.referrer) {
|
|
2143
|
+
win.top.location.replace(document.referrer);
|
|
2144
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2145
|
+
win.top.location.href = './login.html';
|
|
2146
|
+
} else {
|
|
2147
|
+
next('/login');
|
|
2148
|
+
}
|
|
2149
|
+
} catch (error) {
|
|
2150
|
+
win.postMessage({ type: 1 }, '*');
|
|
2102
2151
|
}
|
|
2103
2152
|
}
|
|
2104
2153
|
}
|
|
@@ -2528,30 +2577,30 @@ var setStorage = function setStorage(_ref14) {
|
|
|
2528
2577
|
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
|
|
2529
2578
|
value = JSON.stringify(value);
|
|
2530
2579
|
}
|
|
2531
|
-
if (type ===
|
|
2580
|
+
if (type === 'localStorage') {
|
|
2532
2581
|
if (typeof key === 'string') {
|
|
2533
|
-
|
|
2582
|
+
localStorage.setItem(key, value);
|
|
2534
2583
|
} else if (Array.isArray(key)) {
|
|
2535
2584
|
for (var i in key) {
|
|
2536
|
-
|
|
2585
|
+
localStorage.setItem(key[i], value);
|
|
2537
2586
|
}
|
|
2538
2587
|
} else {
|
|
2539
2588
|
for (var _i6 in key) {
|
|
2540
2589
|
var val = _typeof(key[_i6]) === 'object' ? JSON.stringify(key[_i6]) : key[_i6];
|
|
2541
|
-
|
|
2590
|
+
localStorage.setItem(_i6, val);
|
|
2542
2591
|
}
|
|
2543
2592
|
}
|
|
2544
2593
|
} else {
|
|
2545
2594
|
if (typeof key === 'string') {
|
|
2546
|
-
|
|
2595
|
+
sessionStorage.setItem(key, value);
|
|
2547
2596
|
} else if (Array.isArray(key)) {
|
|
2548
2597
|
for (var _i7 in key) {
|
|
2549
|
-
|
|
2598
|
+
sessionStorage.setItem(key[_i7], value);
|
|
2550
2599
|
}
|
|
2551
2600
|
} else {
|
|
2552
2601
|
for (var _i8 in key) {
|
|
2553
2602
|
var _val = _typeof(key[_i8]) === 'object' ? JSON.stringify(key[_i8]) : key[_i8];
|
|
2554
|
-
|
|
2603
|
+
sessionStorage.setItem(_i8, _val);
|
|
2555
2604
|
}
|
|
2556
2605
|
}
|
|
2557
2606
|
}
|