Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
frontHu committed Nov 13, 2018
1 parent b07ccc6 commit 093e381
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/api/blog.api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fetch from '.'
import fetch from './index'

export function saveBlogApi(data) {
return fetch('/blog/save', data)
Expand Down
2 changes: 1 addition & 1 deletion src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
// import queryString from './../untils/querysting'

const base_url = '/server'
const base_url = process.env.NODE_ENV === 'production' ? '/api' : '/server'

export default function fetch(url, data) {
return new Promise((resolve, reject) => {
Expand Down
File renamed without changes
File renamed without changes
23 changes: 8 additions & 15 deletions src/components/Slider/menulist.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,18 @@ export default [
menuName: "我的文章库",
parent: -1,
icon: require('./../../assets/icon2.png'),
link: "/home/article",
// childMenus: [{
// id: '2-1',
// menuName: '前端小栈',
// parent: 1,
// icon: require('./../../assets/icon2-1.png'),
// link: "/home/article",
// }, {
// id: '2-2',
// menuName: '其他东东',
// parent: 1,
// icon: require('./../../assets/icon2-2.png'),
// link: "/home/article",
// }]
link: "/home/article"
},{
id: '3',
menuName: '我的草稿箱',
parent: -1,
icon: require('./../../assets/icon2-2.png'),
icon: require('./../../assets/icon3.png'),
link: "/home/trash"
}, {
id: '4',
menuName: '我的友链',
parent: -1,
icon: require('./../../assets/icon4.png'),
link: '/home/friends'
}
]
107 changes: 107 additions & 0 deletions src/page/Friend/Friend.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<template>
<div class="friend">
<div class="friend-add">
<el-button type="primary" @click="dialogVisible=true">新增</el-button>
</div>
<el-dialog
title="添加好朋友"
:visible="dialogVisible"
>
<el-upload
class="avatar-uploader"
action="https://jsonplaceholder.typicode.com/posts/"
:show-file-list="false"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div class="info">
<el-input v-model="name" placeholder="名称"></el-input>
</div>
<div class="info">
<el-input v-model="desc" type="textarea" placeholder="描述"></el-input>
</div>
<div class="info">
<el-input v-model="blog" placeholder="博客"></el-input>
</div>
<div class="info">
<el-input v-model="github" placeholder="Github"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
<el-table border>
<el-table-column
type="index">
</el-table-column>
<el-table-column
label="友名"
></el-table-column>
<el-table-column
label="描述"
></el-table-column>
<el-table-column
label="博客"
></el-table-column>
<el-table-column
label="GitHub"
></el-table-column>
<el-table-column
label="操作"
></el-table-column>
</el-table>
</div>
</template>

<script>
export default {
name: 'Friend',
data() {
return {
dialogVisible: false,
name: '',
desc: '',
blog: '',
github: '',
imageUrl: ''
}
},
}
</script>

<style scoped lang='scss'>
.friend {
padding: 20px;
.friend-add {
margin-bottom: 20px;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
.info {
margin-bottom: 20px;
}
}
</style>
4 changes: 3 additions & 1 deletion src/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Login from './../page/Login/Login.vue'
import Home from './../page/Home/Home.vue'
import Markdown from './../page/Markdown/Markdown.vue'
import Article from './../page/Article/Article.vue'
import Friend from './../page/Friend/Friend.vue'

Vue.use(Router)

Expand All @@ -23,7 +24,8 @@ export default new Router({
children: [
{path: '', component: Markdown},
{path: 'markdown', component: Markdown},
{path: 'article/:id', component: Article}
{path: 'article/:id', component: Article},
{path: 'friends', component: Friend}
]
}
]
Expand Down
10 changes: 5 additions & 5 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module.exports = {
devServer: {
host: 'localhost',
port: 8080,
port: 9999,
proxy: {
'/server': {
target: 'http://localhost:3333',
target: 'http://localhost:8080',
pathRewrite: {
'^/server': 'http://localhost:3333'
'^/server': 'http://localhost:8080'
},
changeOrigin: false
changeOrigin: false
}
}
},
baseUrl: process.env.NODE_ENV === 'production' ? 'http://zw-lazy.cn/backend/' : '/'
baseUrl: process.env.NODE_ENV === 'production' ? 'http://47.98.177.236:80/backend' : '/'
}

0 comments on commit 093e381

Please sign in to comment.