@ajaxjs/ui 1.7.0 → 1.7.1

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/README.md CHANGED
@@ -8,3 +8,9 @@
8
8
  # Ajaxjs UI Library
9
9
 
10
10
  [![npm version](https://img.shields.io/npm/v/your-package-name.svg)](https://www.npmjs.com/package/@ajaxjs/ui)
11
+
12
+
13
+ ```shell
14
+ npm run dev # development mode
15
+ npm run build:lib # build library
16
+ ```
@@ -428,8 +428,13 @@ function now(s = "yyyy-MM-dd hh:mm") {
428
428
  var date_format = /* @__PURE__ */ Object.freeze({
429
429
  __proto__: null,
430
430
  dateFormat,
431
+ formatDate,
431
432
  now
432
433
  });
434
+ let _on401;
435
+ function setOn401(s) {
436
+ _on401 = s;
437
+ }
433
438
  function request(s, a, d, t, p) {
434
439
  let y = {};
435
440
  if (p)
@@ -443,6 +448,8 @@ function request(s, a, d, t, p) {
443
448
  body: c,
444
449
  credentials: "include"
445
450
  }).then((m) => {
451
+ if (m.status === 401 && _on401)
452
+ return _on401(m.json());
446
453
  if (m.status === 404)
447
454
  throw new Error("Not found 404: " + s);
448
455
  if (m.status === 500)
@@ -487,7 +494,8 @@ var xhr_fetch = /* @__PURE__ */ Object.freeze({
487
494
  post,
488
495
  postForm,
489
496
  put,
490
- putForm
497
+ putForm,
498
+ setOn401
491
499
  });
492
500
  const _sfc_main$B = defineComponent({
493
501
  data() {
@@ -12529,7 +12537,7 @@ function _sfc_render$x(s, a, d, t, p, y) {
12529
12537
  ])) : createCommentVNode("", !0)
12530
12538
  ], 64);
12531
12539
  }
12532
- const FormLoader = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$x], ["__scopeId", "data-v-e2426c7a"]]), _sfc_main$w = defineComponent({
12540
+ const FormLoader = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$x], ["__scopeId", "data-v-1501f676"]]), _sfc_main$w = defineComponent({
12533
12541
  name: "ListLoader",
12534
12542
  components: { FormLoader },
12535
12543
  props: {
@@ -12940,7 +12948,7 @@ function _sfc_render$w(s, a, d, t, p, y) {
12940
12948
  ])) : createCommentVNode("", !0)
12941
12949
  ]);
12942
12950
  }
12943
- const ListLoader = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w], ["__scopeId", "data-v-a44a294e"]]), _sfc_main$v = {
12951
+ const ListLoader = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w], ["__scopeId", "data-v-a54622ee"]]), _sfc_main$v = {
12944
12952
  components: {
12945
12953
  ListLoader
12946
12954
  }
@@ -13680,7 +13688,7 @@ function _sfc_render$q(s, a, d, t, p, y) {
13680
13688
  }, 8, ["model", "rules"])
13681
13689
  ]);
13682
13690
  }
13683
- const ArticleEdit = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-d890a0b4"]]), _sfc_main$p = {
13691
+ const ArticleEdit = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-d7a63bb7"]]), _sfc_main$p = {
13684
13692
  components: {
13685
13693
  ListLoader
13686
13694
  }
@@ -14010,13 +14018,32 @@ const ProcessLine = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_re
14010
14018
  isShowDelAccount: !1,
14011
14019
  showSetPhone: !1,
14012
14020
  showSetEmail: !1,
14013
- showChangePsw: !1
14021
+ showChangePsw: !1,
14022
+ modiflyPsw: { oldPsw: "", newPsw: "", newPsw2: "" }
14014
14023
  };
14015
14024
  },
14016
14025
  components: { "aj-layer": Layer, "aj-process-line": ProcessLine },
14017
14026
  mounted() {
14018
14027
  },
14019
14028
  methods: {
14029
+ /**
14030
+ * 修改密码
14031
+ */
14032
+ doModiflyPsw() {
14033
+ const { oldPsw: s, newPsw: a, newPsw2: d } = this.modiflyPsw;
14034
+ if (!s || !a || !d) {
14035
+ this.$Message.success("请填写完整的信息");
14036
+ return;
14037
+ }
14038
+ if (a !== d) {
14039
+ this.$Message.success("两次密码不一致");
14040
+ return;
14041
+ }
14042
+ xhr_fetch.post(`${window.config.iamApi}/reset_psw/modify_psw`, { oldPsw: s, newPsw: a }, (t) => {
14043
+ console.log(t), t.status ? (this.$Message.success("修改密码成功!"), setTimeout(() => {
14044
+ }, 2e3)) : (this.$Message.error("修改密码失败:" + t.message), console.error(t.message || "修改密码失败"));
14045
+ });
14046
+ },
14020
14047
  delAccount() {
14021
14048
  this.$Modal.confirm({
14022
14049
  title: "确定删除帐号吗?⚠️ ",
@@ -14084,7 +14111,7 @@ const ProcessLine = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_re
14084
14111
  function _sfc_render$g(s, a, d, t, p, y) {
14085
14112
  const c = resolveComponent("aj-process-line"), m = resolveComponent("Input"), v = resolveComponent("Button"), C = resolveComponent("aj-layer");
14086
14113
  return openBlock(), createElementBlock("div", _hoisted_1$d, [
14087
- a[26] || (a[26] = createElementVNode("h3", { class: "aj-center-title" }, "帐号管理", -1)),
14114
+ a[29] || (a[29] = createElementVNode("h3", { class: "aj-center-title" }, "帐号管理", -1)),
14088
14115
  createElementVNode("ul", _hoisted_2$b, [
14089
14116
  createElementVNode("li", null, [
14090
14117
  createElementVNode("a", {
@@ -14111,22 +14138,22 @@ function _sfc_render$g(s, a, d, t, p, y) {
14111
14138
  href: "javascript:void(0);",
14112
14139
  onClick: a[2] || (a[2] = (k) => p.showChangePsw = !0)
14113
14140
  }, "修改密码"),
14114
- a[9] || (a[9] = createElementVNode("div", { class: "ok" }, "设置密码", -1)),
14115
- a[10] || (a[10] = createElementVNode("div", null, "已设置", -1))
14141
+ a[12] || (a[12] = createElementVNode("div", { class: "ok" }, "设置密码", -1)),
14142
+ a[13] || (a[13] = createElementVNode("div", null, "已设置", -1))
14116
14143
  ]),
14117
14144
  createElementVNode("li", null, [
14118
14145
  createElementVNode("a", {
14119
14146
  href: "javascript:void(0);",
14120
14147
  onClick: a[3] || (a[3] = (...k) => y.delAccount && y.delAccount(...k))
14121
14148
  }, "账号注销"),
14122
- a[11] || (a[11] = createElementVNode("div", { style: { "padding-left": "3%" } }, "删除帐号", -1)),
14123
- a[12] || (a[12] = createElementVNode("div", null, "删除该帐号以及所有该帐号关联的信息", -1))
14149
+ a[14] || (a[14] = createElementVNode("div", { style: { "padding-left": "3%" } }, "删除帐号", -1)),
14150
+ a[15] || (a[15] = createElementVNode("div", null, "删除该帐号以及所有该帐号关联的信息", -1))
14124
14151
  ])
14125
14152
  ]),
14126
14153
  p.showSetPhone ? (openBlock(), createBlock(C, { key: 0 }, {
14127
14154
  default: withCtx(() => [
14128
14155
  createElementVNode("div", _hoisted_3$b, [
14129
- a[17] || (a[17] = createElementVNode("h1", null, "设置手机", -1)),
14156
+ a[20] || (a[20] = createElementVNode("h1", null, "设置手机", -1)),
14130
14157
  createVNode(c),
14131
14158
  createElementVNode("form", _hoisted_4$b, [
14132
14159
  createElementVNode("div", null, [
@@ -14144,9 +14171,9 @@ function _sfc_render$g(s, a, d, t, p, y) {
14144
14171
  placeholder: "请输入验证码",
14145
14172
  size: "10"
14146
14173
  }),
14147
- a[14] || (a[14] = createTextVNode()),
14174
+ a[17] || (a[17] = createTextVNode()),
14148
14175
  createVNode(v, { onClick: y.sendPhoneCode }, {
14149
- default: withCtx(() => [...a[13] || (a[13] = [
14176
+ default: withCtx(() => [...a[16] || (a[16] = [
14150
14177
  createTextVNode("发送验证码", -1)
14151
14178
  ])]),
14152
14179
  _: 1
@@ -14157,12 +14184,12 @@ function _sfc_render$g(s, a, d, t, p, y) {
14157
14184
  type: "primary",
14158
14185
  onClick: y.savePhone
14159
14186
  }, {
14160
- default: withCtx(() => [...a[15] || (a[15] = [
14187
+ default: withCtx(() => [...a[18] || (a[18] = [
14161
14188
  createTextVNode("保存手机", -1)
14162
14189
  ])]),
14163
14190
  _: 1
14164
14191
  }, 8, ["onClick"]),
14165
- a[16] || (a[16] = createTextVNode("    ", -1)),
14192
+ a[19] || (a[19] = createTextVNode("    ", -1)),
14166
14193
  createElementVNode("a", {
14167
14194
  href: "javascript:void(0);",
14168
14195
  onClick: a[5] || (a[5] = (k) => p.showSetPhone = !1)
@@ -14176,7 +14203,7 @@ function _sfc_render$g(s, a, d, t, p, y) {
14176
14203
  p.showSetEmail ? (openBlock(), createBlock(C, { key: 1 }, {
14177
14204
  default: withCtx(() => [
14178
14205
  createElementVNode("div", _hoisted_6$7, [
14179
- a[22] || (a[22] = createElementVNode("h1", null, "设置邮箱", -1)),
14206
+ a[25] || (a[25] = createElementVNode("h1", null, "设置邮箱", -1)),
14180
14207
  createVNode(c),
14181
14208
  createElementVNode("form", _hoisted_7$6, [
14182
14209
  createElementVNode("div", null, [
@@ -14194,9 +14221,9 @@ function _sfc_render$g(s, a, d, t, p, y) {
14194
14221
  placeholder: "请输入邮箱验证码",
14195
14222
  size: "10"
14196
14223
  }),
14197
- a[19] || (a[19] = createTextVNode()),
14224
+ a[22] || (a[22] = createTextVNode()),
14198
14225
  createVNode(v, { onClick: y.sendEmailCode }, {
14199
- default: withCtx(() => [...a[18] || (a[18] = [
14226
+ default: withCtx(() => [...a[21] || (a[21] = [
14200
14227
  createTextVNode("发送验证码", -1)
14201
14228
  ])]),
14202
14229
  _: 1
@@ -14207,12 +14234,12 @@ function _sfc_render$g(s, a, d, t, p, y) {
14207
14234
  type: "primary",
14208
14235
  onClick: y.saveEmail
14209
14236
  }, {
14210
- default: withCtx(() => [...a[20] || (a[20] = [
14237
+ default: withCtx(() => [...a[23] || (a[23] = [
14211
14238
  createTextVNode("保存邮箱", -1)
14212
14239
  ])]),
14213
14240
  _: 1
14214
14241
  }, 8, ["onClick"]),
14215
- a[21] || (a[21] = createTextVNode("    ", -1)),
14242
+ a[24] || (a[24] = createTextVNode("    ", -1)),
14216
14243
  createElementVNode("a", {
14217
14244
  href: "javascript:void(0);",
14218
14245
  onClick: a[7] || (a[7] = (k) => p.showSetEmail = !1)
@@ -14226,41 +14253,50 @@ function _sfc_render$g(s, a, d, t, p, y) {
14226
14253
  p.showChangePsw ? (openBlock(), createBlock(C, { key: 2 }, {
14227
14254
  default: withCtx(() => [
14228
14255
  createElementVNode("div", _hoisted_9$3, [
14229
- a[25] || (a[25] = createElementVNode("h1", null, "修改密码", -1)),
14256
+ a[28] || (a[28] = createElementVNode("h1", null, "修改密码", -1)),
14230
14257
  createVNode(c),
14231
14258
  createElementVNode("form", _hoisted_10$2, [
14232
14259
  createElementVNode("div", null, [
14233
14260
  createVNode(m, {
14234
14261
  type: "password",
14235
14262
  placeholder: "请输入原密码",
14263
+ modelValue: p.modiflyPsw.oldPsw,
14264
+ "onUpdate:modelValue": a[8] || (a[8] = (k) => p.modiflyPsw.oldPsw = k),
14236
14265
  size: "30"
14237
- })
14266
+ }, null, 8, ["modelValue"])
14238
14267
  ]),
14239
14268
  createElementVNode("div", null, [
14240
14269
  createVNode(m, {
14241
14270
  type: "password",
14242
14271
  placeholder: "请输入新密码",
14272
+ modelValue: p.modiflyPsw.newPsw,
14273
+ "onUpdate:modelValue": a[9] || (a[9] = (k) => p.modiflyPsw.newPsw = k),
14243
14274
  size: "30"
14244
- })
14275
+ }, null, 8, ["modelValue"])
14245
14276
  ]),
14246
14277
  createElementVNode("div", null, [
14247
14278
  createVNode(m, {
14248
14279
  type: "password",
14249
14280
  placeholder: "请重复输入新密码",
14281
+ modelValue: p.modiflyPsw.newPsw2,
14282
+ "onUpdate:modelValue": a[10] || (a[10] = (k) => p.modiflyPsw.newPsw2 = k),
14250
14283
  size: "30"
14251
- })
14284
+ }, null, 8, ["modelValue"])
14252
14285
  ]),
14253
14286
  createElementVNode("div", null, [
14254
- createVNode(v, { type: "primary" }, {
14255
- default: withCtx(() => [...a[23] || (a[23] = [
14287
+ createVNode(v, {
14288
+ type: "primary",
14289
+ onClick: y.doModiflyPsw
14290
+ }, {
14291
+ default: withCtx(() => [...a[26] || (a[26] = [
14256
14292
  createTextVNode("修改密码", -1)
14257
14293
  ])]),
14258
14294
  _: 1
14259
- }),
14260
- a[24] || (a[24] = createTextVNode("    ", -1)),
14295
+ }, 8, ["onClick"]),
14296
+ a[27] || (a[27] = createTextVNode("    ", -1)),
14261
14297
  createElementVNode("a", {
14262
14298
  href: "javascript:void(0);",
14263
- onClick: a[8] || (a[8] = (k) => p.showChangePsw = !1)
14299
+ onClick: a[11] || (a[11] = (k) => p.showChangePsw = !1)
14264
14300
  }, "取消")
14265
14301
  ])
14266
14302
  ])
@@ -15069,7 +15105,7 @@ function _sfc_render$a(s, a, d, t, p, y) {
15069
15105
  }, 8, ["modelValue", "title", "onOnOk"])
15070
15106
  ]);
15071
15107
  }
15072
- const ListRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-f55d5850"]]), _sfc_main$9 = defineComponent({
15108
+ const ListRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-31c6310a"]]), _sfc_main$9 = defineComponent({
15073
15109
  // components: { input },
15074
15110
  props: {
15075
15111
  row: {
@@ -20718,7 +20754,7 @@ function _sfc_render$6(s, a, d, t, p, y) {
20718
20754
  _: 1
20719
20755
  }, 512);
20720
20756
  }
20721
- const ListInfo = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-7844f499"]]), _sfc_main$5 = defineComponent({
20757
+ const ListInfo = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-ce135107"]]), _sfc_main$5 = defineComponent({
20722
20758
  setup() {
20723
20759
  return { previewloader: ref(null) };
20724
20760
  },