Skip to content

Commit 6d1969d

Browse files
committed
部署前提交
1 parent 0b51cf5 commit 6d1969d

File tree

3 files changed

+131
-135
lines changed

3 files changed

+131
-135
lines changed

config/index.js

Lines changed: 49 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,61 @@
55
const path = require('path')
66

77
module.exports = {
8-
dev: {
8+
dev: {
9+
// Paths
10+
assetsSubDirectory: 'static',
11+
assetsPublicPath: '/',
12+
proxyTable: {},
13+
// Various Dev Server settings
14+
host: 'localhost', // can be overwritten by process.env.HOST
15+
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
16+
autoOpenBrowser: false,
17+
errorOverlay: true,
18+
notifyOnErrors: true,
19+
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
20+
/**
21+
* Source Maps
22+
*/
923

10-
// Paths
11-
assetsSubDirectory: 'static',
12-
assetsPublicPath: '/',
13-
proxyTable: {},
24+
// https://webpack.js.org/configuration/devtool/#development
25+
devtool: 'cheap-module-eval-source-map',
1426

15-
// Various Dev Server settings
16-
host: 'localhost', // can be overwritten by process.env.HOST
17-
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18-
autoOpenBrowser: false,
19-
errorOverlay: true,
20-
notifyOnErrors: true,
21-
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
27+
// If you have problems debugging vue-files in devtools,
28+
// set this to false - it *may* help
29+
// https://vue-loader.vuejs.org/en/options.html#cachebusting
30+
cacheBusting: true,
2231

23-
24-
/**
25-
* Source Maps
26-
*/
32+
cssSourceMap: true
33+
},
2734

28-
// https://webpack.js.org/configuration/devtool/#development
29-
devtool: 'cheap-module-eval-source-map',
35+
build: {
36+
// Template for index.html
37+
index: path.resolve(__dirname, '../dist/index.html'),
3038

31-
// If you have problems debugging vue-files in devtools,
32-
// set this to false - it *may* help
33-
// https://vue-loader.vuejs.org/en/options.html#cachebusting
34-
cacheBusting: true,
39+
// Paths
40+
assetsRoot: path.resolve(__dirname, '../dist'),
41+
assetsSubDirectory: 'static',
42+
assetsPublicPath: '/',
3543

36-
cssSourceMap: true
37-
},
44+
/**
45+
* Source Maps
46+
*/
3847

39-
build: {
40-
// Template for index.html
41-
index: path.resolve(__dirname, '../dist/index.html'),
48+
productionSourceMap: true,
49+
// https://webpack.js.org/configuration/devtool/#production
50+
devtool: '#source-map',
4251

43-
// Paths
44-
assetsRoot: path.resolve(__dirname, '../dist'),
45-
assetsSubDirectory: 'static',
46-
assetsPublicPath: '/',
52+
// Gzip off by default as many popular static hosts such as
53+
// Surge or Netlify already gzip all static assets for you.
54+
// Before setting to `true`, make sure to:
55+
// npm install --save-dev compression-webpack-plugin
56+
productionGzip: false,
57+
productionGzipExtensions: ['js', 'css'],
4758

48-
/**
49-
* Source Maps
50-
*/
51-
52-
productionSourceMap: true,
53-
// https://webpack.js.org/configuration/devtool/#production
54-
devtool: '#source-map',
55-
56-
// Gzip off by default as many popular static hosts such as
57-
// Surge or Netlify already gzip all static assets for you.
58-
// Before setting to `true`, make sure to:
59-
// npm install --save-dev compression-webpack-plugin
60-
productionGzip: false,
61-
productionGzipExtensions: ['js', 'css'],
62-
63-
// Run the build command with an extra argument to
64-
// View the bundle analyzer report after build finishes:
65-
// `npm run build --report`
66-
// Set to `true` or `false` to always turn it on or off
67-
bundleAnalyzerReport: process.env.npm_config_report
68-
}
69-
}
59+
// Run the build command with an extra argument to
60+
// View the bundle analyzer report after build finishes:
61+
// `npm run build --report`
62+
// Set to `true` or `false` to always turn it on or off
63+
bundleAnalyzerReport: process.env.npm_config_report
64+
}
65+
}

package.json

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
11
{
2-
"name": "blog",
3-
"version": "1.0.0",
4-
"description": "A Vue.js project",
5-
"author": "joshzs <785424799@qq.com>",
6-
"private": true,
7-
"scripts": {
8-
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9-
"start": "npm run dev",
10-
"unit": "jest --config test/unit/jest.conf.js --coverage",
11-
"e2e": "node test/e2e/runner.js",
12-
"test": "npm run unit && npm run e2e",
13-
"build": "node build/build.js"
14-
},
15-
"dependencies": {
16-
"axios": "^0.19.2",
17-
"qs": "^6.9.4",
18-
"vue": "^2.5.2",
19-
"vue-cookies": "^1.7.0",
20-
"vue-router": "^3.0.1"
21-
},
22-
"devDependencies": {
23-
"autoprefixer": "^7.1.2",
24-
"babel-core": "^6.22.1",
25-
"babel-helper-vue-jsx-merge-props": "^2.0.3",
26-
"babel-jest": "^21.0.2",
27-
"babel-loader": "^7.1.1",
28-
"babel-plugin-dynamic-import-node": "^1.2.0",
29-
"babel-plugin-syntax-jsx": "^6.18.0",
30-
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
31-
"babel-plugin-transform-runtime": "^6.22.0",
32-
"babel-plugin-transform-vue-jsx": "^3.5.0",
33-
"babel-preset-env": "^1.3.2",
34-
"babel-preset-stage-2": "^6.22.0",
35-
"babel-register": "^6.22.0",
36-
"chalk": "^2.0.1",
37-
"chromedriver": "^2.27.2",
38-
"copy-webpack-plugin": "^4.0.1",
39-
"cross-spawn": "^5.0.1",
40-
"css-loader": "^0.28.0",
41-
"extract-text-webpack-plugin": "^3.0.0",
42-
"file-loader": "^1.1.4",
43-
"friendly-errors-webpack-plugin": "^1.6.1",
44-
"html-webpack-plugin": "^2.30.1",
45-
"jest": "^22.0.4",
46-
"jest-serializer-vue": "^0.3.0",
47-
"nightwatch": "^0.9.12",
48-
"node-notifier": "^5.1.2",
49-
"optimize-css-assets-webpack-plugin": "^3.2.0",
50-
"ora": "^1.2.0",
51-
"portfinder": "^1.0.13",
52-
"postcss-import": "^11.0.0",
53-
"postcss-loader": "^2.0.8",
54-
"postcss-url": "^7.2.1",
55-
"rimraf": "^2.6.0",
56-
"selenium-server": "^3.0.1",
57-
"semver": "^5.3.0",
58-
"shelljs": "^0.7.6",
59-
"uglifyjs-webpack-plugin": "^1.1.1",
60-
"url-loader": "^0.5.8",
61-
"vue-jest": "^1.0.2",
62-
"vue-loader": "^13.3.0",
63-
"vue-style-loader": "^3.0.1",
64-
"vue-template-compiler": "^2.5.2",
65-
"webpack": "^3.6.0",
66-
"webpack-bundle-analyzer": "^2.9.0",
67-
"webpack-dev-server": "^2.9.1",
68-
"webpack-merge": "^4.1.0"
69-
},
70-
"engines": {
71-
"node": ">= 6.0.0",
72-
"npm": ">= 3.0.0"
73-
},
74-
"browserslist": [
75-
"> 1%",
76-
"last 2 versions",
77-
"not ie <= 8"
78-
]
79-
}
2+
"name": "blog",
3+
"version": "1.0.0",
4+
"description": "A Vue.js project",
5+
"author": "joshzs <785424799@qq.com>",
6+
"private": true,
7+
"scripts": {
8+
"dev": "webpack-dev-server --open --inline --progress --hot --config build/webpack.dev.conf.js",
9+
"start": "npm run dev",
10+
"unit": "jest --config test/unit/jest.conf.js --coverage",
11+
"e2e": "node test/e2e/runner.js",
12+
"test": "npm run unit && npm run e2e",
13+
"build": "node build/build.js"
14+
},
15+
"dependencies": {
16+
"axios": "^0.19.2",
17+
"qs": "^6.9.4",
18+
"vue": "^2.5.2",
19+
"vue-cookies": "^1.7.0",
20+
"vue-router": "^3.0.1"
21+
},
22+
"devDependencies": {
23+
"autoprefixer": "^7.1.2",
24+
"babel-core": "^6.22.1",
25+
"babel-helper-vue-jsx-merge-props": "^2.0.3",
26+
"babel-jest": "^21.0.2",
27+
"babel-loader": "^7.1.1",
28+
"babel-plugin-dynamic-import-node": "^1.2.0",
29+
"babel-plugin-syntax-jsx": "^6.18.0",
30+
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
31+
"babel-plugin-transform-runtime": "^6.22.0",
32+
"babel-plugin-transform-vue-jsx": "^3.5.0",
33+
"babel-preset-env": "^1.3.2",
34+
"babel-preset-stage-2": "^6.22.0",
35+
"babel-register": "^6.22.0",
36+
"chalk": "^2.0.1",
37+
"chromedriver": "^2.27.2",
38+
"copy-webpack-plugin": "^4.0.1",
39+
"cross-spawn": "^5.0.1",
40+
"css-loader": "^0.28.0",
41+
"extract-text-webpack-plugin": "^3.0.0",
42+
"file-loader": "^1.1.4",
43+
"friendly-errors-webpack-plugin": "^1.6.1",
44+
"html-webpack-plugin": "^2.30.1",
45+
"jest": "^22.0.4",
46+
"jest-serializer-vue": "^0.3.0",
47+
"nightwatch": "^0.9.12",
48+
"node-notifier": "^5.1.2",
49+
"optimize-css-assets-webpack-plugin": "^3.2.0",
50+
"ora": "^1.2.0",
51+
"portfinder": "^1.0.13",
52+
"postcss-import": "^11.0.0",
53+
"postcss-loader": "^2.0.8",
54+
"postcss-url": "^7.2.1",
55+
"rimraf": "^2.6.0",
56+
"selenium-server": "^3.0.1",
57+
"semver": "^5.3.0",
58+
"shelljs": "^0.7.6",
59+
"uglifyjs-webpack-plugin": "^1.1.1",
60+
"url-loader": "^0.5.8",
61+
"vue-jest": "^1.0.2",
62+
"vue-loader": "^13.3.0",
63+
"vue-style-loader": "^3.0.1",
64+
"vue-template-compiler": "^2.5.2",
65+
"webpack": "^3.6.0",
66+
"webpack-bundle-analyzer": "^2.9.0",
67+
"webpack-dev-server": "^2.9.1",
68+
"webpack-merge": "^4.1.0"
69+
},
70+
"engines": {
71+
"node": ">= 6.0.0",
72+
"npm": ">= 3.0.0"
73+
},
74+
"browserslist": [
75+
"> 1%",
76+
"last 2 versions",
77+
"not ie <= 8"
78+
]
79+
}

src/utils/http.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ export default {
2121
//在请求发送前拦截后可进行一定处理后再发送到后台,例如data,header
2222

2323

24-
// config.params = { 'token': cookies.get("token") }
25-
//返回到axios内部
24+
config.params = { 'token': "123" }
25+
config.headers['token'] = "123"
26+
//返回到axios内部
2627
return config
2728
},
2829
err => {
@@ -49,7 +50,7 @@ export default {
4950
if (!window.$http) {
5051
this.init()
5152
}
52-
console.log("33")
53+
5354
return new Promise((resolve, reject) => {
5455
$http.get(url, {
5556
params: params
@@ -61,7 +62,6 @@ export default {
6162
if (!window.$http) {
6263
this.init()
6364
}
64-
console.log("33")
6565
return new Promise((resolve, reject) => {
6666
$http.post(url, qs.stringify(params)).then(res => {
6767
resolve(res.data)

0 commit comments

Comments
 (0)