jmash-core 0.0.97 → 0.0.98

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.
@@ -1,6 +1,6 @@
1
1
  import { _ as D } from "./picture-CBRsHLZl.mjs";
2
2
  import { defineComponent as E, ref as V, reactive as p, resolveComponent as c, openBlock as N, createElementBlock as $, Fragment as q, createVNode as e, withCtx as l, createTextVNode as u, toDisplayString as f, createElementVNode as _ } from "vue";
3
- import { p as B, b as I, q as R, v as S, t as z } from "./index-Bw3IdFvk.mjs";
3
+ import { q as B, c as w, t as R, v as S, w as z } from "./index-B5cWr2iD.mjs";
4
4
  const A = { class: "h-[40px]" }, M = { class: "image-slot" }, P = { class: "dialog-footer" }, H = /* @__PURE__ */ E({
5
5
  __name: "types",
6
6
  setup(T) {
@@ -28,7 +28,7 @@ const A = { class: "h-[40px]" }, M = { class: "image-slot" }, P = { class: "dial
28
28
  o.captchaId = a.captchaId, g.value = a.base64Image, i.visible = !0, o.captchaCode = "";
29
29
  });
30
30
  }
31
- function w() {
31
+ function I() {
32
32
  h();
33
33
  }
34
34
  const y = async () => {
@@ -37,7 +37,7 @@ const A = { class: "h-[40px]" }, M = { class: "image-slot" }, P = { class: "dial
37
37
  if (t) {
38
38
  i.visible = !1;
39
39
  const m = {
40
- tenant: I().user.tenant,
40
+ tenant: w().user.tenant,
41
41
  name: o.name,
42
42
  captchaId: o.captchaId,
43
43
  captchaCode: o.captchaCode
@@ -53,7 +53,7 @@ const A = { class: "h-[40px]" }, M = { class: "image-slot" }, P = { class: "dial
53
53
  };
54
54
  function k() {
55
55
  const a = {
56
- tenant: I().user.tenant,
56
+ tenant: w().user.tenant,
57
57
  directoryId: "jmash",
58
58
  name: o.name,
59
59
  validCode: o.validCode,
@@ -97,7 +97,7 @@ const A = { class: "h-[40px]" }, M = { class: "image-slot" }, P = { class: "dial
97
97
  append: l(() => [
98
98
  e(r, {
99
99
  disabled: n.disabled,
100
- onClick: w
100
+ onClick: I
101
101
  }, {
102
102
  default: l(() => [
103
103
  u(f(n.content), 1)
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./updatePwd.vue_vue_type_script_setup_true_lang-sFzRukhN.mjs";
1
+ import { _ as f } from "./updatePwd.vue_vue_type_script_setup_true_lang-BU1ew_Pw.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as q, ref as v, toRefs as E, reactive as V, resolveComponent as i, openBlock as O, createBlock as A, unref as t, isRef as U, withCtx as n, createElementVNode as B, createVNode as r, createTextVNode as g, toDisplayString as _ } from "vue";
2
- import { ElMessage as D } from "element-plus";
3
- import { y as b, aC as I } from "./index-Bw3IdFvk.mjs";
4
- import { useI18n as S } from "vue-i18n";
5
- const z = { class: "dialog-footer" }, G = /* @__PURE__ */ q({
1
+ import { defineComponent as q, ref as v, toRefs as E, reactive as V, resolveComponent as i, openBlock as O, createBlock as A, unref as t, isRef as D, withCtx as n, createElementVNode as U, createVNode as r, createTextVNode as g, toDisplayString as _ } from "vue";
2
+ import { ElMessage as z } from "element-plus";
3
+ import { z as b, aD as B } from "./index-B5cWr2iD.mjs";
4
+ import { useI18n as I } from "vue-i18n";
5
+ const S = { class: "dialog-footer" }, G = /* @__PURE__ */ q({
6
6
  __name: "updatePwd",
7
7
  props: {
8
8
  pwdVisible: {
@@ -11,14 +11,14 @@ const z = { class: "dialog-footer" }, G = /* @__PURE__ */ q({
11
11
  }
12
12
  },
13
13
  emits: ["dialogActionChange"],
14
- setup(y, { emit: R }) {
15
- const { t: a } = S(), p = v(), C = y, { pwdVisible: u } = E(C), c = R;
14
+ setup(R, { emit: y }) {
15
+ const { t: a } = I(), p = v(), N = R, { pwdVisible: u } = E(N), c = y;
16
16
  let l = V({
17
17
  encodeOldPwd: "",
18
18
  encodeNewPwd: "",
19
19
  confirmPwd: ""
20
20
  });
21
- const N = V({
21
+ const $ = V({
22
22
  encodeOldPwd: [{ required: !0, validator: (o, e, d) => {
23
23
  e === "" ? d(new Error(a("password.oldPwdRequired"))) : d();
24
24
  }, trigger: "blur" }],
@@ -28,13 +28,13 @@ const z = { class: "dialog-footer" }, G = /* @__PURE__ */ q({
28
28
  confirmPwd: [{ required: !0, validator: (o, e, d) => {
29
29
  e === "" ? d(new Error(a("password.confirmPwdRequired"))) : e !== l.encodeNewPwd ? d(new Error(a("password.comparePwd"))) : d();
30
30
  }, trigger: "blur" }]
31
- }), $ = async () => {
31
+ }), h = async () => {
32
32
  var o;
33
33
  await ((o = p.value) == null ? void 0 : o.validate((e) => {
34
34
  if (e) {
35
35
  let d = b(l.encodeOldPwd), w = b(l.encodeNewPwd);
36
- I(d, w).then((m) => {
37
- m.status === 200 && (D({
36
+ B(d, w).then((m) => {
37
+ m.status === 200 && (z({
38
38
  message: a("password.successResetPwd"),
39
39
  type: "success"
40
40
  }), c("dialogActionChange", !1));
@@ -48,16 +48,16 @@ const z = { class: "dialog-footer" }, G = /* @__PURE__ */ q({
48
48
  (o = p.value) == null || o.resetFields(), c("dialogActionChange", !1);
49
49
  }
50
50
  return (o, e) => {
51
- const d = i("el-input"), w = i("el-form-item"), m = i("el-form"), P = i("el-button"), h = i("el-dialog");
52
- return O(), A(h, {
51
+ const d = i("el-input"), w = i("el-form-item"), m = i("el-form"), P = i("el-button"), C = i("el-dialog");
52
+ return O(), A(C, {
53
53
  title: "修改密码",
54
54
  modelValue: t(u),
55
- "onUpdate:modelValue": e[3] || (e[3] = (s) => U(u) ? u.value = s : null),
55
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => D(u) ? u.value = s : null),
56
56
  width: "500px",
57
57
  onClose: f
58
58
  }, {
59
59
  footer: n(() => [
60
- B("div", z, [
60
+ U("div", S, [
61
61
  r(P, { onClick: f }, {
62
62
  default: n(() => [
63
63
  g(_(o.$t("common.cancel")), 1)
@@ -66,7 +66,7 @@ const z = { class: "dialog-footer" }, G = /* @__PURE__ */ q({
66
66
  }),
67
67
  r(P, {
68
68
  type: "primary",
69
- onClick: $
69
+ onClick: h
70
70
  }, {
71
71
  default: n(() => [
72
72
  g(_(o.$t("common.confirm")), 1)
@@ -81,7 +81,7 @@ const z = { class: "dialog-footer" }, G = /* @__PURE__ */ q({
81
81
  ref: p,
82
82
  model: t(l),
83
83
  "label-width": "80px",
84
- rules: N
84
+ rules: $
85
85
  }, {
86
86
  default: n(() => [
87
87
  r(w, {
@@ -0,0 +1,16 @@
1
+ import type { SysApi, LoginUserInfo, LoginUserToken } from "./types";
2
+ declare class SysApiImpl implements SysApi {
3
+ userStore: any;
4
+ constructor();
5
+ /** 检查用户是否登录. */
6
+ checkLogin(): boolean;
7
+ /** 获取登录用户信息. */
8
+ userInfo(): LoginUserInfo;
9
+ /** 检查是否包含该角色 */
10
+ hasRole(roleCode: string): boolean;
11
+ /** 检查是否包含该权限 */
12
+ hasPerm(permCode: string): boolean;
13
+ /** 获取登录用户Token信息. */
14
+ userToken(): LoginUserToken;
15
+ }
16
+ export { SysApiImpl };
@@ -0,0 +1,35 @@
1
+ export interface SysApi {
2
+ /** 检查用户是否登录. */
3
+ checkLogin(): boolean;
4
+ /** 获取登录用户信息. */
5
+ userInfo(): LoginUserInfo;
6
+ /** 检查是否包含该角色 */
7
+ hasRole(roleCode: string): boolean;
8
+ /** 检查是否包含该权限 */
9
+ hasPerm(permCode: string): boolean;
10
+ /** 获取登录用户Token信息. */
11
+ userToken(): LoginUserToken;
12
+ }
13
+ /**
14
+ * 登录用户信息
15
+ */
16
+ export interface LoginUserInfo {
17
+ userId?: string;
18
+ loginName?: string;
19
+ nickName?: string;
20
+ avatar?: string;
21
+ tenant: string;
22
+ roleCodes: string[];
23
+ permCodes: string[];
24
+ runAs?: boolean;
25
+ }
26
+ /**
27
+ * 登录用户Token信息
28
+ */
29
+ export interface LoginUserToken {
30
+ accessToken?: string;
31
+ expiresDate?: number;
32
+ expiresin?: number;
33
+ refreshToken?: string;
34
+ tokenType?: string;
35
+ }
@@ -12,6 +12,7 @@ export { getCaptchaApi, selectDsdRoles, runAsUser } from "./api/auth";
12
12
  export { netEncrypt } from "./utils/netsecret";
13
13
  export { fileApi } from "./api/file/index";
14
14
  export { routerUtil } from "./utils/route";
15
+ export { SysApiImpl } from "./api/sys/index";
15
16
  export { useListData } from "./hooks/useList";
16
17
  export { useTableHooks, TableHooks } from "./hooks/table";
17
18
  export { store } from "./stores";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmash-core",
3
- "version": "0.0.97",
3
+ "version": "0.0.98",
4
4
  "private": false,
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dts/src/index.d.ts",