Commit a2043580 by 张立顺

优化sentry 导入 和新增config.js

1 parent a1680e87
import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram
// const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
......
import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram
// const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
......
import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram
// const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
......
// app.js
import * as Sentry from './utils/lib/sentry-miniapp'
// accountInfo.miniProgram.envVersion == 'release' &&
const accountInfo = wx.getAccountInfoSync()
//测试和生产才开发sentry
const env = ['trial', 'release']
env.includes(accountInfo.miniProgram.envVersion) && Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: 'https://59c3cfc3ffb84ed68fc0dda26fb09e12@sentry.glsx.com.cn/30'
})
// 初始化sentry
import sentryInit from '~/utils/sentryConfig/sentryInit'
sentryInit()
import util from './utils/util'
import wxApi from './utils/utils_wx'
......@@ -17,7 +11,6 @@ import router from './router/index'
// 有问题 前后顺序不能随意调整
// console.log(test)
import { setSystem_info } from '~/utils/cache/storageApi'
// console.log(setSystem_info)
......
/**
* 用来配置小程序项目的变量
* 统一管理
*/
// 配置预发布的小程序aapId
export const preReleaseAppId = 'wx24ebae5768e74138'
// sentry Dsn 地址
export const dsnUrl = 'https://59c3cfc3ffb84ed68fc0dda26fb09e12@sentry.glsx.com.cn/30'
......@@ -75,6 +75,7 @@ class Draw {
if (fontSize) this[_ctx_].font = `${fontSize}px${font}`
return this[_ctx_].measureText(text).width
}
// 画块形状
drawFill({ x, y, width, height, color }) {
height = this.toRpx(height)
width = this.toRpx(width)
......
......@@ -56,19 +56,19 @@ export function commentTime(dateTimeStamp) {
let monthTime = dayTime * 30
let yearTime = dayTime * 365
if (parseInt(timeDifference / yearTime) >= 1) {
result = parseInt(timeDifference / yearTime) + '年前'
} else if (parseInt(timeDifference / monthTime) >= 1) {
result = parseInt(timeDifference / monthTime) + '月前'
} else if (parseInt(timeDifference / weektTime) >= 1) {
result = parseInt(timeDifference / weektTime) + '周前'
} else if (parseInt(timeDifference / dayTime) >= 1) {
result = parseInt(timeDifference / dayTime) + '天前'
} else if (parseInt(timeDifference / hourTime) >= 1) {
result = parseInt(timeDifference / hourTime) + '小时前'
} else if (parseInt(timeDifference / minTime) >= 1) {
result = parseInt(timeDifference / minTime) + '分钟前'
if (parseInt(timeDifference / minTime) <= 5) {
if (math.floor(timeDifference / yearTime) >= 1) {
result = math.floor(timeDifference / yearTime) + '年前'
} else if (math.floor(timeDifference / monthTime) >= 1) {
result = math.floor(timeDifference / monthTime) + '月前'
} else if (math.floor(timeDifference / weektTime) >= 1) {
result = math.floor(timeDifference / weektTime) + '周前'
} else if (math.floor(timeDifference / dayTime) >= 1) {
result = math.floor(timeDifference / dayTime) + '天前'
} else if (math.floor(timeDifference / hourTime) >= 1) {
result = math.floor(timeDifference / hourTime) + '小时前'
} else if (math.floor(timeDifference / minTime) >= 1) {
result = math.floor(timeDifference / minTime) + '分钟前'
if (math.floor(timeDifference / minTime) <= 5) {
//五分钟内就是刚刚
result = '刚刚'
}
......
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
/**
......@@ -28,7 +29,7 @@ let index = 3
// console.log();
if (systemInfo.platform != 'devtools') {
// 判断预发布的appid 是强制锁定为4(预发布的地址)
if (accountInfo.miniProgram.appId == 'wx24ebae5768e74138') {
if (accountInfo.miniProgram.appId == preReleaseAppId) {
index = 4
} else {
switch (accountInfo.miniProgram.envVersion) {
......@@ -46,7 +47,6 @@ if (systemInfo.platform != 'devtools') {
break
}
}
}
const secretKey = {
......
import { dsnUrl } from '~/config'
import * as Sentry from '~/utils/lib/sentry-miniapp'
export default function sentryInit() {
// accountInfo.miniProgram.envVersion == 'release' &&
const accountInfo = wx.getAccountInfoSync()
//测试和生产才开发sentry
const env = ['trial', 'release']
env.includes(accountInfo.miniProgram.envVersion) &&
Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: dsnUrl
})
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!