@morningfast/platform 0.0.9 → 0.0.11
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/assets/main/style.css +4 -4
- package/dist/chunks/Login-BKuPkkY9.js +242 -0
- package/dist/chunks/{SystemConfig-C7yyDmB8.js → SystemConfig-DGZUwXWB.js} +1 -1
- package/dist/chunks/{main-DfxJwsLt.js → main-CA2I4UGE.js} +598 -549
- package/dist/chunks/{route-items-Du868zKV.js → route-items-CIUjZc6w.js} +83 -78
- package/dist/chunks/system-DZaKDrG6.js +160 -0
- package/dist/index.js +8 -8
- package/dist/main/index.d.ts +3 -0
- package/dist/main/layouts/components/AppBrandLogo.vue.d.ts +14 -0
- package/dist/main/stores/app.d.ts +1 -1
- package/dist/main.js +6 -6
- package/dist/sub.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/Login-BivuNuD7.js +0 -209
- package/dist/chunks/system-BbMsTIBR.js +0 -160
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MICRO_AUTH_EXPIRED_EVENT as e } from "./micro-contract.js";
|
|
2
|
-
import { a as t, c as n,
|
|
3
|
-
import { ApiError as
|
|
4
|
-
import { a as
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as
|
|
7
|
-
import { o as
|
|
8
|
-
import { a as
|
|
9
|
-
export {
|
|
2
|
+
import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./chunks/main-CA2I4UGE.js";
|
|
3
|
+
import { ApiError as f, RequestManager as p, createRequestClient as m, formatErrorMessage as h } from "./request.js";
|
|
4
|
+
import { a as g, i as _, n as v, r as y, t as b } from "./chunks/auth-C3RvRgcW.js";
|
|
5
|
+
import { i as x, n as S, r as C, t as w } from "./chunks/system-DZaKDrG6.js";
|
|
6
|
+
import { n as T, r as E, t as D } from "./chunks/route-items-CIUjZc6w.js";
|
|
7
|
+
import { o as O } from "./chunks/config-Cd-9BYBy.js";
|
|
8
|
+
import { a as k, c as A, d as j, i as M, l as N, n as P, o as F, r as I, s as L, t as R, u as z } from "./chunks/sub-D7y3UaHp.js";
|
|
9
|
+
export { f as ApiError, F as DEFAULT_SUB_APP_BASE, t as HOME_TAB_PATH, e as MICRO_AUTH_EXPIRED_EVENT, T as MicroAppView, p as RequestManager, L as SUB_APP_NAME, A as SUB_APP_THEME_CHANGE_EVENT, M as applySubAppTheme, l as configureMorningfastRequestClient, n as createApi, v as createMockLoginResult, y as createMockUserProfile, c as createMorningfastBaseRoutes, o as createMorningfastRouter, m as createRequestClient, D as createRoutesFromItems, z as createSubAppContext, k as createSubAppRouter, h as formatErrorMessage, S as getPersistedValue, a as http, u as mountMorningfastApp, I as mountSubApp, _ as normalizeLoginResult, g as normalizeUserProfile, C as removePersistedValue, d as requestManager, N as resolveSubAppBasePath, O as setDefaultAppConfigs, x as setPersistedValue, r as setupAuthExpiredHandler, j as subAppContextKey, E as useAppStore, b as useAuthStore, R as useRequestClient, i as useSortable, P as useSubAppContext, w as useSystemStore, s as useTabsStore };
|
package/dist/main/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export { createRoutesFromItems } from './router/route-items';
|
|
|
6
6
|
export type { AppRouteItem, RouteItem } from './router/route-items';
|
|
7
7
|
export { setDefaultAppConfigs, type AppConfigItem, } from './micro-apps/config';
|
|
8
8
|
export { mountMorningfastApp } from './app/create-app';
|
|
9
|
+
export { useSortable } from './composables/useSortable';
|
|
10
|
+
export type { UseSortableOptions } from './composables/useSortable';
|
|
11
|
+
export { getPersistedValue, removePersistedValue, setPersistedValue, } from './utils/persistence';
|
|
9
12
|
export { default as MicroAppView } from './pages/micro/MicroAppView.vue';
|
|
10
13
|
export type { MountedMorningfastAppContext, MountMorningfastAppContext, MountMorningfastAppOptions, } from './app/create-app';
|
|
11
14
|
export type { MorningfastAppConfig } from './app/runtime-config';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
src: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
textInverted?: boolean;
|
|
5
|
+
width?: string;
|
|
6
|
+
height?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
textInverted: boolean;
|
|
10
|
+
width: string;
|
|
11
|
+
height: string;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ThemeColorPosition, ThemeMode } from '../utils/theme';
|
|
2
|
-
export type LayoutMode = 'side' | 'top' | 'mix';
|
|
2
|
+
export type LayoutMode = 'default' | 'side' | 'top' | 'mix';
|
|
3
3
|
export type MenuSearchPlacement = 'header' | 'sidebar';
|
|
4
4
|
export declare const useAppStore: import('pinia').StoreDefinition<"app", Pick<{
|
|
5
5
|
closeSettings: () => void;
|
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e, c as t,
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as
|
|
5
|
-
import { o as
|
|
6
|
-
export {
|
|
1
|
+
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./chunks/main-CA2I4UGE.js";
|
|
2
|
+
import { a as d, i as f, n as p, r as m, t as h } from "./chunks/auth-C3RvRgcW.js";
|
|
3
|
+
import { i as g, n as _, r as v, t as y } from "./chunks/system-DZaKDrG6.js";
|
|
4
|
+
import { n as b, r as x, t as S } from "./chunks/route-items-CIUjZc6w.js";
|
|
5
|
+
import { o as C } from "./chunks/config-Cd-9BYBy.js";
|
|
6
|
+
export { e as HOME_TAB_PATH, b as MicroAppView, c as configureMorningfastRequestClient, t as createApi, p as createMockLoginResult, m as createMockUserProfile, s as createMorningfastBaseRoutes, a as createMorningfastRouter, S as createRoutesFromItems, _ as getPersistedValue, i as http, l as mountMorningfastApp, f as normalizeLoginResult, d as normalizeUserProfile, v as removePersistedValue, u as requestManager, C as setDefaultAppConfigs, g as setPersistedValue, n as setupAuthExpiredHandler, x as useAppStore, h as useAuthStore, r as useSortable, y as useSystemStore, o as useTabsStore };
|
package/dist/sub.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "./chunks/route-items-
|
|
1
|
+
import { t as e } from "./chunks/route-items-CIUjZc6w.js";
|
|
2
2
|
import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./chunks/sub-D7y3UaHp.js";
|
|
3
3
|
export { s as DEFAULT_SUB_APP_BASE, l as SUB_APP_NAME, n as SUB_APP_THEME_CHANGE_EVENT, i as applySubAppTheme, e as createRoutesFromItems, d as createSubAppContext, t as createSubAppRouter, c as mountSubApp, a as resolveSubAppBasePath, r as subAppContextKey, u as useRequestClient, o as useSubAppContext };
|
package/package.json
CHANGED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./auth-C3RvRgcW.js";
|
|
2
|
-
import { t } from "./system-BbMsTIBR.js";
|
|
3
|
-
import { t as n } from "./_plugin-vue_export-helper-DvRHjpsZ.js";
|
|
4
|
-
import { useRoute as r, useRouter as i } from "vue-router";
|
|
5
|
-
import { ElMessage as a } from "element-plus";
|
|
6
|
-
import { computed as o, createBlock as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, onBeforeUnmount as m, openBlock as h, reactive as g, ref as _, resolveComponent as v, toDisplayString as y, unref as b, withCtx as x, withKeys as S, withModifiers as C } from "vue";
|
|
7
|
-
import { Iphone as w, Lock as T, Message as E, User as ee } from "@element-plus/icons-vue";
|
|
8
|
-
//#region src/main/pages/auth/Login.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var D = { class: "login-page" }, O = { class: "login-page__panel" }, k = { class: "login-page__hero" }, A = ["src", "alt"], j = { class: "login-page__brand" }, M = ["src", "alt"], N = { class: "login-page__account" }, P = ["aria-label"], F = { class: "login-page__card-header" }, I = { class: "login-page__form-sheet" }, L = { class: "login-page__code-row" }, R = { class: "login-page__qr-sheet" }, z = /* @__PURE__ */ n(/* @__PURE__ */ f({
|
|
10
|
-
__name: "Login",
|
|
11
|
-
setup(n) {
|
|
12
|
-
let f = r(), z = i(), B = e(), V = t(), H = _("password"), U = _(!1), W = _(!1), G = _(!1), K = _(0), q, J = g({
|
|
13
|
-
phone: "13800000000",
|
|
14
|
-
password: "123456"
|
|
15
|
-
}), Y = g({
|
|
16
|
-
phone: "13800000000",
|
|
17
|
-
code: "246810"
|
|
18
|
-
}), X = o(() => K.value > 0 ? `${K.value}s 后重试` : "获取验证码");
|
|
19
|
-
function Z(e) {
|
|
20
|
-
return /^1[3-9]\d{9}$/.test(e.trim()) ? !0 : (a.warning("请输入正确的手机号"), !1);
|
|
21
|
-
}
|
|
22
|
-
async function Q() {
|
|
23
|
-
G.value || K.value > 0 || Z(Y.phone) && (G.value = !0, await new Promise((e) => setTimeout(e, 600)), G.value = !1, K.value = 60, a.success("验证码已发送,演示验证码 246810"), q = window.setInterval(() => {
|
|
24
|
-
--K.value, K.value <= 0 && (window.clearInterval(q), q = void 0);
|
|
25
|
-
}, 1e3));
|
|
26
|
-
}
|
|
27
|
-
async function $() {
|
|
28
|
-
let e = H.value === "password" ? J.phone : Y.phone;
|
|
29
|
-
if (!Z(e)) return;
|
|
30
|
-
if (H.value === "password" && !J.password) {
|
|
31
|
-
a.warning("请输入密码");
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (H.value === "sms" && Y.code.trim() !== "246810") {
|
|
35
|
-
a.warning("请输入正确的验证码");
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
W.value = !0;
|
|
39
|
-
try {
|
|
40
|
-
await B.login({
|
|
41
|
-
username: e.trim(),
|
|
42
|
-
password: H.value === "password" ? J.password : Y.code
|
|
43
|
-
});
|
|
44
|
-
} finally {
|
|
45
|
-
W.value = !1;
|
|
46
|
-
}
|
|
47
|
-
a.success("登录成功,已进入平台骨架页");
|
|
48
|
-
let t = typeof f.query.redirect == "string" ? f.query.redirect : "/";
|
|
49
|
-
z.replace(t);
|
|
50
|
-
}
|
|
51
|
-
return m(() => {
|
|
52
|
-
q && window.clearInterval(q);
|
|
53
|
-
}), (e, t) => {
|
|
54
|
-
let n = v("el-segmented"), r = v("el-icon"), i = v("el-input"), a = v("el-form-item"), o = v("el-button"), f = v("el-form"), m = v("el-card");
|
|
55
|
-
return h(), c("div", D, [l("div", O, [l("div", k, [l("img", {
|
|
56
|
-
src: b(V).loginBackground,
|
|
57
|
-
alt: b(V).systemName,
|
|
58
|
-
class: "login-page__visual"
|
|
59
|
-
}, null, 8, A), l("div", j, [l("img", {
|
|
60
|
-
src: b(V).logoCollapsed,
|
|
61
|
-
alt: b(V).systemName,
|
|
62
|
-
class: "login-page__brand-logo"
|
|
63
|
-
}, null, 8, M), l("span", null, y(b(V).systemName), 1)])]), l("section", N, [d(m, {
|
|
64
|
-
shadow: "never",
|
|
65
|
-
class: "login-page__card"
|
|
66
|
-
}, {
|
|
67
|
-
header: x(() => [l("div", F, [l("strong", null, y(U.value ? "扫码登录" : "账号登录"), 1), l("span", null, y(U.value ? "使用企业移动端扫码确认" : "请选择登录方式完成身份验证"), 1)])]),
|
|
68
|
-
default: x(() => [l("button", {
|
|
69
|
-
class: p(["login-page__qr-corner", { "is-open": U.value }]),
|
|
70
|
-
type: "button",
|
|
71
|
-
"aria-label": U.value ? "切换到手机号登录" : "切换到扫码登录",
|
|
72
|
-
onClick: t[0] ||= (e) => U.value = !U.value
|
|
73
|
-
}, [...t[8] ||= [l("span", { class: "login-page__qr-mini" }, null, -1)]], 10, P), l("div", {
|
|
74
|
-
class: p(["login-page__card-body", { "is-qr": U.value }]),
|
|
75
|
-
onKeydown: t[7] ||= S((e) => U.value = !1, ["esc"])
|
|
76
|
-
}, [l("div", I, [d(n, {
|
|
77
|
-
modelValue: H.value,
|
|
78
|
-
"onUpdate:modelValue": t[1] ||= (e) => H.value = e,
|
|
79
|
-
class: "login-page__mode",
|
|
80
|
-
options: [{
|
|
81
|
-
label: "手机号登录",
|
|
82
|
-
value: "password"
|
|
83
|
-
}, {
|
|
84
|
-
label: "验证码登录",
|
|
85
|
-
value: "sms"
|
|
86
|
-
}]
|
|
87
|
-
}, null, 8, ["modelValue"]), H.value === "password" ? (h(), s(f, {
|
|
88
|
-
key: 0,
|
|
89
|
-
"label-position": "top",
|
|
90
|
-
onSubmit: C($, ["prevent"])
|
|
91
|
-
}, {
|
|
92
|
-
default: x(() => [
|
|
93
|
-
d(a, { label: "手机号" }, {
|
|
94
|
-
default: x(() => [d(i, {
|
|
95
|
-
modelValue: J.phone,
|
|
96
|
-
"onUpdate:modelValue": t[2] ||= (e) => J.phone = e,
|
|
97
|
-
maxlength: "11",
|
|
98
|
-
placeholder: "请输入手机号"
|
|
99
|
-
}, {
|
|
100
|
-
prefix: x(() => [d(r, null, {
|
|
101
|
-
default: x(() => [d(b(w))]),
|
|
102
|
-
_: 1
|
|
103
|
-
})]),
|
|
104
|
-
_: 1
|
|
105
|
-
}, 8, ["modelValue"])]),
|
|
106
|
-
_: 1
|
|
107
|
-
}),
|
|
108
|
-
d(a, { label: "密码" }, {
|
|
109
|
-
default: x(() => [d(i, {
|
|
110
|
-
modelValue: J.password,
|
|
111
|
-
"onUpdate:modelValue": t[3] ||= (e) => J.password = e,
|
|
112
|
-
"show-password": "",
|
|
113
|
-
placeholder: "请输入密码"
|
|
114
|
-
}, {
|
|
115
|
-
prefix: x(() => [d(r, null, {
|
|
116
|
-
default: x(() => [d(b(T))]),
|
|
117
|
-
_: 1
|
|
118
|
-
})]),
|
|
119
|
-
_: 1
|
|
120
|
-
}, 8, ["modelValue"])]),
|
|
121
|
-
_: 1
|
|
122
|
-
}),
|
|
123
|
-
d(o, {
|
|
124
|
-
type: "primary",
|
|
125
|
-
class: "login-page__submit",
|
|
126
|
-
loading: W.value,
|
|
127
|
-
onClick: $
|
|
128
|
-
}, {
|
|
129
|
-
default: x(() => [...t[9] ||= [u(" 登录系统 ", -1)]]),
|
|
130
|
-
_: 1
|
|
131
|
-
}, 8, ["loading"])
|
|
132
|
-
]),
|
|
133
|
-
_: 1
|
|
134
|
-
})) : (h(), s(f, {
|
|
135
|
-
key: 1,
|
|
136
|
-
"label-position": "top",
|
|
137
|
-
onSubmit: C($, ["prevent"])
|
|
138
|
-
}, {
|
|
139
|
-
default: x(() => [
|
|
140
|
-
d(a, { label: "手机号" }, {
|
|
141
|
-
default: x(() => [d(i, {
|
|
142
|
-
modelValue: Y.phone,
|
|
143
|
-
"onUpdate:modelValue": t[4] ||= (e) => Y.phone = e,
|
|
144
|
-
maxlength: "11",
|
|
145
|
-
placeholder: "请输入手机号"
|
|
146
|
-
}, {
|
|
147
|
-
prefix: x(() => [d(r, null, {
|
|
148
|
-
default: x(() => [d(b(w))]),
|
|
149
|
-
_: 1
|
|
150
|
-
})]),
|
|
151
|
-
_: 1
|
|
152
|
-
}, 8, ["modelValue"])]),
|
|
153
|
-
_: 1
|
|
154
|
-
}),
|
|
155
|
-
d(a, { label: "验证码" }, {
|
|
156
|
-
default: x(() => [l("div", L, [d(i, {
|
|
157
|
-
modelValue: Y.code,
|
|
158
|
-
"onUpdate:modelValue": t[5] ||= (e) => Y.code = e,
|
|
159
|
-
maxlength: "6",
|
|
160
|
-
placeholder: "请输入验证码"
|
|
161
|
-
}, {
|
|
162
|
-
prefix: x(() => [d(r, null, {
|
|
163
|
-
default: x(() => [d(b(E))]),
|
|
164
|
-
_: 1
|
|
165
|
-
})]),
|
|
166
|
-
_: 1
|
|
167
|
-
}, 8, ["modelValue"]), d(o, {
|
|
168
|
-
disabled: K.value > 0,
|
|
169
|
-
loading: G.value,
|
|
170
|
-
onClick: Q
|
|
171
|
-
}, {
|
|
172
|
-
default: x(() => [u(y(X.value), 1)]),
|
|
173
|
-
_: 1
|
|
174
|
-
}, 8, ["disabled", "loading"])])]),
|
|
175
|
-
_: 1
|
|
176
|
-
}),
|
|
177
|
-
d(o, {
|
|
178
|
-
type: "primary",
|
|
179
|
-
class: "login-page__submit",
|
|
180
|
-
loading: W.value,
|
|
181
|
-
onClick: $
|
|
182
|
-
}, {
|
|
183
|
-
default: x(() => [...t[10] ||= [u(" 登录系统 ", -1)]]),
|
|
184
|
-
_: 1
|
|
185
|
-
}, 8, ["loading"])
|
|
186
|
-
]),
|
|
187
|
-
_: 1
|
|
188
|
-
}))]), l("div", R, [
|
|
189
|
-
t[12] ||= l("div", { class: "login-page__qr-box" }, "二维码", -1),
|
|
190
|
-
t[13] ||= l("strong", null, "移动端扫码登录", -1),
|
|
191
|
-
t[14] ||= l("p", null, "二维码每 2 分钟自动刷新", -1),
|
|
192
|
-
d(o, {
|
|
193
|
-
text: "",
|
|
194
|
-
onClick: t[6] ||= (e) => U.value = !1
|
|
195
|
-
}, {
|
|
196
|
-
default: x(() => [d(r, null, {
|
|
197
|
-
default: x(() => [d(b(ee))]),
|
|
198
|
-
_: 1
|
|
199
|
-
}), t[11] ||= u(" 使用手机号登录 ", -1)]),
|
|
200
|
-
_: 1
|
|
201
|
-
})
|
|
202
|
-
])], 34)]),
|
|
203
|
-
_: 1
|
|
204
|
-
})])])]);
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
}), [["__scopeId", "data-v-8e99a976"]]);
|
|
208
|
-
//#endregion
|
|
209
|
-
export { z as default };
|