神仙都没用 1 年間 前
コミット
7e40322207

+ 9 - 9
pnpm-lock.yaml

@@ -6,8 +6,8 @@ settings:
 
 dependencies:
   '@cool-vue/crud':
-    specifier: ^7.1.26
-    version: 7.1.26(typescript@5.4.2)
+    specifier: ^7.1.27
+    version: 7.1.27(typescript@5.4.2)
   '@element-plus/icons-vue':
     specifier: ^2.3.1
     version: 2.3.1(vue@3.4.15)
@@ -86,8 +86,8 @@ dependencies:
 
 devDependencies:
   '@cool-vue/vite-plugin':
-    specifier: ^7.1.6
-    version: 7.1.6
+    specifier: ^7.1.7
+    version: 7.1.7
   '@rushstack/eslint-patch':
     specifier: ^1.8.0
     version: 1.8.0
@@ -529,8 +529,8 @@ packages:
       '@babel/helper-validator-identifier': 7.24.7
       to-fast-properties: 2.0.0
 
-  /@cool-vue/crud@7.1.26(typescript@5.4.2):
-    resolution: {integrity: sha512-v8X32My5iGqt048FWkthMxVdOY5kTf2MVLIHyr8NoCEbSFN4vzDSbLE6TWgQMHd62GCDxlB9e/QQGCc55CZGcA==}
+  /@cool-vue/crud@7.1.27(typescript@5.4.2):
+    resolution: {integrity: sha512-S/Z6Q4Aw3lshVevpizQ5Z4DarXJdkBTEZFSOlLEnBkhzBLGFBzLiNI42vkm9Ru0mcV+WNic5RJ8C99/LUhC/6g==}
     dependencies:
       '@element-plus/icons-vue': 2.3.1(vue@3.4.15)
       array.prototype.flat: 1.3.2
@@ -544,8 +544,8 @@ packages:
       - typescript
     dev: false
 
-  /@cool-vue/vite-plugin@7.1.6:
-    resolution: {integrity: sha512-nKh0YQd6yP6aRwOcPOAxN81+HJ+XR9NrF5KKaegK36FLrcHW2gnf2+qtqnbd+SFkm6BTM0iojPedW6cYU0aREg==}
+  /@cool-vue/vite-plugin@7.1.7:
+    resolution: {integrity: sha512-pSTXigNa2HrW7ps4EFEqI18KzZh19WEoDZlV8l84DDOJHV4jjaeSKbBpur/aCWBIogeZOaMCiboCCytfSUGYCQ==}
     dependencies:
       '@vue/compiler-sfc': 3.4.34
       axios: 1.7.2
@@ -1388,7 +1388,7 @@ packages:
       '@babel/helper-module-imports': 7.22.15
       '@babel/helper-plugin-utils': 7.24.8
       '@babel/parser': 7.24.8
-      '@vue/compiler-sfc': 3.4.15
+      '@vue/compiler-sfc': 3.4.34
     dev: true
 
   /@vue/compiler-core@3.4.15:

+ 31 - 34
src/cool/bootstrap/module.ts

@@ -1,5 +1,5 @@
 import { type App, type Directive } from "vue";
-import { assign, chain, isFunction } from "lodash-es";
+import { assign, isFunction, orderBy } from "lodash-es";
 import { filename } from "../utils";
 import { module } from "../module";
 import { hmr } from "../hooks";
@@ -63,44 +63,41 @@ for (const i in files) {
 
 // 创建
 export function createModule(app: App) {
-	const list = chain(module.list)
-		.map((e) => {
-			const d = isFunction(e.value) ? e.value(app) : e.value;
+	// 排序
+	module.list.forEach((e) => {
+		const d = isFunction(e.value) ? e.value(app) : e.value;
 
-			if (d) {
-				assign(e, d);
-			}
+		if (d) {
+			assign(e, d);
+		}
 
-			if (!d.order) {
-				e.order = 0;
-			}
+		if (!d.order) {
+			e.order = 0;
+		}
+	});
 
-			return e;
-		})
-		.orderBy("order", "desc")
-		.map((e) => {
-			// 初始化
-			e.install?.(app, e.options);
-
-			// 注册组件
-			e.components?.forEach(async (c) => {
-				// @ts-ignore
-				const v = await (isFunction(c) ? c() : c);
-				const n = v.default || v;
-
-				if (n.name) {
-					app.component(n.name, n);
-				}
-			});
+	const list = orderBy(module.list, "order", "desc").map((e) => {
+		// 初始化
+		e.install?.(app, e.options);
 
-			// 注册指令
-			e.directives?.forEach((v) => {
-				app.directive(v.name, v.value);
-			});
+		// 注册组件
+		e.components?.forEach(async (c) => {
+			// @ts-ignore
+			const v = await (isFunction(c) ? c() : c);
+			const n = v.default || v;
+
+			if (n.name) {
+				app.component(n.name, n);
+			}
+		});
+
+		// 注册指令
+		e.directives?.forEach((v) => {
+			app.directive(v.name, v.value);
+		});
 
-			return e;
-		})
-		.value();
+		return e;
+	});
 
 	return {
 		// 模块列表

+ 14 - 10
src/modules/base/pages/login/components/pic-captcha.vue

@@ -35,18 +35,22 @@ async function refresh() {
 			color: "#2c3142"
 		})
 		.then(({ captchaId, data }) => {
-			if (data.includes(";base64,")) {
-				base64.value = data;
+			if (data) {
+				if (data.includes(";base64,")) {
+					base64.value = data;
+				} else {
+					svg.value = data;
+				}
+
+				emit("update:modelValue", captchaId);
+				emit("change", {
+					base64,
+					svg,
+					captchaId
+				});
 			} else {
-				svg.value = data;
+				ElMessage.error("验证码获取失败");
 			}
-
-			emit("update:modelValue", captchaId);
-			emit("change", {
-				base64,
-				svg,
-				captchaId
-			});
 		})
 		.catch((err) => {
 			ElMessage.error(err.message);

ファイルの差分が大きいため隠しています
+ 0 - 0
stats.html


+ 1 - 2
vite.config.mts

@@ -56,9 +56,8 @@ export default ({ mode }: ConfigEnv): UserConfig => {
 			}
 		},
 		esbuild: {
-			drop: isDev ? [] : ["console", "debugger"]
+			// drop: isDev ? [] : ["console", "debugger"]
 		},
-
 		build: {
 			minify: "esbuild",
 			// terserOptions: {

ファイルの差分が大きいため隠しています
+ 105 - 0
vite.config.mts.timestamp-1722222863909-a8e85574a7f33.mjs


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません