@xilonglab/vue-main 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/page/login.vue +2 -2
- package/dist/page/setting.vue +1 -1
- package/package.json +1 -1
- package/packages/index.js +14 -29
package/dist/page/login.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import
|
|
2
|
+
import { Session } from '#/system'
|
|
3
3
|
import { useRouter } from "vue-router"
|
|
4
4
|
import { inject, reactive, ref } from 'vue'
|
|
5
5
|
import gsap from 'gsap'
|
|
@@ -62,7 +62,7 @@ async function login() {
|
|
|
62
62
|
try {
|
|
63
63
|
if (!await refs.form.value.validate()) return
|
|
64
64
|
Cookie.set()
|
|
65
|
-
const data = await
|
|
65
|
+
const data = await Session.resource.post(form, '')
|
|
66
66
|
|
|
67
67
|
if (data.token) {
|
|
68
68
|
await showSuccessAnimation()
|
package/dist/page/setting.vue
CHANGED
package/package.json
CHANGED
package/packages/index.js
CHANGED
|
@@ -1,37 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
const modules = import.meta.glob('./**/*.vue');
|
|
1
|
+
const components = import.meta.glob('./**/*.vue', { eager: true });
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const install = async (app) => {
|
|
11
|
-
for (const path in modules) {
|
|
12
|
-
const mod = await modules[path](); // 浏览器端动态导入
|
|
13
|
-
const comp = mod.default;
|
|
14
|
-
const name = getComponentName(path, comp);
|
|
15
|
-
if (!name) {
|
|
16
|
-
console.warn(`组件注册失败: ${path} 缺少 name`);
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
app.component(name, comp);
|
|
20
|
-
}
|
|
3
|
+
const install = (app) => {
|
|
4
|
+
Object.values(components).forEach((component) => {
|
|
5
|
+
app.component(component.default.name, component.default);
|
|
6
|
+
});
|
|
21
7
|
};
|
|
22
8
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
9
|
+
let componentsJson = {}
|
|
10
|
+
for (const key in components) {
|
|
11
|
+
const component = components[key].default
|
|
12
|
+
const componentName = component.name
|
|
13
|
+
component.install = function (app) {
|
|
14
|
+
app.component(componentName, component)
|
|
15
|
+
}
|
|
16
|
+
componentsJson[componentName] = component
|
|
32
17
|
}
|
|
33
18
|
|
|
34
19
|
export default {
|
|
35
20
|
install,
|
|
36
21
|
...componentsJson
|
|
37
|
-
}
|
|
22
|
+
}
|