Skip to content

Commit 3e232aa

Browse files
committed
update nuxt.config
1 parent fc96ae6 commit 3e232aa

File tree

7 files changed

+121
-48
lines changed

7 files changed

+121
-48
lines changed

layouts/default.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<script>
1111
import header from "~/components/app-header.vue";
1212
import footer from "~/components/app-footer.vue";
13+
import * as Sentry from "@sentry/browser";
14+
import { Integrations } from "@sentry/tracing";
1315
export default {
1416
name: "layout",
1517
components: {
@@ -23,7 +25,9 @@ export default {
2325
});
2426
// init sentry
2527
Sentry.init({
26-
dsn: "https://[email protected]/1329324"
28+
dsn: "https://[email protected]/1329324",
29+
integrations: [new Integrations.BrowserTracing()],
30+
tracesSampleRate: 1.0,
2731
});
2832
// init baidu seo
2933
var bp = document.createElement("script");

nuxt.config.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,6 @@ module.exports = {
2525
"Lua 中国,这里是 Lua 论坛,为开发者提供学习交流的平台,Lua 中国需要你的力量!"
2626
}
2727
],
28-
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
29-
script: [
30-
{
31-
src:
32-
"https://lua-china-1256147061.file.myqcloud.com/static/js/sentry.min.js",
33-
crossorigin: "anonymous"
34-
},
35-
{
36-
src:
37-
"https://lua-china-1256147061.file.myqcloud.com/static/js/highlight.min.js",
38-
crossorigin: "anonymous"
39-
},
40-
{
41-
src:
42-
"https://lua-china-1256147061.file.myqcloud.com/static/js/lua.min.js",
43-
crossorigin: "anonymous"
44-
}
45-
]
4628
},
4729

4830
/*

package-lock.json

Lines changed: 111 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"dependencies": {
1414
"@nuxt/ufo": "^0.5.4",
1515
"@popperjs/core": "^2.10.2",
16+
"@sentry/browser": "^6.14.0",
17+
"@sentry/tracing": "^6.14.0",
1618
"axios": "^0.21.1",
1719
"bootstrap": "^5.1.3",
1820
"bootstrap-icons": "^1.6.1",

pages/posts/_id/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@
179179

180180
<script>
181181
import apiService from "~/services/apiService";
182-
import syncApiService from "~/services/syncApiService";
183182
import HashAvatar from "~/components/hash-avatar";
184183
import config from "~/config/api.js";
185184
import localStorage from "~/utils/localStorage";
@@ -246,7 +245,7 @@ export default {
246245
apiUrl = config.apiUrl;
247246
}
248247
//推荐文章
249-
let posts = await syncApiService
248+
let posts = await apiService
250249
.get(apiUrl + "/posts/")
251250
.then(posts => {
252251
return posts.data.data.data;
@@ -258,7 +257,7 @@ export default {
258257
});
259258
});
260259
//当前文章
261-
let post = await syncApiService
260+
let post = await apiService
262261
.get(apiUrl + "/posts/" + params.id)
263262
.then(res => {
264263
if (res.data.status !== 0) {

pages/users/_id/edit.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<script>
4949
import HashAvatar from "~/components/hash-avatar";
5050
import apiService from "~/services/apiService";
51-
import syncApiService from "~/services/syncApiService";
5251
import config from "~/config/api.js";
5352
5453
export default {
@@ -64,7 +63,7 @@ export default {
6463
};
6564
},
6665
async asyncData({ params, error }) {
67-
return await syncApiService
66+
return await apiService
6867
.get(config.apiInternalUrl + "/users/" + params.id)
6968
.then(res => {
7069
if (res.data.status === 0x010009) {

services/syncApiService.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)