Skip to content

Commit 5927254

Browse files
committed
by simon
1 parent 08eeca0 commit 5927254

File tree

7 files changed

+51
-19
lines changed

7 files changed

+51
-19
lines changed

.ftpconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"protocol": "sftp",
3+
"host": "192.168.0.25",
4+
"port": 22,
5+
"user": "root",
6+
"pass": "qiuyue13",
7+
"promptForPass": false,
8+
"remote": "../www/vui",
9+
"local": "",
10+
"agent": "",
11+
"privatekey": "",
12+
"passphrase": "",
13+
"hosthash": "",
14+
"ignorehost": true,
15+
"connTimeout": 10000,
16+
"keepalive": 10000,
17+
"keyboardInteractive": false,
18+
"keyboardInteractiveForPass": false,
19+
"remoteCommand": "",
20+
"remoteShell": "",
21+
"watch": [],
22+
"watchTimeout": 500
23+
}

build/webpack.dev.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
1919
devServer: {
2020
clientLogLevel: 'warning',
2121
historyApiFallback: true,
22+
disableHostCheck: true,
2223
hot: true,
2324
compress: true,
2425
host: process.env.HOST || config.dev.host,

config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
proxyTable: {},
1414

1515
// Various Dev Server settings
16-
host: '127.0.0.1', // can be overwritten by process.env.HOST
16+
host: '192.168.0.25', // can be overwritten by process.env.HOST
1717
port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
1818
autoOpenBrowser: false,
1919
errorOverlay: true,

package-lock.json

Lines changed: 14 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"eslint-friendly-formatter": "^3.0.0",
5252
"eslint-loader": "^1.7.1",
5353
"eslint-plugin-html": "^3.0.0",
54-
"eslint-plugin-import": "^2.10.0",
54+
"eslint-plugin-import": "^2.11.0",
5555
"eslint-plugin-node": "^5.2.0",
5656
"eslint-plugin-promise": "^3.7.0",
5757
"eslint-plugin-standard": "^3.0.1",

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default {
130130
}
131131
},
132132
created () {
133-
this.$http.get('list/news?uploader=1').then(response => {
133+
this.$http.get('https://laravel.boka.cn/api/list/news?uploader=1', {}).then(response => {
134134
// get status
135135
console.log(response.status)
136136
// get status text

src/main.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,24 +167,23 @@ router.afterEach(function (to) {
167167
store.commit('updateLoadingStatus', {isLoading: false})
168168
})
169169

170-
Vue.http.options.root = 'https://laravel.boka.cn/api/'
171-
// Vue.http.headers.common['Authorization'] = 'Basic YXBpOnBhc3N3b3Jk'
172-
Vue.http.interceptors.push((request, next) => {
173-
console.log(request)
174-
// modify method
175-
// request.method = 'POST'
176-
// modify headers
177-
request.headers.set('X-CSRF-TOKEN', 'TOKEN')
178-
request.headers.set('Authorization', 'Bearer TOKEN')
170+
// Vue.http.headers.common['Authorization'] = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbGFyYXZlbC5ib2thLmNuL2FwaS9zY2FubG9naW4vMTUyMzUwNDEwOSIsImlhdCI6MTUyMzUwNDE0NywiZXhwIjoxNTI0MzY4MTQ3LCJuYmYiOjE1MjM1MDQxNDcsImp0aSI6IlFrRFRwOEd2WGlsd1lqR3kiLCJzdWIiOjEsInBydiI6Ijg2NjVhZTk3NzVjZjI2ZjZiOGU0OTZmODZmYTUzNmQ2OGRkNzE4MTgifQ.bRfinjIiBjiFXXCZru1Nhw_0l8RD7Zf7FWOhv1Aw4W8'
171+
Vue.http.interceptors.push(function (request, next) {
172+
// console.log(this)
173+
request.method = 'GET'
174+
request.headers.set('Authorization', 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbGFyYXZlbC5ib2thLmNuL2FwaS9zY2FubG9naW4vMTUyMzUwNDEwOSIsImlhdCI6MTUyMzUwNDE0NywiZXhwIjoxNTI0MzY4MTQ3LCJuYmYiOjE1MjM1MDQxNDcsImp0aSI6IlFrRFRwOEd2WGlsd1lqR3kiLCJzdWIiOjEsInBydiI6Ijg2NjVhZTk3NzVjZjI2ZjZiOGU0OTZmODZmYTUzNmQ2OGRkNzE4MTgifQ.bRfinjIiBjiFXXCZru1Nhw_0l8RD7Zf7FWOhv1Aw4W8')
179175
// continue to next interceptor
180-
next(response => { // 在响应之后传给then之前对response进行修改和逻辑判断。对于token已过期的判断,就添加在此处,页面中任何一次http请求都会先调用此处方法
181-
response.body = '...'
176+
next(function (response) { // 在响应之后传给then之前对response进行修改和逻辑判断。对于token已过期的判断,就添加在此处,页面中任何一次http请求都会先调用此处方法
177+
// response.body = '...'
182178
return response
183179
})
184180
})
185181

186182
new Vue({
187183
store,
188184
router,
185+
http: {
186+
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
187+
},
189188
render: h => h(App)
190189
}).$mount('#app-box')

0 commit comments

Comments
 (0)