@witlink/usercenter 1.2.61 → 1.2.63
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/usercenter.es.js +112 -93
- package/dist/usercenter.umd.js +1 -1
- package/package.json +1 -1
package/dist/usercenter.es.js
CHANGED
|
@@ -8,7 +8,7 @@ import { useI18n } from "vue-i18n";
|
|
|
8
8
|
import { defineStore, createPinia } from "pinia";
|
|
9
9
|
import Axios from "axios";
|
|
10
10
|
import { notification, message, App, Drawer, Button, ConfigProvider, Modal, Checkbox as Checkbox$1, Divider as Divider$1 } from "ant-design-vue";
|
|
11
|
-
import { ref, render, h, reactive, inject, computed, provide, createCommentVNode, defineComponent, watch, onMounted, nextTick, onUnmounted, TransitionGroup, Teleport, resolveComponent, onActivated, onDeactivated, onBeforeUnmount, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, createTextVNode, toDisplayString, createBlock,
|
|
11
|
+
import { ref, render, h, reactive, inject, computed, provide, createCommentVNode, defineComponent, watch, onMounted, nextTick, onUnmounted, TransitionGroup, Teleport, resolveComponent, onActivated, onDeactivated, onBeforeUnmount, openBlock, createElementBlock, createVNode, withCtx, unref, createElementVNode, createTextVNode, toDisplayString, createBlock, Fragment, renderList, normalizeClass, normalizeStyle, mergeProps, onBeforeMount, withDirectives, vShow, useSlots, createSlots, renderSlot, normalizeProps, guardReactiveProps, withModifiers, watchEffect, mergeModels, useModel, resolveDirective } from "vue";
|
|
12
12
|
import { getUserInfo as getUserInfo$1, hasPermission } from "@witlink/components/utils";
|
|
13
13
|
import en_US from "ant-design-vue/es/locale/en_US";
|
|
14
14
|
import zh_CN from "ant-design-vue/es/locale/zh_CN";
|
|
@@ -32097,6 +32097,15 @@ function updateMenuTreeOrder(params) {
|
|
|
32097
32097
|
data: params
|
|
32098
32098
|
});
|
|
32099
32099
|
}
|
|
32100
|
+
function useRequiredMessage() {
|
|
32101
|
+
const { t: t2 } = useI18n();
|
|
32102
|
+
const userStore = useUserStore();
|
|
32103
|
+
const requiredMessage = (labelKey) => {
|
|
32104
|
+
const suffix = t2("uc_common.isRequired");
|
|
32105
|
+
return userStore.userLanguage === "zh_CN" ? labelKey + suffix : labelKey + " " + suffix;
|
|
32106
|
+
};
|
|
32107
|
+
return { requiredMessage };
|
|
32108
|
+
}
|
|
32100
32109
|
const _hoisted_1$m = { class: "add-menu" };
|
|
32101
32110
|
const _hoisted_2$d = { class: "actions-wrap" };
|
|
32102
32111
|
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
@@ -32118,6 +32127,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
32118
32127
|
emits: ["close", "submit"],
|
|
32119
32128
|
setup(__props, { emit: __emit }) {
|
|
32120
32129
|
const userStore = useUserStore();
|
|
32130
|
+
const { requiredMessage } = useRequiredMessage();
|
|
32121
32131
|
const emits = __emit;
|
|
32122
32132
|
const props = __props;
|
|
32123
32133
|
const formRef = ref(null);
|
|
@@ -32181,7 +32191,12 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
32181
32191
|
createVNode(_component_a_form_item, {
|
|
32182
32192
|
label: _ctx.$t("uc_fun.fun_name"),
|
|
32183
32193
|
name: "funName",
|
|
32184
|
-
|
|
32194
|
+
rules: [
|
|
32195
|
+
{
|
|
32196
|
+
required: true,
|
|
32197
|
+
message: unref(requiredMessage)(_ctx.$t("uc_fun.fun_name"))
|
|
32198
|
+
}
|
|
32199
|
+
]
|
|
32185
32200
|
}, {
|
|
32186
32201
|
default: withCtx(() => [
|
|
32187
32202
|
createVNode(_component_a_input, {
|
|
@@ -32192,11 +32207,16 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
32192
32207
|
}, null, 8, ["placeholder", "value"])
|
|
32193
32208
|
]),
|
|
32194
32209
|
_: 1
|
|
32195
|
-
}, 8, ["label"]),
|
|
32210
|
+
}, 8, ["label", "rules"]),
|
|
32196
32211
|
createVNode(_component_a_form_item, {
|
|
32197
32212
|
label: _ctx.$t("uc_fun.url"),
|
|
32198
32213
|
name: "url",
|
|
32199
|
-
|
|
32214
|
+
rules: [
|
|
32215
|
+
{
|
|
32216
|
+
required: true,
|
|
32217
|
+
message: unref(requiredMessage)(_ctx.$t("uc_fun.url"))
|
|
32218
|
+
}
|
|
32219
|
+
]
|
|
32200
32220
|
}, {
|
|
32201
32221
|
default: withCtx(() => [
|
|
32202
32222
|
createVNode(_component_a_input, {
|
|
@@ -32207,7 +32227,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
32207
32227
|
}, null, 8, ["placeholder", "value"])
|
|
32208
32228
|
]),
|
|
32209
32229
|
_: 1
|
|
32210
|
-
}, 8, ["label"]),
|
|
32230
|
+
}, 8, ["label", "rules"]),
|
|
32211
32231
|
createVNode(_component_a_form_item, {
|
|
32212
32232
|
label: _ctx.$t("uc_fun.image"),
|
|
32213
32233
|
name: "image"
|
|
@@ -38062,7 +38082,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
38062
38082
|
placeholder: _ctx.$t("uc_common.plsEnter"),
|
|
38063
38083
|
value: form.userPwd,
|
|
38064
38084
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => form.userPwd = $event),
|
|
38065
|
-
autocomplete: "
|
|
38085
|
+
autocomplete: "new-password"
|
|
38066
38086
|
}, null, 8, ["placeholder", "value"])
|
|
38067
38087
|
]),
|
|
38068
38088
|
_: 1
|
|
@@ -38076,7 +38096,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
38076
38096
|
type: "password",
|
|
38077
38097
|
style: { "width": "100%" },
|
|
38078
38098
|
placeholder: _ctx.$t("uc_common.plsEnter"),
|
|
38079
|
-
autocomplete: "
|
|
38099
|
+
autocomplete: "new-password",
|
|
38080
38100
|
value: form.userPwd1,
|
|
38081
38101
|
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => form.userPwd1 = $event)
|
|
38082
38102
|
}, null, 8, ["placeholder", "value"])
|
|
@@ -38793,15 +38813,6 @@ function isValidEmail(email) {
|
|
|
38793
38813
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
38794
38814
|
return emailRegex.test(email);
|
|
38795
38815
|
}
|
|
38796
|
-
function useRequiredMessage() {
|
|
38797
|
-
const { t: t2 } = useI18n();
|
|
38798
|
-
const userStore = useUserStore();
|
|
38799
|
-
const requiredMessage = (labelKey) => {
|
|
38800
|
-
const suffix = t2("uc_common.isRequired");
|
|
38801
|
-
return userStore.userLanguage === "zh_CN" ? labelKey + suffix : labelKey + " " + suffix;
|
|
38802
|
-
};
|
|
38803
|
-
return { requiredMessage };
|
|
38804
|
-
}
|
|
38805
38816
|
const _hoisted_1$a = ["spinning"];
|
|
38806
38817
|
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
38807
38818
|
__name: "ModalEdit",
|
|
@@ -38927,54 +38938,60 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
38927
38938
|
showModal
|
|
38928
38939
|
});
|
|
38929
38940
|
ref(0);
|
|
38930
|
-
const mobileRules =
|
|
38931
|
-
|
|
38932
|
-
|
|
38933
|
-
|
|
38934
|
-
|
|
38935
|
-
|
|
38936
|
-
|
|
38937
|
-
|
|
38938
|
-
|
|
38939
|
-
|
|
38940
|
-
|
|
38941
|
-
|
|
38942
|
-
|
|
38941
|
+
const mobileRules = computed(() => {
|
|
38942
|
+
return {
|
|
38943
|
+
pwd: [
|
|
38944
|
+
{
|
|
38945
|
+
required: true,
|
|
38946
|
+
message: t2("uc_personal_center.user_pwd4_msg1")
|
|
38947
|
+
}
|
|
38948
|
+
],
|
|
38949
|
+
mobile: [
|
|
38950
|
+
{
|
|
38951
|
+
required: true,
|
|
38952
|
+
message: t2("uc_personal_center.mobile_placeholder")
|
|
38953
|
+
}
|
|
38954
|
+
]
|
|
38955
|
+
};
|
|
38943
38956
|
});
|
|
38944
|
-
const emailRules =
|
|
38945
|
-
|
|
38946
|
-
|
|
38947
|
-
|
|
38948
|
-
|
|
38949
|
-
|
|
38950
|
-
|
|
38951
|
-
|
|
38952
|
-
|
|
38953
|
-
|
|
38954
|
-
|
|
38955
|
-
|
|
38956
|
-
|
|
38957
|
-
|
|
38958
|
-
|
|
38959
|
-
|
|
38960
|
-
|
|
38957
|
+
const emailRules = computed(() => {
|
|
38958
|
+
return {
|
|
38959
|
+
pwd: [
|
|
38960
|
+
{
|
|
38961
|
+
required: true,
|
|
38962
|
+
message: t2("uc_personal_center.user_pwd4_msg1")
|
|
38963
|
+
}
|
|
38964
|
+
],
|
|
38965
|
+
email: [
|
|
38966
|
+
{
|
|
38967
|
+
required: true,
|
|
38968
|
+
validator: function(rule, value) {
|
|
38969
|
+
if (!value) {
|
|
38970
|
+
return Promise.reject(t2("uc_personal_center.email_placeholder"));
|
|
38971
|
+
} else if (!isValidEmail(value)) {
|
|
38972
|
+
return Promise.reject(t2("uc_personal_center.email_validate"));
|
|
38973
|
+
} else {
|
|
38974
|
+
return Promise.resolve();
|
|
38975
|
+
}
|
|
38961
38976
|
}
|
|
38962
38977
|
}
|
|
38963
|
-
|
|
38964
|
-
|
|
38965
|
-
|
|
38966
|
-
|
|
38967
|
-
|
|
38968
|
-
|
|
38969
|
-
|
|
38970
|
-
|
|
38971
|
-
|
|
38972
|
-
|
|
38973
|
-
|
|
38978
|
+
],
|
|
38979
|
+
captcha: [
|
|
38980
|
+
{
|
|
38981
|
+
required: true,
|
|
38982
|
+
trigger: ["blur"],
|
|
38983
|
+
validator: function(rule, value) {
|
|
38984
|
+
if (!value) {
|
|
38985
|
+
return Promise.reject(
|
|
38986
|
+
t2("uc_personal_center.verify_code_placeholder")
|
|
38987
|
+
);
|
|
38988
|
+
} else {
|
|
38989
|
+
return Promise.resolve();
|
|
38990
|
+
}
|
|
38974
38991
|
}
|
|
38975
38992
|
}
|
|
38976
|
-
|
|
38977
|
-
|
|
38993
|
+
]
|
|
38994
|
+
};
|
|
38978
38995
|
});
|
|
38979
38996
|
const sendCheck = (type = "") => {
|
|
38980
38997
|
if (!change.value) {
|
|
@@ -39084,7 +39101,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
39084
39101
|
layout: "vertical",
|
|
39085
39102
|
ref_key: "formRef",
|
|
39086
39103
|
ref: formRef,
|
|
39087
|
-
rules: mobileRules,
|
|
39104
|
+
rules: mobileRules.value,
|
|
39088
39105
|
class: "inline-query-form clear-formctrl-lh rm-form-item-mb",
|
|
39089
39106
|
style: { "height": "198px" }
|
|
39090
39107
|
}, {
|
|
@@ -39097,7 +39114,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
39097
39114
|
createVNode(_component_a_input_password, {
|
|
39098
39115
|
placeholder: _ctx.$t("uc_common.plsEnter"),
|
|
39099
39116
|
maxLength: 20,
|
|
39100
|
-
autocomplete: "
|
|
39117
|
+
autocomplete: "new-password",
|
|
39101
39118
|
value: form.pwd,
|
|
39102
39119
|
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => form.pwd = $event)
|
|
39103
39120
|
}, null, 8, ["placeholder", "value"])
|
|
@@ -39112,7 +39129,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
39112
39129
|
createVNode(_component_a_input, {
|
|
39113
39130
|
placeholder: _ctx.$t("uc_common.plsEnter"),
|
|
39114
39131
|
maxLength: 50,
|
|
39115
|
-
autocomplete: "
|
|
39132
|
+
autocomplete: "new-password",
|
|
39116
39133
|
value: form.mobile,
|
|
39117
39134
|
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => form.mobile = $event)
|
|
39118
39135
|
}, null, 8, ["placeholder", "value"])
|
|
@@ -39125,7 +39142,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
39125
39142
|
params.opType == "3" ? (openBlock(), createBlock(_component_a_form, {
|
|
39126
39143
|
key: 2,
|
|
39127
39144
|
model: form,
|
|
39128
|
-
rules: emailRules,
|
|
39145
|
+
rules: emailRules.value,
|
|
39129
39146
|
ref_key: "formRef",
|
|
39130
39147
|
ref: formRef,
|
|
39131
39148
|
layout: "vertical",
|
|
@@ -40588,34 +40605,36 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
40588
40605
|
newPwd: "",
|
|
40589
40606
|
userPwd1: ""
|
|
40590
40607
|
});
|
|
40591
|
-
const pwdRules =
|
|
40592
|
-
|
|
40593
|
-
|
|
40594
|
-
|
|
40595
|
-
|
|
40596
|
-
|
|
40597
|
-
|
|
40598
|
-
|
|
40599
|
-
|
|
40600
|
-
|
|
40601
|
-
|
|
40602
|
-
|
|
40603
|
-
|
|
40604
|
-
|
|
40605
|
-
|
|
40606
|
-
|
|
40607
|
-
|
|
40608
|
-
|
|
40609
|
-
|
|
40610
|
-
|
|
40611
|
-
|
|
40612
|
-
|
|
40613
|
-
|
|
40614
|
-
|
|
40608
|
+
const pwdRules = computed(() => {
|
|
40609
|
+
return {
|
|
40610
|
+
oldPwd: [
|
|
40611
|
+
{
|
|
40612
|
+
required: true,
|
|
40613
|
+
message: t2("uc_personal_center.user_pwd3_msg1")
|
|
40614
|
+
}
|
|
40615
|
+
],
|
|
40616
|
+
newPwd: [
|
|
40617
|
+
{
|
|
40618
|
+
required: true,
|
|
40619
|
+
message: t2("uc_personal_center.user_pwd1_msg1")
|
|
40620
|
+
}
|
|
40621
|
+
],
|
|
40622
|
+
userPwd1: [
|
|
40623
|
+
{
|
|
40624
|
+
required: true,
|
|
40625
|
+
validator: function(rule, value) {
|
|
40626
|
+
if (!value) {
|
|
40627
|
+
return Promise.reject(t2("uc_personal_center.user_pwd2_msg2"));
|
|
40628
|
+
}
|
|
40629
|
+
if (formState.newPwd === value) {
|
|
40630
|
+
return Promise.resolve();
|
|
40631
|
+
} else {
|
|
40632
|
+
return Promise.reject(t2("uc_personal_center.user_pwd2_msg1"));
|
|
40633
|
+
}
|
|
40615
40634
|
}
|
|
40616
40635
|
}
|
|
40617
|
-
|
|
40618
|
-
|
|
40636
|
+
]
|
|
40637
|
+
};
|
|
40619
40638
|
});
|
|
40620
40639
|
const initData = async () => {
|
|
40621
40640
|
var _a;
|
|
@@ -40903,7 +40922,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
40903
40922
|
ref: formRef,
|
|
40904
40923
|
name: "custom-validation",
|
|
40905
40924
|
model: formState,
|
|
40906
|
-
rules: pwdRules,
|
|
40925
|
+
rules: pwdRules.value,
|
|
40907
40926
|
layout: "vertical"
|
|
40908
40927
|
}, {
|
|
40909
40928
|
default: withCtx(() => [
|
|
@@ -40916,7 +40935,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
40916
40935
|
value: formState.oldPwd,
|
|
40917
40936
|
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => formState.oldPwd = $event),
|
|
40918
40937
|
type: "password",
|
|
40919
|
-
autocomplete: "
|
|
40938
|
+
autocomplete: "new-password",
|
|
40920
40939
|
style: { "width": "320px" },
|
|
40921
40940
|
placeholder: _ctx.$t("uc_common.plsEnter")
|
|
40922
40941
|
}, null, 8, ["value", "placeholder"])
|
|
@@ -40932,7 +40951,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
40932
40951
|
value: formState.newPwd,
|
|
40933
40952
|
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => formState.newPwd = $event),
|
|
40934
40953
|
type: "password",
|
|
40935
|
-
autocomplete: "
|
|
40954
|
+
autocomplete: "new-password",
|
|
40936
40955
|
style: { "width": "320px" },
|
|
40937
40956
|
placeholder: _ctx.$t("uc_common.plsEnter")
|
|
40938
40957
|
}, null, 8, ["value", "placeholder"])
|
|
@@ -40948,7 +40967,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
40948
40967
|
value: formState.userPwd1,
|
|
40949
40968
|
"onUpdate:value": _cache[4] || (_cache[4] = ($event) => formState.userPwd1 = $event),
|
|
40950
40969
|
type: "password",
|
|
40951
|
-
autocomplete: "
|
|
40970
|
+
autocomplete: "new-password",
|
|
40952
40971
|
style: { "width": "320px" },
|
|
40953
40972
|
placeholder: _ctx.$t("uc_common.plsEnter")
|
|
40954
40973
|
}, null, 8, ["value", "placeholder"])
|