hwq 2 years ago
parent
commit
27efb6998a
3 changed files with 188 additions and 222 deletions
  1. 0 39
      .github/workflows/main.yml
  2. 12 11
      src/config/settings.js
  3. 176 172
      vue.config.js

+ 0 - 39
.github/workflows/main.yml

@@ -1,39 +0,0 @@
-name: CI
-
-on:
-  push:
-    branches: [ master ]
-
-jobs:
-  Build:
-    name: Build
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout Source
-        uses: actions/checkout@v2
-        with:
-          fetch-depth: 1
-      - name: Setup Node.js environment
-        uses: actions/setup-node@v1
-        with:
-          node-version: "12"
-      - name: Save & Restore Npm Package Cache
-        uses: actions/cache@v2
-        with:
-          path: ~/.npm
-          key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
-          restore-keys: |
-            ${{ runner.os }}-node-
-      - name: Install Dependencies
-        run: npm install
-      - name: Build
-        run: npm run build
-      - name: Deploy
-        run: |
-          cd dist
-          git init
-          git config user.name "${{ secrets.GIT_USER_NAME }}"
-          git config user.email "${{ secrets.GIT_USER_EMAIL }}"
-          git add .
-          git commit -m "deploy"
-          git push -f -q "https://${{ secrets.ACCESS_TOKEN }}@github.com/vue-admin-beautiful/vue-admin-beautiful-pro.git" master:gh-pages

+ 12 - 11
src/config/settings.js

@@ -1,23 +1,24 @@
 const apiUrl = {
   dev: {
-    INDEX_URL: "http://crm.frp.liuniu946.com", // 后端接口域名
+    INDEX_URL: "https://api.liuniukj.com", // 后端接口域名
     QINIU_UP: "https://upload-z2.qiniup.com", // 七牛上传域名
-    QINIU_URL: "http://irfapnlkzl.hn-bkt.clouddn.com", // 七牛空间访问域名
+    QINIU_URL: "http://up.liuniukj.com", // 七牛空间访问域名
     UPLOAD_URL: "https://upload.qianniao.vip/", // 项目上传域名
-    QINIU_KEY: "panghuji", // 七牛空间名称
+    QINIU_KEY: "niuliukj", // 七牛空间名称
     SAASTAG: "qianniaoSAASdev", // webSocket前缀
-    wsServer: "wss://api.qianniao.com:9501", // webSocket连结域名
+    wsServer: "wss://ql.frp.liuniu946.com:9501", // webSocket连结域名
   },
   master: {
-    INDEX_URL: "http://crm.frp.liuniu946.com",
+    INDEX_URL: "https://api.liuniukj.com",
     QINIU_UP: "https://upload-z2.qiniup.com",
-    QINIU_URL: "http://rfapnlkzl.hn-bkt.clouddn.com",
+    QINIU_URL: "http://up.liuniukj.com",
     UPLOAD_URL: "https://upload.qianniao.vip/",
-    QINIU_KEY: "panghuji",
+    QINIU_KEY: "niuliukj",
     SAASTAG: "qianniaoSAAS",
-    wsServer: "wss://api.qianniao.com:9501",
+    wsServer: "wss://ql.frp.liuniu946.com:9501",
   },
 };
+// 阿里空间上传
 const aliUpSetting = {
   region: "oss-cn-qingdao.aliyuncs.com",
   endpoint: "oss-cn-qingdao.aliyuncs.com",
@@ -31,7 +32,7 @@ const aliUpSetting = {
 // const Url = process.env.NODE_ENV === "development" ? apiUrl.dev : apiUrl.master;
 const Url = apiUrl.master;
 module.exports = {
-  // 是否是六牛科技标准系统
+  // 是否是千鸟云商标准系统
   isQN: true,
   //默认的接口地址 如果是开发环境和生产环境走dev
   apiUrl: Url,
@@ -53,13 +54,13 @@ module.exports = {
   //进行编译的依赖
   transpileDependencies: ["vue-echarts", "resize-detector"],
   //标题 (包括初次加载雪花屏的标题 页面的标题 浏览器的标题)
-  title: "六牛科技",
+  title: "千鸟云商",
   //标题分隔符
   titleSeparator: " - ",
   //标题是否反转 如果为false:"page - title",如果为ture:"title - page"
   titleReverse: false,
   //简写
-  abbreviation: "六牛科技",
+  abbreviation: "千鸟云商",
   //语言类型zh、en
   i18n: "zh",
   //开发环境端口号

+ 176 - 172
vue.config.js

@@ -4,27 +4,30 @@
  */
 const path = require("path");
 const {
-  baseURL,
-  publicPath,
-  assetsDir,
-  outputDir,
-  lintOnSave,
-  transpileDependencies,
-  title,
-  abbreviation,
-  devPort,
-  providePlugin,
-  build7z,
-  donation,
+	baseURL,
+	publicPath,
+	assetsDir,
+	outputDir,
+	lintOnSave,
+	transpileDependencies,
+	title,
+	abbreviation,
+	devPort,
+	providePlugin,
+	build7z,
+	donation,
 } = require("./src/config/settings");
 const {
-  webpackBarName,
-  webpackBanner,
-  donationConsole,
+	webpackBarName,
+	webpackBanner,
+	donationConsole,
 } = require("zx-layouts");
 
 if (donation) donationConsole();
-const { version, author } = require("./package.json");
+const {
+	version,
+	author
+} = require("./package.json");
 const Webpack = require("webpack");
 const WebpackBar = require("webpackbar");
 const FileManagerPlugin = require("filemanager-webpack-plugin");
@@ -39,171 +42,172 @@ process.env.VUE_APP_UPDATE_TIME = time;
 process.env.VUE_APP_VERSION = version;
 
 const resolve = (dir) => {
-  return path.join(__dirname, dir);
+	return path.join(__dirname, dir);
 };
 
 const mockServer = () => {
-  if (process.env.NODE_ENV === "development") {
-    return require("./mock/mockServer.js");
-  } else {
-    return "";
-  }
+	if (process.env.NODE_ENV === "development") {
+		return require("./mock/mockServer.js");
+	} else {
+		return "";
+	}
 };
 
 module.exports = {
-  publicPath,
-  assetsDir,
-  outputDir,
-  lintOnSave,
-  transpileDependencies,
-  devServer: {
-    hot: true,
-    port: devPort,
-    open: true,
-    noInfo: false,
-    overlay: {
-      warnings: true,
-      errors: true,
-    },
-    // 注释掉的地方是前端配置代理访问后端的示例
-    // proxy: {
-    //   [baseURL]: {
-    //     target: `http://你的后端接口地址`,
-    //     ws: true,
-    //     changeOrigin: true,
-    //     pathRewrite: {
-    //       ["^/" + baseURL]: "",
-    //     },
-    //   },
-    // },
-    after: mockServer(),
-  },
-  configureWebpack() {
-    return {
-      resolve: {
-        alias: {
-          "@": resolve("src"),
-          "*": resolve(""),
-        },
-      },
-      plugins: [
-        new Webpack.ProvidePlugin(providePlugin),
-        new WebpackBar({
-          name: webpackBarName,
-        }),
-      ],
-    };
-  },
-  chainWebpack(config) {
-    config.resolve.symlinks(true);
-    config.module
-      .rule("svg")
-      .exclude.add(resolve("src/icon/remixIcon"))
-      .add(resolve("src/icon/colorfulIcon"))
-      .end();
+	publicPath,
+	assetsDir,
+	outputDir,
+	lintOnSave,
+	transpileDependencies,
+	devServer: {
+		hot: true,
+		port: devPort,
+		open: true,
+		noInfo: false,
+		overlay: {
+			warnings: true,
+			errors: true,
+		},
+		// 注释掉的地方是前端配置代理访问后端的示例
+		proxy: {
+			'/api': {
+				target: `http://crm.frp.liuniu946.com`,
+				ws: true,
+				changeOrigin: true,
+				pathRewrite: {
+					"/api": "",
+				},
+			},
+		},
+		after: mockServer(),
+	},
+	configureWebpack() {
+		return {
+			resolve: {
+				alias: {
+					"@": resolve("src"),
+					"*": resolve(""),
+				},
+			},
+			plugins: [
+				new Webpack.ProvidePlugin(providePlugin),
+				new WebpackBar({
+					name: webpackBarName,
+				}),
+			],
+		};
+	},
+	chainWebpack(config) {
+		config.resolve.symlinks(true);
+		config.module
+			.rule("svg")
+			.exclude.add(resolve("src/icon/remixIcon"))
+			.add(resolve("src/icon/colorfulIcon"))
+			.end();
 
-    config.module
-      .rule("remixIcon")
-      .test(/\.svg$/)
-      .include.add(resolve("src/icon/remixIcon"))
-      .end()
-      .use("svg-sprite-loader")
-      .loader("svg-sprite-loader")
-      .options({ symbolId: "remix-icon-[name]" })
-      .end();
+		config.module
+			.rule("remixIcon")
+			.test(/\.svg$/)
+			.include.add(resolve("src/icon/remixIcon"))
+			.end()
+			.use("svg-sprite-loader")
+			.loader("svg-sprite-loader")
+			.options({
+				symbolId: "remix-icon-[name]"
+			})
+			.end();
 
-    config.module
-      .rule("colorfulIcon")
-      .test(/\.svg$/)
-      .include.add(resolve("src/icon/colorfulIcon"))
-      .end()
-      .use("svg-sprite-loader")
-      .loader("svg-sprite-loader")
-      .options({ symbolId: "colorful-icon-[name]" })
-      .end();
+		config.module
+			.rule("colorfulIcon")
+			.test(/\.svg$/)
+			.include.add(resolve("src/icon/colorfulIcon"))
+			.end()
+			.use("svg-sprite-loader")
+			.loader("svg-sprite-loader")
+			.options({
+				symbolId: "colorful-icon-[name]"
+			})
+			.end();
 
-    config.when(process.env.NODE_ENV === "development", (config) => {
-      config.devtool("source-map");
-    });
+		config.when(process.env.NODE_ENV === "development", (config) => {
+			config.devtool("source-map");
+		});
 
-    config.when(process.env.NODE_ENV !== "development", (config) => {
-      config.performance.set("hints", false);
-      config.devtool("none");
-      config.optimization.splitChunks({
-        chunks: "all",
-        cacheGroups: {
-          libs: {
-            name: "vue-admin-beautiful-pro-libs",
-            test: /[\\/]node_modules[\\/]/,
-            priority: 10,
-            chunks: "initial",
-          },
-          elementUI: {
-            name: "vue-admin-beautiful-pro-element-ui",
-            priority: 20,
-            test: /[\\/]node_modules[\\/]_?element-ui(.*)/,
-          },
-        },
-      });
-      config
-        .plugin("banner")
-        .use(Webpack.BannerPlugin, [`${webpackBanner}${time}`])
-        .end();
-      config
-        .plugin("compression")
-        .use(CompressionWebpackPlugin, [
-          {
-            filename: "[path].gz[query]",
-            algorithm: "gzip",
-            test: new RegExp(
-              "\\.(" + productionGzipExtensions.join("|") + ")$"
-            ),
-            threshold: 8192,
-            minRatio: 0.8,
-          },
-        ])
-        .end();
-    });
+		config.when(process.env.NODE_ENV !== "development", (config) => {
+			config.performance.set("hints", false);
+			config.devtool("none");
+			config.optimization.splitChunks({
+				chunks: "all",
+				cacheGroups: {
+					libs: {
+						name: "vue-admin-beautiful-pro-libs",
+						test: /[\\/]node_modules[\\/]/,
+						priority: 10,
+						chunks: "initial",
+					},
+					elementUI: {
+						name: "vue-admin-beautiful-pro-element-ui",
+						priority: 20,
+						test: /[\\/]node_modules[\\/]_?element-ui(.*)/,
+					},
+				},
+			});
+			config
+				.plugin("banner")
+				.use(Webpack.BannerPlugin, [`${webpackBanner}${time}`])
+				.end();
+			config
+				.plugin("compression")
+				.use(CompressionWebpackPlugin, [{
+					filename: "[path].gz[query]",
+					algorithm: "gzip",
+					test: new RegExp(
+						"\\.(" + productionGzipExtensions.join("|") + ")$"
+					),
+					threshold: 8192,
+					minRatio: 0.8,
+				}, ])
+				.end();
+		});
 
-    if (build7z) {
-      config.when(process.env.NODE_ENV === "production", (config) => {
-        config
-          .plugin("fileManager")
-          .use(FileManagerPlugin, [
-            {
-              onEnd: {
-                delete: [`./${outputDir}/video`, `./${outputDir}/data`],
-                archive: [
-                  {
-                    source: `./${outputDir}`,
-                    destination: `./${outputDir}/${abbreviation}_${outputDir}_${date}.7z`,
-                  },
-                ],
-              },
-            },
-          ])
-          .end();
-      });
-    }
-  },
-  runtimeCompiler: true,
-  productionSourceMap: false,
-  css: {
-    requireModuleExtension: true,
-    sourceMap: true,
-    loaderOptions: {
-      scss: {
-        additionalData(content, loaderContext) {
-          const { resourcePath, rootContext } = loaderContext;
-          const relativePath = path.relative(rootContext, resourcePath);
-          if (
-            relativePath.replace(/\\/g, "/") !== "src/config/variables.scss"
-          ) {
-            return '@import "~@/config/variables.scss";' + content;
-          }
-          return content;
-        },
-      },
-    },
-  },
+		if (build7z) {
+			config.when(process.env.NODE_ENV === "production", (config) => {
+				config
+					.plugin("fileManager")
+					.use(FileManagerPlugin, [{
+						onEnd: {
+							delete: [`./${outputDir}/video`, `./${outputDir}/data`],
+							archive: [{
+								source: `./${outputDir}`,
+								destination: `./${outputDir}/${abbreviation}_${outputDir}_${date}.7z`,
+							}, ],
+						},
+					}, ])
+					.end();
+			});
+		}
+	},
+	runtimeCompiler: true,
+	productionSourceMap: false,
+	css: {
+		requireModuleExtension: true,
+		sourceMap: true,
+		loaderOptions: {
+			scss: {
+				additionalData(content, loaderContext) {
+					const {
+						resourcePath,
+						rootContext
+					} = loaderContext;
+					const relativePath = path.relative(rootContext, resourcePath);
+					if (
+						relativePath.replace(/\\/g, "/") !== "src/config/variables.scss"
+					) {
+						return '@import "~@/config/variables.scss";' + content;
+					}
+					return content;
+				},
+			},
+		},
+	},
 };