Skip to content

Commit 0f3b11e

Browse files
fix: 前台博客vue中node-sass版本,使服务器上node可以支持下载
1 parent 62a0ad0 commit 0f3b11e

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

blog/components/Header.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { Row, Col } from 'antd'
33
import { withRouter } from 'next/router'
44
import Menu from '../components/Menu'
55
import '../public/style/components/header.css'
6-
6+
import { vuebaseUrl } from '../config/apiBaseUrl'
7+
78
const Header = (props)=>{
89

910
const navs = [
@@ -14,7 +15,7 @@ const Header = (props)=>{
1415

1516
const toVueVersion = ()=>{
1617
const router = props.router
17-
router.push(`/vue${router.asPath}`)
18+
window.location.href = vuebaseUrl + router.asPath
1819
}
1920

2021
return(

blog/config/apiBaseUrl.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const vuebaseUrl = 'https://vue.immortalboy.cn'
12
const serverUrl = 'https://immortalboy.cn'
23
const baseUrl = 'https://immortalboy.cn/api/blog'
34

@@ -25,5 +26,6 @@ const servicePath = {
2526

2627
export {
2728
serverUrl,
28-
servicePath
29+
servicePath,
30+
vuebaseUrl
2931
}

blogvue/src/components/Header.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<script>
2929
import Menu from './Menu'
3030
import LogoReact from '@/assets/images/logo_react.svg'
31+
import { serverUrl } from '@/config/apiBaseUrl.js'
3132
3233
const navs = [
3334
{name: '首页', icon: 'home', theme: 'filled', link: '/', type: 'home'},
@@ -53,9 +54,8 @@
5354
},
5455
methods: {
5556
toReactVersion() {
56-
let fullPath = this.$router.history.current.fullPath
57-
fullPath = fullPath.split('/vue')[1]
58-
this.$router.push(fullPath)
57+
const fullPath = this.$router.history.current.fullPath
58+
window.location.href = serverUrl + fullPath
5959
}
6060
},
6161
}

service/config/config.default.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ module.exports = appInfo => {
4747
csrf: {
4848
enable: false,
4949
},
50-
domainWhiteList: [ 'http://localhost:9000', 'http://localhost:3000', 'http://immortalboy.cn', 'http://admin.immortalboy.cn', 'https://immortalboy.cn', 'https://admin.immortalboy.cn' ],
50+
domainWhiteList: [
51+
'http://localhost:9000',
52+
'http://localhost:3000',
53+
'http://immortalboy.cn',
54+
'http://vue.immortalboy.cn',
55+
'http://admin.immortalboy.cn',
56+
'https://immortalboy.cn',
57+
'https://vue.immortalboy.cn',
58+
'https://admin.immortalboy.cn',
59+
],
5160
};
5261
config.cors = {
5362
// origin: '*', // 注释掉则允许白名单的域名访问

0 commit comments

Comments
 (0)