Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
173f3e90
Commit
173f3e90
authored
Feb 22, 2020
by
高浩杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of coding.yundingshuyuan.com:pigbigbig/beyond-clouds-front into yoona
parents
04315c99
c8352e91
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
nuxt.config.js
+0
-3
plugins/baidu.js
+19
-0
No files found.
nuxt.config.js
View file @
173f3e90
...
...
@@ -19,9 +19,6 @@ module.exports = {
],
link
:
[
{
rel
:
'icon'
,
type
:
'image/x-icon'
,
href
:
'/favicon.ico'
}
],
script
:
[
{
src
:
'https://hm.baidu.com/hm.js?8e45646333c0b122d556ae44e337c90e'
}
]
},
/*
...
...
plugins/baidu.js
View file @
173f3e90
export
default
({
app
:
{
router
},
store
})
=>
{
router
.
afterEach
((
to
,
from
)
=>
{
try
{
// 百度统计
document
.
getElementById
(
'g_baidu'
)
&&
document
.
getElementById
(
'g_baidu'
).
remove
();
var
hm
=
document
.
createElement
(
"script"
);
hm
.
src
=
"https://hm.baidu.com/hm.js?8e45646333c0b122d556ae44e337c90e"
;
...
...
@@ -9,6 +10,24 @@ export default ({ app: { router }, store }) => {
s
.
parentNode
.
insertBefore
(
hm
,
s
);
window
.
_hmt
=
window
.
_hmt
||
[]
window
.
_hmt
.
push
([
'_trackPageview'
,
to
.
fullPath
])
// 百度自动链接提交
linkSubmit
()
}
catch
(
e
)
{}
})
}
function
linkSubmit
()
{
document
.
getElementById
(
'link_baidu'
)
&&
document
.
getElementById
(
'link_baidu'
).
remove
();
var
bp
=
document
.
createElement
(
'script'
);
bp
.
id
=
'link_baidu'
var
curProtocol
=
window
.
location
.
protocol
.
split
(
':'
)[
0
];
if
(
curProtocol
===
'https'
){
bp
.
src
=
'https://zz.bdstatic.com/linksubmit/push.js'
;
}
else
{
bp
.
src
=
'http://push.zhanzhang.baidu.com/push.js'
;
}
var
s
=
document
.
getElementsByTagName
(
"script"
)[
0
];
s
.
parentNode
.
insertBefore
(
bp
,
s
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment