Commit 294085ab by 张立顺

refactor: remove main package Sentry runtime

1 parent c381e892
//app.js //app.js
// 初始化sentry
import sentryInit from "~/utils/sentryConfig/sentryInit";
import { getSystemInfoSync } from "~/utils/systemInfo"; import { getSystemInfoSync } from "~/utils/systemInfo";
const sentry = sentryInit();
wx.$sendSentry = function (e) {
sentry.captureException(e);
};
// 解决showLoading 和 showToast显示异常的问题 // 解决showLoading 和 showToast显示异常的问题
import fixWxShowToast from "./utils/lib/fixWxShowToast"; import fixWxShowToast from "./utils/lib/fixWxShowToast";
fixWxShowToast(); fixWxShowToast();
......
...@@ -91,9 +91,6 @@ export const ALIYUN = ALIYUN_LIST[1]; ...@@ -91,9 +91,6 @@ export const ALIYUN = ALIYUN_LIST[1];
// 报价单图片地址 // 报价单图片地址
export const quotedImgUrl = createQuotedUrl[target[envIndex]]; export const quotedImgUrl = createQuotedUrl[target[envIndex]];
export const scoket_url = scoketURL[target[envIndex]]; export const scoket_url = scoketURL[target[envIndex]];
// sentry Dsn 地址
export const dsnUrl =
"https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23";
// 图片基地址 // 图片基地址
export const ImgUrl = export const ImgUrl =
......
const app = getApp()
Page({
data: {
data: [
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
},
{
a: 123,
b: 456,
c: 489,
d: 789,
e: 458,
f: 789
}
],
dataAttribute: [
{
title: '第一列',
key: 'a'
},
{
title: '第2列',
key: 'b'
},
{
title: '第3列',
key: 'c'
},
{
title: '第4列',
key: 'd'
},
{
title: '第5列',
key: 'e'
},
{
title: '第6列',
key: 'f'
}
],
tableHeight: (20 + 1) * 96,
tableWidth: 200 * 6 + 60
}
})
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<ScrollView
class="table"
scroll-x
scroll-y
bindscrolltolower="handleScrollToLower">
<View class="sticky-box" style="height:{{tableHeight}}rpx;">
<View class="table__head" style="width:{{tableWidth}}rpx;">
<View
class="table__head__td"
wx:for="{{dataAttribute}}"
wx:key="attrIndex"
wx:for-index="attrIndex"
wx:for-item="attrItem">
<Text class="table__head__td__text">{{attrItem.title}}</Text>
</View>
</View>
<View
class="table__row"
wx:for="{{data}}"
wx:key="dataIndex"
wx:for-index="dataIndex"
wx:for-item="dataItem"
style="width:{{tableWidth}}rpx;">
<Text class="table__row__td" wx:for="{{dataAttribute}}" wx:key="dataIndex" wx:for-index="attrIndex" wx:for-item="attrItem">
{{dataItem[attrItem.key] || '-'}}
</Text>
</View>
</View>
</ScrollView>
page{
font-size: var(--fontSize26);
line-height: var(--fontSize60);
color: #222;
height: 100%;
width: 100%;
}
.table{
display: block;
position: relative;
overflow: scroll;
width: 100%;
height: 100%;
}
.sticky-box{
}
.table__head{
height: var(--fontSize96);
white-space: nowrap;
position: sticky;
top: 0;
z-index: 1;
height: var(--fontSize88);
font-size: var(--fontSize24);
line-height: var(--fontSize88);
color: #aaabbd;
background-color: #f8f8f8;
border-bottom: var(--fontSize2) solid #ecf1f8;
background-color: #fff;
white-space: nowrap;
display: flex;
}
.table__head__td{
width: var(--fontSize200);
display: flex;
justify-content: flex-start;
align-items: center;
background-color: #fff;
box-sizing: border-box;
position: relative;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.table__head__td:nth-child(1) {
padding-left: var(--fontSize24);
width: var(--fontSize260);
margin-right: var(--fontSize40);
position: sticky;
z-index: 2;
left: 0;
}
.table__head__td__text{
display: inline;
}
.table__row{
position: relative;
height: var(--fontSize96);
white-space: nowrap;
display: flex;
justify-content: flex-start;
align-items: center;
border-bottom: var(--fontSize2) solid #ecf1f8;
}
.table__row__td{
overflow: scroll;
white-space: nowrap;
width: var(--fontSize200);
display: inline-block;
background-color: #fff;
box-sizing: border-box;
font-size: var(--fontSize26);
line-height: var(--fontSize96);
position: relative;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.table__row__td:nth-child(1) {
margin-right: var(--fontSize40);
padding-left: var(--fontSize24);
width: var(--fontSize260);
position: sticky;
z-index: 3;
left: 0;
}
\ No newline at end of file \ No newline at end of file
...@@ -634,7 +634,7 @@ Page({ ...@@ -634,7 +634,7 @@ Page({
// 如果重试次数小于1,则重试一次 // 如果重试次数小于1,则重试一次
this.getEnhancement(last_message, idx, retryCount + 1); this.getEnhancement(last_message, idx, retryCount + 1);
} }
wx.$sendSentry(name + "获取改进建议和润色表达" + JSON.stringify(e)); console.warn(name + "获取改进建议和润色表达失败", e);
}); });
}, },
getHistory() { getHistory() {
......
...@@ -84,7 +84,6 @@ Component({ ...@@ -84,7 +84,6 @@ Component({
const { const {
name name
} = wx.$util.getUserInfo(); } = wx.$util.getUserInfo();
wx.$sendSentry(name+'语音识别连接失败')
console.log("sr is null") console.log("sr is null")
return return
} }
...@@ -112,7 +111,6 @@ Component({ ...@@ -112,7 +111,6 @@ Component({
await sr.start(param) await sr.start(param)
this.data.srStart = true this.data.srStart = true
} catch (e) { } catch (e) {
wx.$sendSentry('语音转文字连接失败' + JSON.stringify(e))
console.log("start failed:" + e) console.log("start failed:" + e)
return return
} }
...@@ -152,7 +150,6 @@ Component({ ...@@ -152,7 +150,6 @@ Component({
}) })
wx.getRecorderManager().onError((res) => { wx.getRecorderManager().onError((res) => {
console.log("recording failed:" + res) console.log("recording failed:" + res)
wx.$sendSentry('语音转文字失败' + JSON.stringify(res))
// this.connectSr() // this.connectSr()
}) })
try { try {
......
import { dsnUrl } from '~/config'
import * as Sentry from '~/utils/lib/sentry-miniapp'
import { env } from '~/config'
// console.log(env, 'env')
export default function sentryInit() {
//测试和生产才开启sentry
const envNameList = ['trial', 'release']
envNameList.includes(env) &&
Sentry.init({
dsn: dsnUrl
})
return Sentry
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!