File tree Expand file tree Collapse file tree 7 files changed +17
-8
lines changed Expand file tree Collapse file tree 7 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1- VUE_APP_host = http://www.fxss.work:3000
2- VUE_APP_pathname = /myapp
1+ VUE_APP_host = http://www.fxss.work
2+ VUE_APP_pathname = /vue-blog
33VUE_APP_title = 樊小书生
44VUE_APP_keywords = 樊小书生的博客
55VUE_APP_description = 樊小书生的博客,多看代码,多看书,付出总会有收获的
Original file line number Diff line number Diff line change 1+ VUE_APP_host = http://localhost:3000
Original file line number Diff line number Diff line change 4747 index =" 6" >
4848 <template slot="title">
4949 <div class =" user-box clearfix" >
50- <img class =" user-box_header-img fl" src =" ./../assets/header.jpg " alt =" 用户头像" >
50+ <img class =" user-box_header-img fl" : src =" authorImg " alt =" 用户头像" >
5151 <div class =" user-box_name ellipsis" >{{ userInfo.name }}</div >
5252 </div >
5353 </template >
@@ -134,6 +134,9 @@ export default {
134134 break
135135 }
136136 return res
137+ },
138+ authorImg () {
139+ return this .userInfo .authorHeadimg ? ` ${ process .env .VUE_APP_host } /${ this .userInfo .authorHeadimg } ` : ' https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
137140 }
138141 },
139142 created () {},
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import store from './../store'
1111// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
1212
1313let config = {
14- // baseURL: process.env.baseURL || process.env.apiUrl || ""
14+ baseURL : process . env . VUE_APP_pathname
1515 // timeout: 60 * 1000, // Timeout
1616 // withCredentials: true, // Check cross-site Access-Control
1717}
Original file line number Diff line number Diff line change @@ -72,11 +72,16 @@ const routes = [
7272]
7373
7474const router = new VueRouter ( {
75- mode : 'history' ,
76- base : '/vue-blog/' ,
75+ // 本地开始时注释
76+ // mode: 'history',
77+ // base: '/vue-blog/',
7778 routes,
7879 scrollBehavior ( to , from , savedPosition ) {
79- if ( savedPosition ) {
80+ if ( to . hash ) {
81+ return {
82+ selector : to . hash
83+ }
84+ } else if ( savedPosition ) {
8085 return savedPosition
8186 } else {
8287 return {
Original file line number Diff line number Diff line change 44 <el-form-item label =" 用户头像" >
55 <el-upload
66 ref =" headerUpload"
7- action =" /api/addUserHeader"
7+ action =" /vue-blog/ api/addUserHeader"
88 accept =" image/png, image/jpeg"
99 list-type =" picture-card"
1010 :file-list =" fileList"
You can’t perform that action at this time.
0 commit comments