byt-ui 0.1.6 → 0.1.8
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/lib/byt-ui.common.js +18 -16
- package/lib/byt-ui.umd.js +18 -16
- package/lib/byt-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/common/modules/cookie.js +3 -3
- package/packages/common/modules/sentry.js +15 -13
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Description:
|
|
3
3
|
* @Author: 王国火
|
|
4
4
|
* @Date: 2022-10-18 12:37:03
|
|
5
|
-
* @LastEditTime: 2024-04-22 19:
|
|
5
|
+
* @LastEditTime: 2024-04-22 19:23:05
|
|
6
6
|
* @LastEditors: 王国火
|
|
7
7
|
*/
|
|
8
8
|
import Cookie from 'js-cookie'
|
|
@@ -14,7 +14,7 @@ export const getCookie = (key) => {
|
|
|
14
14
|
}) || ''
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export const setCookie = (key, value, expires = 7, path = '') => {
|
|
17
|
+
export const setCookie = (key, value, expires = 7, path = '/') => {
|
|
18
18
|
const fullKey = `${website.key}-${key}`;
|
|
19
19
|
return Cookie.set(fullKey, value, {
|
|
20
20
|
expires,
|
|
@@ -23,7 +23,7 @@ export const setCookie = (key, value, expires = 7, path = '') => {
|
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export const removeCookie = (key, path = '') => {
|
|
26
|
+
export const removeCookie = (key, path = '/') => {
|
|
27
27
|
const fullKey = `${website.key}-${key}`;
|
|
28
28
|
return Cookie.remove(fullKey, {
|
|
29
29
|
path
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Description:
|
|
3
3
|
* @Author: 王国火
|
|
4
4
|
* @Date: 2024-04-18 15:37:44
|
|
5
|
-
* @LastEditTime: 2024-04-
|
|
5
|
+
* @LastEditTime: 2024-04-23 09:30:29
|
|
6
6
|
* @LastEditors: 王国火
|
|
7
7
|
*/
|
|
8
8
|
import * as sentry from '@sentry/vue'
|
|
@@ -146,20 +146,22 @@ class Sentry {
|
|
|
146
146
|
// 允许自定义配置覆盖、合并默认配置
|
|
147
147
|
sentry.init(Object.assign({}, params, this.options))
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
register() {
|
|
150
|
+
this.axios({
|
|
151
151
|
url: '/leo-tech-bridge/sysParam/getSentryDsn',
|
|
152
|
-
method: 'GET'
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
method: 'GET',
|
|
153
|
+
showError: false
|
|
154
|
+
}).then(res => {
|
|
155
|
+
// 需要兼容商城和业务中台
|
|
156
|
+
const val = res instanceof Object ? res.data : res;
|
|
157
|
+
if (val) {
|
|
157
158
|
// 重新处理拼接dsn地址
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
const localhost = window.location;
|
|
160
|
+
const result = val.split('@');
|
|
161
|
+
const dsn = `${localhost.protocol}//${result[0]}@${localhost.host}${result[1]}`;
|
|
162
|
+
this.init(dsn);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
163
165
|
}
|
|
164
166
|
}
|
|
165
167
|
|