acsi-core 0.1.63 → 0.1.65
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/dist/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +15 -13
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/getImageUrl.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -990,10 +990,16 @@ var apiUpload$1 = axios.create({
|
|
|
990
990
|
window.location.href = "/login";
|
|
991
991
|
}
|
|
992
992
|
if (error.response.status == 403) {
|
|
993
|
+
var hostname = window.location.hostname;
|
|
994
|
+
var parts = hostname.split('.');
|
|
995
|
+
var domain = parts.slice(-2).join('.');
|
|
993
996
|
localStorage.removeItem(ACCESS_TOKEN);
|
|
994
997
|
localStorage.removeItem(ORGANIZATION_TENANT);
|
|
995
998
|
localStorage.removeItem(ORGANIZATION_TEAM);
|
|
996
|
-
Cookies.remove('auth'
|
|
999
|
+
Cookies.remove('auth', {
|
|
1000
|
+
path: '/',
|
|
1001
|
+
domain: "." + domain
|
|
1002
|
+
});
|
|
997
1003
|
localStorage.removeItem("USER_EMAIL");
|
|
998
1004
|
window.location.href = "/login";
|
|
999
1005
|
}
|
|
@@ -1021,20 +1027,16 @@ var firstCheckToken = function firstCheckToken() {
|
|
|
1021
1027
|
|
|
1022
1028
|
var getImageUrl = function getImageUrl(imageUrl) {
|
|
1023
1029
|
try {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
return Promise.resolve(imageTrimmed);
|
|
1029
|
-
}
|
|
1030
|
-
return Promise.resolve(BASE_URL + "/images/" + imageTrimmed);
|
|
1030
|
+
if (!!imageUrl) {
|
|
1031
|
+
var imageTrimmed = imageUrl.trim();
|
|
1032
|
+
if (imageTrimmed.startsWith('http://') || imageTrimmed.startsWith('https://')) {
|
|
1033
|
+
return imageTrimmed;
|
|
1031
1034
|
}
|
|
1032
|
-
return
|
|
1033
|
-
} catch (err) {
|
|
1034
|
-
return Promise.resolve("/images/avatar-default.png");
|
|
1035
|
+
return BASE_URL + "/images/" + imageTrimmed;
|
|
1035
1036
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1037
|
+
return "/images/avatar-default.png";
|
|
1038
|
+
} catch (err) {
|
|
1039
|
+
return "/images/avatar-default.png";
|
|
1038
1040
|
}
|
|
1039
1041
|
};
|
|
1040
1042
|
|