zhuangyunsheng 1 month ago
parent
commit
b813581bd4
9 changed files with 201 additions and 150 deletions
  1. 1 0
      .env
  2. 1 3
      .env.production
  3. 28 0
      .eslintrc.cjs
  4. 1 1
      LICENSE
  5. 2 4
      babel.config.js
  6. 2 24
      package.json
  7. 0 11
      public/config.js
  8. 166 101
      public/index.html
  9. 0 6
      src/config/index.js

+ 1 - 0
.env

@@ -1 +1,2 @@
+# 标题
 VUE_APP_TITLE = EasyDo运营中心

+ 1 - 3
.env.production

@@ -2,6 +2,4 @@
 NODE_ENV = production
 
 # 接口地址
-VUE_APP_ZEROAPI_BASEURL = /opsWeb
-VUE_APP_API_BASEURL = /opsWeb
-VUE_APP_OPS_BASEURL = /opsWeb
+VUE_APP_API_BASEURL = 

+ 28 - 0
.eslintrc.cjs

@@ -0,0 +1,28 @@
+module.exports = {
+    root: true,
+    env: {
+        node: true,
+        browser: true,
+        es2021: true
+    },
+    parser: "vue-eslint-parser", // 兼容 Vue 模板
+    parserOptions: {
+        parser: "@babel/eslint-parser", // 兼容现代 JS 语法
+        ecmaVersion: "latest", // 解析 ES2021 + 新语法
+        sourceType: "module", // 解析前端的 import/export 语法
+        babelOptions: {
+            configFile: "./babel.config.js" 
+        }
+    },
+    extends: [
+        "plugin:vue/vue3-essential",
+        "./.eslintrc-auto-import.json"
+    ],
+    rules: {
+        indent: 0,
+        "no-tabs": 0,
+        "no-mixed-spaces-and-tabs": 0,
+        "vue/no-unused-components": 0,
+        "vue/multi-word-component-names": 0
+    }
+}

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2021 sakuya
+Copyright (c) 2021 Easydo
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 2 - 4
babel.config.js

@@ -1,5 +1,3 @@
 module.exports = {
-  presets: [
-    '@vue/cli-plugin-babel/preset'
-  ]
-}
+    presets: ["@vue/cli-plugin-babel/preset"]
+}

+ 2 - 24
package.json

@@ -48,33 +48,11 @@
         "@vue/cli-service": "5.0.8",
         "eslint": "8.35.0",
         "eslint-plugin-vue": "9.9.0",
-        "sass": "1.58.3",
-        "sass-loader": "10.1.1",
+        "sass": "^1.69.5",
+        "sass-loader": "^12.6.0",
         "unplugin-auto-import": "19.0.0",
         "unplugin-vue-components": "^28.0.0"
     },
-    "eslintConfig": {
-        "root": true,
-        "env": {
-            "node": true
-        },
-        "globals": {
-            "APP_CONFIG": true
-        },
-        "extends": [
-            "plugin:vue/vue3-essential"
-        ],
-        "parserOptions": {
-            "parser": "@babel/eslint-parser"
-        },
-        "rules": {
-            "indent": 0,
-            "no-tabs": 0,
-            "no-mixed-spaces-and-tabs": 0,
-            "vue/no-unused-components": 0,
-            "vue/multi-word-component-names": 0
-        }
-    },
     "browserslist": [
         "> 1%",
         "last 2 versions",

+ 0 - 11
public/config.js

@@ -1,11 +0,0 @@
-
-// 此文件非必要,在生产环境下此文件配置可覆盖运行配置,开发环境下不起效
-// 详情见 src/config/index.js
-
-const APP_CONFIG = {
-	//标题
-	//APP_NAME: "SCUI",
-
-	//接口地址,如遇跨域需使用nginx代理
-	//API_URL: "https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api"
-}

+ 166 - 101
public/index.html

@@ -1,107 +1,172 @@
 <!DOCTYPE html>
 <html lang="en">
-	<head>
-		<meta charset="utf-8">
-		<meta http-equiv="X-UA-Compatible" content="IE=edge">
-		<meta name="viewport" content="width=device-width,initial-scale=1.0">
-		<link rel="icon" href="<%= BASE_URL %>favicon.ico">
-		<title><%= VUE_APP_TITLE %></title>
-		<script type="text/javascript">
-			document.write("<script src='config.js?"+new Date().getTime()+"'><\/script>");
-		</script>
-	</head>
-	<body data-layout="header">
-		<noscript>
-			<strong>We're sorry but <%= VUE_APP_TITLE %> doesn't work properly without JavaScript
-				enabled. Please enable it to continue.</strong>
-		</noscript>
-		<script type="text/javascript">
-            localStorage.getItem("APP_DARK") && document.documentElement.classList.add("dark");
-		</script>
-		<div id="app" class="aminui">
-			<div class="app-loading">
-				<div class="app-loading__logo">
-					<img src="img/logo.png"/>
-				</div>
-				<div class="app-loading__loader"></div>
-				<div class="app-loading__title"><%= VUE_APP_TITLE %></div>
-			</div>
-			<style>
-				.app-loading {position: absolute;top:0px;left:0px;right:0px;bottom:0px;display: flex;justify-content: center;align-items: center;flex-direction: column;background: #fff;}
-				.app-loading__logo {margin-bottom: 30px;}
-				.app-loading__logo img {width: 90px;vertical-align: bottom;}
-				.app-loading__loader {box-sizing: border-box;width: 35px;height: 35px;border: 5px solid transparent;border-top-color: #000;border-radius: 50%;animation: .5s loader linear infinite;position: relative;}
-				.app-loading__loader:before {box-sizing: border-box;content: "";display: block;width: inherit;height: inherit;position: absolute;top: -5px;left: -5px;border: 5px solid #ccc;border-radius: 50%;opacity: .5;}
-				.app-loading__title {font-size: 24px;color: #333;margin-top: 30px;}
-				.dark .app-loading {background: #222225;}
-				.dark .app-loading__loader {border-top-color: #fff;}
-				.dark .app-loading__title {color: #d0d0d0;}
-				@keyframes loader {
-				    0% {
-				        transform: rotate(0deg);
-				    }
-				    100% {
-				        transform: rotate(360deg);
-				    }
-				}
-			</style>
-		</div>
-		<!-- built files will be auto injected -->
-	</body>
-	<div id="versionCheck" style="display: none;position: absolute;z-index: 99;top:0;left:0;right:0;bottom:0;padding:40px;background:rgba(255,255,255,0.9);color: #333;">
-		<h2 style="line-height: 1;margin: 0;font-size: 24px;">当前使用的浏览器内核版本过低 :(</h2>
-		<p style="line-height: 1;margin: 0;font-size: 14px;margin-top: 20px;opacity: 0.8;">当前版本:<span id="versionCheck-type">--</span> <span id="versionCheck-version">--</span></p>
-		<p style="line-height: 1;margin: 0;font-size: 14px;margin-top: 10px;opacity: 0.8;">最低版本要求:Chrome 71+、Firefox 65+、Safari 12+、Edge 97+。</p>
-		<p style="line-height: 1;margin: 0;font-size: 14px;margin-top: 10px;opacity: 0.8;">请升级浏览器版本,或更换现代浏览器,如果你使用的是双核浏览器,请切换到极速/高速模式。</p>
-	</div>
-	<script type="text/javascript">
-	function getBrowerInfo(){
-		var userAgent = window.navigator.userAgent;
-		var browerInfo = {
-			type: "unknown",
-			version: "unknown",
-			userAgent: userAgent
-		};
-		if(document.documentMode){
-			browerInfo.type = "IE";
-			browerInfo.version = document.documentMode + "";
-		}else if(indexOf(userAgent, "Firefox")){
-			browerInfo.type = "Firefox";
-			browerInfo.version = userAgent.match(/Firefox\/([\d.]+)/)[1];
-		}else if(indexOf(userAgent, "Opera")){
-			browerInfo.type = "Opera";
-			browerInfo.version = userAgent.match(/Opera\/([\d.]+)/)[1];
-		}else if(indexOf(userAgent, "Edg")){
-			browerInfo.type = "Edg";
-			browerInfo.version = userAgent.match(/Edg\/([\d.]+)/)[1];
-		}else if(indexOf(userAgent, "Chrome")){
-			browerInfo.type = "Chrome";
-			browerInfo.version = userAgent.match(/Chrome\/([\d.]+)/)[1];
-		}else if(indexOf(userAgent, "Safari")){
-			browerInfo.type = "Safari";
-			browerInfo.version = userAgent.match(/Safari\/([\d.]+)/)[1];
-		}
-		return browerInfo;
-	}
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <title>
+        <%= VUE_APP_TITLE %>
+    </title>
+</head>
+
+<body data-layout="header">
+    <noscript>
+        <strong>We're sorry but <%= VUE_APP_TITLE %> doesn't work properly without JavaScript
+                enabled. Please enable it to continue.</strong>
+    </noscript>
+    <script type="text/javascript">
+        localStorage.getItem("APP_DARK") && document.documentElement.classList.add("dark");
+    </script>
+    <div id="app" class="aminui">
+        <div class="app-loading">
+            <div class="app-loading__logo">
+                <img src="<%= BASE_URL %>img/logo.png" />
+            </div>
+            <div class="app-loading__loader"></div>
+            <div class="app-loading__title">
+                <%= VUE_APP_TITLE %>
+            </div>
+        </div>
+        <style>
+            .app-loading {
+                position: absolute;
+                top: 0px;
+                left: 0px;
+                right: 0px;
+                bottom: 0px;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                flex-direction: column;
+                background: #fff;
+            }
+
+            .app-loading__logo {
+                margin-bottom: 30px;
+            }
+
+            .app-loading__logo img {
+                width: 90px;
+                vertical-align: bottom;
+            }
+
+            .app-loading__loader {
+                box-sizing: border-box;
+                width: 35px;
+                height: 35px;
+                border: 5px solid transparent;
+                border-top-color: #000;
+                border-radius: 50%;
+                animation: .5s loader linear infinite;
+                position: relative;
+            }
+
+            .app-loading__loader:before {
+                box-sizing: border-box;
+                content: "";
+                display: block;
+                width: inherit;
+                height: inherit;
+                position: absolute;
+                top: -5px;
+                left: -5px;
+                border: 5px solid #ccc;
+                border-radius: 50%;
+                opacity: .5;
+            }
+
+            .app-loading__title {
+                font-size: 24px;
+                color: #333;
+                margin-top: 30px;
+            }
+
+            .dark .app-loading {
+                background: #222225;
+            }
+
+            .dark .app-loading__loader {
+                border-top-color: #fff;
+            }
+
+            .dark .app-loading__title {
+                color: #d0d0d0;
+            }
+
+            @keyframes loader {
+                0% {
+                    transform: rotate(0deg);
+                }
+
+                100% {
+                    transform: rotate(360deg);
+                }
+            }
+        </style>
+    </div>
+    <!-- built files will be auto injected -->
+</body>
+<div id="versionCheck"
+    style="display: none;position: absolute;z-index: 99;top:0;left:0;right:0;bottom:0;padding:40px;background:rgba(255,255,255,0.9);color: #333;">
+    <h2 style="line-height: 1;margin: 0;font-size: 24px;">当前使用的浏览器内核版本过低 :(</h2>
+    <p style="line-height: 1;margin: 0;font-size: 14px;margin-top: 20px;opacity: 0.8;">当前版本:<span
+            id="versionCheck-type">--</span> <span id="versionCheck-version">--</span></p>
+    <p style="line-height: 1;margin: 0;font-size: 14px;margin-top: 10px;opacity: 0.8;">最低版本要求:Chrome 71+、Firefox
+        65+、Safari 12+、Edge 97+。</p>
+    <p style="line-height: 1;margin: 0;font-size: 14px;margin-top: 10px;opacity: 0.8;">
+        请升级浏览器版本,或更换现代浏览器,如果你使用的是双核浏览器,请切换到极速/高速模式。</p>
+</div>
+<script type="text/javascript">
+    function getBrowerInfo() {
+        var userAgent = window.navigator.userAgent;
+        var browerInfo = {
+            type: "unknown",
+            version: "unknown",
+            userAgent: userAgent
+        };
+        if (document.documentMode) {
+            browerInfo.type = "IE";
+            browerInfo.version = document.documentMode + "";
+        } else if (indexOf(userAgent, "Firefox")) {
+            browerInfo.type = "Firefox";
+            browerInfo.version = userAgent.match(/Firefox\/([\d.]+)/)[1];
+        } else if (indexOf(userAgent, "Opera")) {
+            browerInfo.type = "Opera";
+            browerInfo.version = userAgent.match(/Opera\/([\d.]+)/)[1];
+        } else if (indexOf(userAgent, "Edg")) {
+            browerInfo.type = "Edg";
+            browerInfo.version = userAgent.match(/Edg\/([\d.]+)/)[1];
+        } else if (indexOf(userAgent, "Chrome")) {
+            browerInfo.type = "Chrome";
+            browerInfo.version = userAgent.match(/Chrome\/([\d.]+)/)[1];
+        } else if (indexOf(userAgent, "Safari")) {
+            browerInfo.type = "Safari";
+            browerInfo.version = userAgent.match(/Safari\/([\d.]+)/)[1];
+        }
+        return browerInfo;
+    }
     function indexOf(userAgent, brower) {
         return userAgent.indexOf(brower) > -1;
     }
-	function isSatisfyBrower() {
-		var minVer = {
-			"Chrome": 71,
-			"Firefox": 65,
-			"Safari": 12,
-			"Edg": 97,
-			"IE": 999
-		}
-		var browerInfo = getBrowerInfo();
-		var materVer = browerInfo.version.split(".")[0];
+    function isSatisfyBrower() {
+        var minVer = {
+            "Chrome": 71,
+            "Firefox": 65,
+            "Safari": 12,
+            "Edg": 97,
+            "IE": 999
+        }
+        var browerInfo = getBrowerInfo();
+        var materVer = browerInfo.version.split(".")[0];
         return materVer >= minVer[browerInfo.type];
-	}
-	if (!isSatisfyBrower()) {
-		document.getElementById("versionCheck").style.display = "block";
-		document.getElementById("versionCheck-type").innerHTML = getBrowerInfo().type;
-		document.getElementById("versionCheck-version").innerHTML = getBrowerInfo().version;
-	}
-	</script>
-</html>
+    }
+    if (!isSatisfyBrower()) {
+        document.getElementById("versionCheck").style.display = "block";
+        document.getElementById("versionCheck-type").innerHTML = getBrowerInfo().type;
+        document.getElementById("versionCheck-version").innerHTML = getBrowerInfo().version;
+    }
+</script>
+
+</html>

+ 0 - 6
src/config/index.js

@@ -45,10 +45,4 @@ const DEFAULT_CONFIG = {
 	LS_ENCRYPTION_key: "2XNN4K8LC0ELVWN4"
 }
 
-// 如果生产模式,就合并动态的APP_CONFIG
-// public/config.js
-if(process.env.NODE_ENV === "production") {
-	Object.assign(DEFAULT_CONFIG, APP_CONFIG)
-}
-
 export default DEFAULT_CONFIG