Skip to content

Commit bee36e1

Browse files
committed
请求不使用代理
1 parent ce21d13 commit bee36e1

File tree

12 files changed

+88
-118
lines changed

12 files changed

+88
-118
lines changed

favicon.ico

-914 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dependencies": {
1111
"axios": "^0.18.0",
1212
"babel-polyfill": "^6.26.0",
13-
"element-ui": "^2.8.2",
13+
"element-ui": "^2.9.2",
1414
"mavon-editor": "^2.6.17",
1515
"vue": "^2.6.10",
1616
"vue-cropperjs": "^3.0.0",

public/vuetable.json

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

src/api/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import request from '../utils/request';
2+
3+
export const fetchData = (query) => {
4+
return request({
5+
url: '/ms/table/list',
6+
method: 'post',
7+
data: query
8+
})
9+
}

src/assets/vuetable.json

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

src/components/common/Sidebar.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@
127127
}
128128
]
129129
}
130+
,
131+
{
132+
icon: 'el-icon-lx-redpacket_fill',
133+
index: '/donate',
134+
title: '支持作者'
135+
}
130136
]
131137
}
132138
},

src/components/page/BaseTable.vue

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
</div>
88
<div class="container">
99
<div class="handle-box">
10-
<el-button type="primary" icon="delete" class="handle-del mr10" @click="delAll">批量删除</el-button>
10+
<el-button type="primary" icon="el-icon-delete" class="handle-del mr10" @click="delAll">批量删除</el-button>
1111
<el-select v-model="select_cate" placeholder="筛选省份" class="handle-select mr10">
1212
<el-option key="1" label="广东省" value="广东省"></el-option>
1313
<el-option key="2" label="湖南省" value="湖南省"></el-option>
1414
</el-select>
1515
<el-input v-model="select_word" placeholder="筛选关键词" class="handle-input mr10"></el-input>
16-
<el-button type="primary" icon="search" @click="search">搜索</el-button>
16+
<el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
1717
</div>
1818
<el-table :data="data" border class="table" ref="multipleTable" @selection-change="handleSelectionChange">
1919
<el-table-column type="selection" width="55" align="center"></el-table-column>
@@ -68,11 +68,11 @@
6868
</template>
6969

7070
<script>
71+
import { fetchData } from '../../api/index';
7172
export default {
7273
name: 'basetable',
7374
data() {
7475
return {
75-
url: './vuetable.json',
7676
tableData: [],
7777
cur_page: 1,
7878
multipleSelection: [],
@@ -123,14 +123,10 @@
123123
},
124124
// 获取 easy-mock 的模拟数据
125125
getData() {
126-
// 开发环境使用 easy-mock 数据,正式环境使用 json 文件
127-
if (process.env.NODE_ENV === 'development') {
128-
this.url = '/ms/table/list';
129-
};
130-
this.$axios.post(this.url, {
126+
fetchData({
131127
page: this.cur_page
132128
}).then((res) => {
133-
this.tableData = res.data.list;
129+
this.tableData = res.list;
134130
})
135131
},
136132
search() {

src/components/page/Donate.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<div>
3+
<div class="crumbs">
4+
<el-breadcrumb separator="/">
5+
<el-breadcrumb-item><i class="el-icon-lx-redpacket_fill"></i> 支持作者</el-breadcrumb-item>
6+
</el-breadcrumb>
7+
</div>
8+
<div class="container">
9+
<div class="plugins-tips">
10+
如果该框架对你有帮助,那就请作者喝杯饮料吧!加微信号linxin_20探讨问题。
11+
</div>
12+
<div><img src="http://blog.gdfengshuo.com/images/weixin.jpg"></div>
13+
</div>
14+
15+
</div>
16+
</template>
17+
18+
<script>
19+
export default {
20+
21+
}
22+
</script>
23+
24+
<style>
25+
26+
</style>

src/components/page/Upload.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<el-upload
1616
class="upload-demo"
1717
drag
18-
action="/api/posts/"
18+
action="http://jsonplaceholder.typicode.com/api/posts/"
1919
multiple>
2020
<i class="el-icon-upload"></i>
2121
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>

src/router/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ export default new Router({
9696
path: '/403',
9797
component: resolve => require(['../components/page/403.vue'], resolve),
9898
meta: { title: '403' }
99+
},
100+
{
101+
path: '/donate',
102+
component: resolve => require(['../components/page/Donate.vue'], resolve),
103+
meta: { title: '支持作者' }
99104
}
100105
]
101106
},

0 commit comments

Comments
 (0)