zhangwei 2 лет назад
Родитель
Сommit
b03b4bd7e9

+ 17 - 1
src/entry/content_help.js

@@ -4,12 +4,28 @@ import {
 } from "@/logic/content/twitter.js";
 import { createApp } from 'vue'
 import ViewMessage from '@/view/content/message/index.vue'
+import * as Sentry from "@sentry/vue";
+import { BrowserTracing } from "@sentry/tracing";
 
 const addDomMessage = (element) => {
     const div = document.createElement('div')
     div.id = 'denet_message'
     document.body.appendChild(div)
-    createApp(element).mount('#denet_message')
+    let app = createApp(element)
+    app.mount('#denet_message')
+    Sentry.init({
+        app,
+        dsn: "http://529fc1c357b248eda7473c119093f5db@sentry.denet.me/5",
+        integrations: [
+            new BrowserTracing({
+                tracingOrigins: ["localhost", "my-site-url.com", /^\//],
+            }),
+        ],
+        // Set tracesSampleRate to 1.0 to capture 100%
+        // of transactions for performance monitoring.
+        // We recommend adjusting this value in production
+        tracesSampleRate: 1.0,
+    });
 }
 
 let timer = setInterval(() => {

+ 21 - 20
src/iframe/red-packet.js

@@ -5,30 +5,31 @@ const app = createApp(App)
 // 引入路由对象实例
 import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
 import "@/assets/css/reset.css";
+import { message, Tooltip, Switch } from "ant-design-vue";
 
-// import * as Sentry from "@sentry/vue";
-// import { BrowserTracing } from "@sentry/tracing";
-
+import * as Sentry from "@sentry/vue";
+import { BrowserTracing } from "@sentry/tracing";
 
-// Sentry.init({
-//   app,
-//   dsn: "http://529fc1c357b248eda7473c119093f5db@sentry.denet.me/5",
-//   integrations: [
-//     new BrowserTracing({
-//       tracingOrigins: ["localhost", "my-site-url.com", /^\//],
-//     }),
-//   ],
-//   // Set tracesSampleRate to 1.0 to capture 100%
-//   // of transactions for performance monitoring.
-//   // We recommend adjusting this value in production
-//   tracesSampleRate: 1.0,
-// });
+// if (process.env.NODE_ENV === 'production') {
+Sentry.init({
+  app,
+  dsn: "http://529fc1c357b248eda7473c119093f5db@sentry.denet.me/5",
+  integrations: [
+    new BrowserTracing({
+      tracingOrigins: ["localhost", "my-site-url.com", /^\//],
+    }),
+  ],
+  // Set tracesSampleRate to 1.0 to capture 100%
+  // of transactions for performance monitoring.
+  // We recommend adjusting this value in production
+  tracesSampleRate: 1.0,
+});
+// }
 
-import { message, Tooltip, Switch } from "ant-design-vue";
 message.config({
-    top: `10px`,
-    duration: 3,
-    maxCount: 1,
+  top: `10px`,
+  duration: 3,
+  maxCount: 1,
 });
 app.use(Tooltip);
 app.use(Switch);

+ 16 - 16
src/uilts/help.js

@@ -155,20 +155,20 @@ export function getOffsetRect(element) {
 }
 
 export function formatSecondsAsTime(secs) {
-    var hr = Math.floor(secs / 3600)
-    var min = Math.floor((secs - (hr * 3600)) / 60)
-    var sec = Math.floor(secs - (hr * 3600) - (min * 60))
-    var text
-    if (hr < 10) {
-        hr = "0" + hr
-    }
-    if (min < 10) {
-        min = "0" + min
-    }
-    if (sec < 10) {
-        sec = "0" + sec
-    }
-    text = hr + ':' + min + ':' + sec
+  var hr = Math.floor(secs / 3600)
+  var min = Math.floor((secs - (hr * 3600)) / 60)
+  var sec = Math.floor(secs - (hr * 3600) - (min * 60))
+  var text
+  if (hr < 10) {
+    hr = "0" + hr
+  }
+  if (min < 10) {
+    min = "0" + min
+  }
+  if (sec < 10) {
+    sec = "0" + sec
+  }
+  text = hr + ':' + min + ':' + sec
 
-    return text
-}
+  return text
+}

+ 4 - 0
src/view/iframe/red-packet/index.vue

@@ -9,4 +9,8 @@ import LuckDraw from '@/view/iframe/red-packet/luck-draw.vue'
 import { getQueryString } from '@/uilts/help.js'
 let state = reactive({})
 state.page_type = getQueryString('page_type') || '红包'
+setTimeout(() => {
+    console.log(gggggg)    
+}, 5000);
+
 </script>

+ 0 - 1
src/view/iframe/red-packet/luck-draw.vue

@@ -489,7 +489,6 @@ let fullName = '';
 function clickRetry() {
     init()
 }
-console.log(asdasd)
 
 let follow_open_tabs = []