diff --git a/config/index.js b/config/index.js
index 324e89c4843bfe9d1ba648c2ba415f5daed45483..f4ca898d4d6169313ff397c324962ea0a35383e6 100644
--- a/config/index.js
+++ b/config/index.js
@@ -1,85 +1,94 @@
-'use strict'
+"use strict";
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
-const path = require('path')
+const path = require("path");
module.exports = {
- dev: {
- // Paths
- assetsSubDirectory: 'static',
- assetsPublicPath: '/',
- proxyTable: {
- '/api': {
- target: 'http://yongma16.xyz', //后端接口地址
- ws: true, //接受websocket请求
- changeOrigin: true, //是否允许跨越
- chunkOrigins: true,
- pathRewrite: {
- '^/api': '' //重写,
- }
- }
+ dev: {
+ // Paths
+ assetsSubDirectory: "static",
+ assetsPublicPath: "/",
+ proxyTable: {
+ "/api/": {
+ target: "http://114.116.52.53/", //后端接口地址
+ ws: true, //接受websocket请求
+ changeOrigin: true, //是否允许跨越
+ chunkOrigins: true,
+ pathRewrite: {
+ "^/api": "", //重写,
},
+ },
+ "/ws_api/": {
+ target: "ws://114.116.52.53/",
+ ws: true, //接受websocket请求
+ changeOrigin: true, //是否允许跨越
+ chunkOrigins: true,
+ pathRewrite: {
+ "^/ws_api": "", //重写,
+ },
+ },
+ },
- // Various Dev Server settings
- host: 'localhost', // can be overwritten by process.env.HOST
- port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
- autoOpenBrowser: false,
- errorOverlay: true,
- notifyOnErrors: true,
- poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
+ // Various Dev Server settings
+ host: "localhost", // can be overwritten by process.env.HOST
+ port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+ autoOpenBrowser: false,
+ errorOverlay: true,
+ notifyOnErrors: true,
+ poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
- // Use Eslint Loader?
- // If true, your code will be linted during bundling and
- // linting errors and warnings will be shown in the console.
- useEslint: false,
- // If true, eslint errors and warnings will also be shown in the error overlay
- // in the browser.
- showEslintErrorsInOverlay: false,
+ // Use Eslint Loader?
+ // If true, your code will be linted during bundling and
+ // linting errors and warnings will be shown in the console.
+ useEslint: false,
+ // If true, eslint errors and warnings will also be shown in the error overlay
+ // in the browser.
+ showEslintErrorsInOverlay: false,
- /**
- * Source Maps
- */
+ /**
+ * Source Maps
+ */
- // https://webpack.js.org/configuration/devtool/#development
- devtool: 'cheap-module-eval-source-map',
+ // https://webpack.js.org/configuration/devtool/#development
+ devtool: "cheap-module-eval-source-map",
- // If you have problems debugging vue-files in devtools,
- // set this to false - it *may* help
- // https://vue-loader.vuejs.org/en/options.html#cachebusting
- cacheBusting: true,
+ // If you have problems debugging vue-files in devtools,
+ // set this to false - it *may* help
+ // https://vue-loader.vuejs.org/en/options.html#cachebusting
+ cacheBusting: true,
- cssSourceMap: true
- },
+ cssSourceMap: true,
+ },
- build: {
- // Template for index.html
- index: path.resolve(__dirname, '../dist/index.html'),
+ build: {
+ // Template for index.html
+ index: path.resolve(__dirname, "../dist/index.html"),
- // Paths
- assetsRoot: path.resolve(__dirname, '../dist'),
- assetsSubDirectory: 'static',
- assetsPublicPath: './',
+ // Paths
+ assetsRoot: path.resolve(__dirname, "../dist"),
+ assetsSubDirectory: "static",
+ assetsPublicPath: "./",
- /**
- * Source Maps
- */
+ /**
+ * Source Maps
+ */
- productionSourceMap: true,
- // https://webpack.js.org/configuration/devtool/#production
- devtool: '#source-map',
+ productionSourceMap: true,
+ // https://webpack.js.org/configuration/devtool/#production
+ devtool: "#source-map",
- // Gzip off by default as many popular static hosts such as
- // Surge or Netlify already gzip all static assets for you.
- // Before setting to `true`, make sure to:
- // npm install --save-dev compression-webpack-plugin
- productionGzip: false,
- productionGzipExtensions: ['js', 'css'],
+ // Gzip off by default as many popular static hosts such as
+ // Surge or Netlify already gzip all static assets for you.
+ // Before setting to `true`, make sure to:
+ // npm install --save-dev compression-webpack-plugin
+ productionGzip: false,
+ productionGzipExtensions: ["js", "css"],
- // Run the build command with an extra argument to
- // View the bundle analyzer report after build finishes:
- // `npm run build --report`
- // Set to `true` or `false` to always turn it on or off
- bundleAnalyzerReport: process.env.npm_config_report
- }
-}
+ // Run the build command with an extra argument to
+ // View the bundle analyzer report after build finishes:
+ // `npm run build --report`
+ // Set to `true` or `false` to always turn it on or off
+ bundleAnalyzerReport: process.env.npm_config_report,
+ },
+};
diff --git a/src/comment/ArticleComment.vue b/src/comment/ArticleComment.vue
index 08c2840eb348556ebea40752667d1eee57937d58..5ac597ab5676b306ee27f000844b0b61e5e115c2 100644
--- a/src/comment/ArticleComment.vue
+++ b/src/comment/ArticleComment.vue
@@ -45,7 +45,7 @@ export default {
return {
noneMsg: "还没人评论>_<",
msg: "评论区",
- baseurl: "http://114.116.52.53/comment/",
+ baseurl: "api",
// baseurl: "http://yongma16.xyz/comment/",
userImg: "",
username: "匿名",
@@ -97,7 +97,7 @@ export default {
};
console.log("获取评论id", params.articleId);
axios
- .post(that.baseurl + "get/", params)
+ .post(that.baseurl + "comment/get/", params)
.then((res) => {
try {
let resData = res.data;
@@ -141,7 +141,7 @@ export default {
content: content,
};
axios
- .post(that.baseurl + "post/", params)
+ .post(that.baseurl + "comment/post/", params)
.then((res) => {
that.articleCommit = null;
try {
diff --git a/src/components/Article.vue b/src/components/Article.vue
index 2dfeb00e0f8f575ed5d8242d74433a32f119c57c..56917f87030c8246be072f4bf27219abef3f11ce 100644
--- a/src/components/Article.vue
+++ b/src/components/Article.vue
@@ -224,7 +224,7 @@ export default {
data() {
return {
// baseurl: '/api/',
- baseurl: "http://114.116.52.53/",
+ baseurl: "/api/",
// baseurl: "http://yongma16.xyz/",
msg: "内容",
commmentSlogan: "评论区",
diff --git a/src/components/Csslearn.vue b/src/components/Csslearn.vue
index e0fb5c5febacbb580b66a8acea801d6aca2a0f29..29f0983655953a915f765561f66349967c4fe855 100644
--- a/src/components/Csslearn.vue
+++ b/src/components/Csslearn.vue
@@ -37,7 +37,7 @@ export default {
msg: "css练习:",
css_length: "",
// baseurl: 'http://127.0.0.1:1998',
- baseurl: "http://114.116.52.53/",
+ baseurl: "/api/",
// baseurl: "http://yongma16.xyz/",
css_title: [],
css_path: [],
diff --git a/src/components/Login.vue b/src/components/Login.vue
index 5ac9c156e1aaafae5bd0c651747be7a09dc89a6e..e2595ee1453c3471de3b81a6a86c88c767a3f59f 100644
--- a/src/components/Login.vue
+++ b/src/components/Login.vue
@@ -43,36 +43,36 @@