Files
console-dev/app/pages/account/index.vue
T
cieanyau 651c36367f
前端验证 / verify (push) Failing after 15m2s
接入 ESLint 与 Prettier 并加入 CI 静态门禁
2026-11-07 01:24:36 +08:00

2858 lines
141 KiB
Vue

<script>
/**
* 账户设置聚合页:资料、登录密码、操作密码、手机、邮箱和流量预警分别维护表单与提交状态;敏感修改可由安全验证弹窗续接原请求。
*/
import "~/assets/styles/UploadField.BbTCTv6C.css";
import "~/assets/styles/PageSteps.B5K7G9zF.css";
import "~/assets/styles/PaymentDialog.BNFKQF1U.css";
import "~/assets/styles/realname.BpRCvfXO.css";
import "~/assets/styles/SensitiveValue.BSZlaRHT.css";
import "~/assets/styles/SecurityVerificationDialog.skYFo4v7.css";
import "~/assets/styles/ClientLevelDialog.DcYabp-W.css";
import "~/assets/styles/GeetestField.DiieTibK.css";
import "~/assets/styles/CaptchaField.BSN3ZbsD.css";
import "~/assets/styles/account.CTvLXxT_.css";
import { toDisplayString } from "vue";
import { renderList } from "vue";
import { onMounted } from "vue";
import { useId } from "vue";
import { normalizeClass } from "vue";
import { onBeforeUnmount } from "vue";
import { watch } from "vue";
import { createBlock } from "vue";
import { ref } from "vue";
import { withCtx } from "vue";
import { createCommentVNode } from "vue";
import { computed } from "vue";
import { reactive } from "vue";
import { isRef } from "vue";
import { createElementBlock } from "vue";
import { Fragment } from "vue";
import { createElementVNode } from "vue";
import { createTextVNode } from "vue";
import { unref } from "vue";
import { defineComponent } from "vue";
import { createVNode } from "vue";
import { openBlock } from "vue";
import { normalizeStyle } from "vue";
import { useRoute } from "#app";
import { NuxtLink } from "#components";
import { useApi } from "~/lib/auth.js";
import { assertSecurityComplete } from "~/lib/auth.js";
import { securityChallenge } from "~/lib/auth.js";
import { t as useSiteConfig_t } from "~/lib/useSiteConfig.js";
import button from "primevue/button";
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
import message from "primevue/message";
import inputtext from "primevue/inputtext";
import CaptchaField from "~/components/CaptchaField.vue";
import select from "primevue/select";
import ClientLevelDialog from "~/components/ClientLevelDialog.vue";
import { t as interval_t } from "~/lib/interval.js";
import password from "~/components/PasswordField.vue";
import PhoneCodeField from "~/components/PhoneCodeField.vue";
import skeleton from "primevue/skeleton";
import toggleswitch from "primevue/toggleswitch";
import { t as useCaptcha_t } from "~/lib/useCaptcha.js";
import SecurityVerificationDialog from "~/components/SecurityVerificationDialog.vue";
import SensitiveValue from "~/components/SensitiveValue.vue";
import index from "~/pages/account/realname/index.vue";
var Ce = {
class: `acct`,
},
we = {
key: 0,
class: `page-head`,
},
Te = {
class: `account-shortcuts`,
"aria-label": `账户管理`,
},
Ee = {
key: 1,
class: `panel`,
},
De = {
key: 2,
class: `panel`,
},
Oe = {
class: `tabs`,
role: `tablist`,
"aria-label": `账户设置`,
},
ke = [
`id`,
`aria-controls`,
`tabindex`,
`aria-selected`,
`onClick`,
`onKeydown`,
],
Ae = {
key: 2,
id: `account-panel-profile`,
role: `tabpanel`,
"aria-labelledby": `account-tab-profile`,
class: `panel`,
},
je = {
class: `field`,
},
Me = [`for`],
Ne = {
class: `field`,
},
Pe = [`for`],
Fe = {
class: `field`,
},
Ie = [`id`],
Le = {
class: `field`,
},
Re = [`for`],
ze = {
class: `field social-field`,
},
Be = {
class: `sec-desc`,
},
Ve = {
class: `actions`,
},
He = {
key: 3,
id: `account-panel-password`,
role: `tabpanel`,
"aria-labelledby": `account-tab-password`,
class: `panel`,
},
Ue = {
class: `field`,
},
We = [`for`],
Ge = {
key: 0,
class: `field`,
},
Ke = [`for`],
qe = {
class: `field`,
},
Je = [`for`],
Ye = {
class: `field`,
},
Xe = [`for`],
Ze = {
class: `field`,
},
Qe = [`for`],
$e = {
class: `field`,
},
et = [`for`],
tt = {
class: `actions`,
},
nt = {
key: 4,
id: `account-panel-operate`,
role: `tabpanel`,
"aria-labelledby": `account-tab-operate`,
class: `panel`,
},
rt = {
class: `field`,
},
it = [`for`],
at = {
class: `field`,
},
ot = [`for`],
st = {
class: `field`,
},
ct = [`for`],
lt = {
class: `actions`,
},
ut = {
key: 5,
id: `account-panel-phone`,
role: `tabpanel`,
"aria-labelledby": `account-tab-phone`,
class: `panel`,
},
dt = {
class: `sec-desc`,
},
ft = {
key: 0,
class: `field`,
},
pt = {
class: `field`,
},
mt = [`for`],
ht = {
class: `inline`,
},
gt = {
class: `actions`,
},
_t = {
class: `field`,
},
vt = [`for`],
bt = {
class: `inline`,
},
xt = {
class: `field`,
},
St = [`for`],
Ct = {
class: `inline`,
},
wt = {
class: `actions`,
},
Tt = {
key: 6,
id: `account-panel-email`,
role: `tabpanel`,
"aria-labelledby": `account-tab-email`,
class: `panel`,
},
Et = {
class: `sec-desc`,
},
Dt = {
key: 0,
class: `field`,
},
Ot = {
class: `field`,
},
kt = [`for`],
At = {
class: `inline`,
},
jt = {
class: `actions`,
},
Mt = {
class: `field`,
},
Nt = [`for`],
Pt = {
class: `field`,
},
Ft = [`for`],
It = {
class: `inline`,
},
Lt = {
class: `actions`,
},
Rt = {
key: 8,
id: `account-panel-warning`,
role: `tabpanel`,
"aria-labelledby": `account-tab-warning`,
class: `panel`,
},
zt = {
key: 0,
class: `sk`,
},
Bt = {
key: 1,
class: `warn-list`,
},
Vt = [`id`],
Ht = [`id`],
Ut = [`id`],
Wt = {
key: 0,
class: `warn-err`,
},
x = _plugin_vue_export_helper_t(
defineComponent({
__name: `index`,
setup(g) {
let b = useApi(),
x = useId(),
S = ref(null),
Gt = ref(!0),
C = computed(
() => S.value?.customfield?.idcsmart_client_level ?? null,
),
Kt = ref(!1),
{ lockedFields: qt, load: Jt } = useSiteConfig_t(),
w = (e) =>
qt.value.includes(e) &&
(![`phone`, `email`].includes(e) || !S.value || !!S.value[e]),
Yt = useRoute(),
T = ref(typeof Yt.query?.tab == `string` ? Yt.query.tab : `profile`),
E = [
{
value: `profile`,
label: `资料`,
},
{
value: `password`,
label: `密码`,
},
{
value: `phone`,
label: `手机号`,
},
{
value: `email`,
label: `邮箱`,
},
{
value: `realname`,
label: `实名认证`,
},
{
value: `operate`,
label: `操作密码`,
},
{
value: `warning`,
label: `流量预警`,
},
];
// 为账户设置标签提供左右方向键及 Home/End 导航,并同步实际焦点。
function Xt(e, t) {
let n;
if (e.key === `ArrowRight`) n = (t + 1) % E.length;
else if (e.key === `ArrowLeft`) n = (t + E.length - 1) % E.length;
else if (e.key === `Home`) n = 0;
else if (e.key === `End`) n = E.length - 1;
else return;
(e.preventDefault(),
(T.value = E[n].value),
document.getElementById(`account-tab-${T.value}`)?.focus());
}
let Zt = ref([]);
// 加载账户并回填资料表单,同时决定手机、邮箱是否需要先验证旧联系方式。
async function Qt() {
Gt.value = !0;
try {
let e = await b.get(`/account`);
((S.value = e.account),
(P.username = e.account.username || ``),
(P.company = e.account.company || ``),
(P.address = e.account.address || ``),
(P.country_id = e.account.country_id ?? null),
(J.value = e.account.phone ? 1 : 2),
(Z.value = e.account.email ? 1 : 2));
} catch (e) {
D.value = e instanceof Error ? e.message : `加载账户信息失败`;
} finally {
Gt.value = !1;
}
}
let $t = ref(!1);
// 国家选项按需加载;失败时保留空选项,后续仍可重新尝试。
async function en() {
if (!$t.value)
try {
let e = await b.get(`/country`);
((Zt.value = (e.list ?? []).map((e) => ({
...e,
name: e.name_zh || e.name,
}))),
($t.value = !0));
} catch {
Zt.value = [];
}
}
let D = ref(``),
O = ref(``),
k = ref(!1),
tn = ref({}),
A = ref(null),
j = ref(!1),
nn = ref(`update_password`);
function M() {
((D.value = ``), (O.value = ``));
}
function N(e, t) {
D.value = e instanceof Error ? e.message : t;
}
// 暂存安全挑战及原操作闭包,验证成功后以原表单快照继续提交。
function rn(e, t) {
((tn.value = e), (A.value = t), (k.value = !0));
}
// 把安全验证结果交给待续接操作;再次出现挑战时更新弹窗,不把尚未验证的结果当成功。
async function an(e) {
if (A.value && !j.value) {
((j.value = !0), (D.value = ``));
try {
(await A.value(e), (k.value = !1), (A.value = null));
} catch (e) {
let t = securityChallenge(e);
t
? ((tn.value = t), N(e, `安全验证尚未完成,请重试`))
: N(e, `安全验证失败,请重试`);
} finally {
j.value = !1;
}
}
}
let P = reactive({
username: ``,
company: ``,
address: ``,
country_id: null,
}),
on = ref(!1);
// 保存可编辑资料,同时保留当前账户已有的 language、notes 字段,避免更新接口覆盖它们。
async function sn() {
(M(), (on.value = !0));
try {
(await b.put(`/account`, {
language: S.value?.language ?? ``,
notes: S.value?.notes ?? ``,
username: P.username,
company: P.company,
address: P.address,
country_id: P.country_id ?? 0,
}),
(O.value = `保存成功`),
await Qt());
} catch (e) {
N(e, `保存失败`);
} finally {
on.value = !1;
}
}
// 取消编辑时从账户快照还原表单,不额外写入接口。
function cn() {
(M(),
S.value &&
((P.username = S.value.username || ``),
(P.company = S.value.company || ``),
(P.address = S.value.address || ``),
(P.country_id = S.value.country_id ?? null)));
}
let F = reactive({
old_password: ``,
new_password: ``,
repassword: ``,
}),
I = ref(!1),
L = ref(`password`),
R = ref(`phone`),
z = ref(``),
B = useCaptcha_t(`verify`),
{
needed: ln,
provider: un,
captchaId: dn,
img: fn,
value: pn,
loading: mn,
error: hn,
} = B,
V = ref(!1),
H = ref(0),
gn,
U = !1,
_n = computed(() => [
...(S.value?.phone
? [
{
label: `手机验证码`,
value: `phone`,
},
]
: []),
...(S.value?.email
? [
{
label: `邮箱验证码`,
value: `email`,
},
]
: []),
]);
(watch(_n, (e) => {
e.some((e) => e.value === R.value) ||
(R.value = e[0]?.value || `phone`);
}),
watch([L, R], () => {
((z.value = ``), M());
}),
onBeforeUnmount(() => {
((U = !0), clearInterval(gn), (A.value = null));
}));
// 向已绑定手机或邮箱发送 verify 验证码;成功后启动 60 秒倒计时,离页时清理计时器。
async function vn() {
if (
!(
V.value ||
H.value ||
!_n.value.some((e) => e.value === R.value)
) &&
((D.value = B.validationError()), !D.value)
) {
V.value = !0;
try {
if (
(await b.post(
R.value === `phone` ? `/phone/code` : `/email/code`,
{
action: `verify`,
captcha: B.value.value.trim(),
token: B.token.value,
},
),
U)
)
return;
((H.value = 60),
(gn = interval_t(() => {
--H.value <= 0 && clearInterval(gn);
}, 1e3)),
B.needed.value && B.load());
} catch (e) {
U || (N(e, `验证码发送失败`), await B.handleError(e));
} finally {
V.value = !1;
}
}
}
// 根据旧密码或验证码验证方式选择不同接口;密码一致性通过后才提交,安全挑战保留同一份请求数据。
async function yn() {
if (I.value || j.value || k.value || w(`password`)) return;
if (
(M(),
(L.value === `password` && !F.old_password) || !F.new_password)
) {
D.value = `请填写完整`;
return;
}
if (F.new_password !== F.repassword) {
D.value = `两次输入的新密码不一致`;
return;
}
if (
L.value === `code` &&
(!z.value.trim() || !_n.value.some((e) => e.value === R.value))
) {
D.value = `请选择已绑定的验证方式并填写验证码`;
return;
}
let e =
L.value === `code`
? `/account/password/code`
: `/account/password`,
t =
L.value === `code`
? {
type: R.value,
code: z.value.trim(),
password: F.new_password,
re_password: F.repassword,
}
: {
...F,
},
n = async (n) => {
let r = await b.put(e, {
...t,
...n,
});
(assertSecurityComplete(r),
!U &&
((O.value = `密码修改成功`),
(F.old_password =
F.new_password =
F.repassword =
z.value =
``)));
};
((nn.value = `update_password`), (I.value = !0));
try {
await n();
} catch (e) {
let t = securityChallenge(e);
if (t && !U) return rn(t, n);
N(e, `修改失败`);
} finally {
I.value = !1;
}
}
let bn = [
{
module: `mf_cloud`,
label: `云服务器`,
},
{
module: `mf_dcim`,
label: `独立服务器`,
},
],
xn = [5, 10, 15, 20],
W = ref({
mf_cloud: {
warning_switch: 0,
leave_percent: 0,
},
mf_dcim: {
warning_switch: 0,
leave_percent: 0,
},
}),
G = ref({}),
Sn = ref(!1),
Cn = ref(``);
// 分别加载云服务器与独立服务器的流量预警;单个模块失败只记录该模块错误。
async function wn() {
((Sn.value = !0), (G.value = {}));
try {
let e = await Promise.all(
bn.map(async (e) => {
try {
let t = await b.get(`/account/traffic_warning`, {
module: e.module,
}),
n = {
warning_switch: Number(t?.warning_switch ?? 0),
leave_percent: Number(t?.leave_percent ?? 0),
};
return {
module: e.module,
setting: n,
error: ``,
};
} catch (t) {
return {
module: e.module,
setting: {
warning_switch: 0,
leave_percent: 0,
},
error: t instanceof Error ? t.message : `加载失败`,
};
}
}),
),
t = {
...W.value,
},
n = {};
for (let r of e)
((t[r.module] = r.setting), r.error && (n[r.module] = r.error));
((W.value = t), (G.value = n));
} finally {
Sn.value = !1;
}
}
// 开启预警且未选阈值时提供初始比例;关闭状态的实际提交比例在保存时归零。
function Tn(e, t) {
let n = +!!t,
r = W.value[e];
((r.warning_switch = n),
n === 1 && !r.leave_percent && (r.leave_percent = xn[1]));
}
// 按模块保存预警开关和剩余流量比例,避免另一模块的草稿被一并提交。
async function En(e) {
let t = W.value[e];
if (t) {
((Cn.value = e), M());
try {
(await b.put(`/account/traffic_warning`, {
module: e,
warning_switch: +!!t.warning_switch,
leave_percent: t.warning_switch ? t.leave_percent : 0,
}),
(O.value = `流量预警设置已保存`));
} catch (e) {
N(e, `保存失败`);
} finally {
Cn.value = ``;
}
}
}
let K = reactive({
origin_operate_password: ``,
operate_password: ``,
re_operate_password: ``,
}),
Dn = ref(!1);
// 操作密码独立于登录密码;支持安全挑战续接,成功后清空密码输入。
async function On() {
if (Dn.value || j.value || k.value) return;
if ((M(), !K.operate_password)) {
D.value = `请输入新的操作密码`;
return;
}
if (K.operate_password !== K.re_operate_password) {
D.value = `两次输入的操作密码不一致`;
return;
}
let e = {
origin_operate_password: K.origin_operate_password,
operate_password: K.operate_password,
re_operate_password: K.re_operate_password,
},
t = async (t) => {
let n = await b.put(`/account/operate_password`, {
...e,
...t,
});
(assertSecurityComplete(n),
!U &&
((O.value = `操作密码修改成功`),
(K.origin_operate_password =
K.operate_password =
K.re_operate_password =
``)));
};
((nn.value = `update_operate_password`), (Dn.value = !0));
try {
await t();
} catch (e) {
let n = securityChallenge(e);
if (n && !U) return rn(n, t);
N(e, `修改失败`);
} finally {
Dn.value = !1;
}
}
let q = reactive({
newPhone: ``,
code: ``,
}),
J = ref(1),
Y = ref(!1),
kn = ref(``),
An = {
phone: {
verify: useCaptcha_t(`verify`),
update: useCaptcha_t(`update`),
},
email: {
verify: useCaptcha_t(`verify`),
update: useCaptcha_t(`update`),
},
};
// 统一联系方式 verify/update 场景的验证码请求,并由各自验证码实例处理挑战失效。
async function jn(e, t, n = {}) {
let r = An[e][t],
ee = r.validationError();
if (ee) throw Error(ee);
try {
(await b.post(`/${e}/code`, {
action: t,
...n,
captcha: r.value.value.trim(),
token: r.token.value,
}),
r.needed.value && (await r.load()));
} catch (e) {
throw (await r.handleError(e), e);
}
}
// 向当前绑定手机号发送旧号码验证短信。
async function Mn() {
if (!(Y.value || w(`phone`))) {
(M(), (Y.value = !0));
try {
(await jn(`phone`, `verify`),
(O.value = `验证码已发送至当前手机号`));
} catch (e) {
N(e, `发送失败`);
} finally {
Y.value = !1;
}
}
}
// 旧手机号验证通过后才进入新号码绑定步骤。
async function Nn() {
(M(), (Y.value = !0));
try {
(await b.put(`/account/phone/old`, {
code: kn.value,
}),
(J.value = 2),
(O.value = `原手机号验证通过`));
} catch (e) {
N(e, `验证失败`);
} finally {
Y.value = !1;
}
}
// 向草稿中的新手机号发送 update 场景验证码。
async function Pn() {
if (!(Y.value || w(`phone`))) {
(M(), (Y.value = !0));
try {
if (!q.newPhone.trim()) throw Error(`请输入新手机号`);
(await jn(`phone`, `update`, {
phone_code: 86,
phone: q.newPhone.trim(),
}),
(O.value = `验证码已发送`));
} catch (e) {
N(e, `发送失败`);
} finally {
Y.value = !1;
}
}
}
// 完成新号码绑定后重载账户,清空新旧验证码并复位步骤。
async function Fn() {
(M(), (Y.value = !0));
try {
(await b.put(`/account/phone`, {
phone_code: 86,
phone: q.newPhone,
code: q.code,
}),
(O.value = `手机号修改成功`),
(J.value = 1),
(q.newPhone = q.code = ``),
(kn.value = ``),
await Qt());
} catch (e) {
N(e, `修改失败`);
} finally {
Y.value = !1;
}
}
let X = reactive({
newEmail: ``,
code: ``,
}),
Z = ref(1),
Q = ref(!1),
In = ref(``),
$ = computed(() => {
let e = T.value === `phone` ? `phone` : `email`,
t = e === `phone` ? J.value : Z.value;
return An[e][t === 1 ? `verify` : `update`];
});
// 向当前绑定邮箱发送旧邮箱验证邮件。
async function Ln() {
if (!(Q.value || w(`email`))) {
(M(), (Q.value = !0));
try {
(await jn(`email`, `verify`),
(O.value = `验证码已发送至当前邮箱`));
} catch (e) {
N(e, `发送失败`);
} finally {
Q.value = !1;
}
}
}
// 旧邮箱验证通过后才进入新邮箱绑定步骤。
async function Rn() {
(M(), (Q.value = !0));
try {
(await b.put(`/account/email/old`, {
code: In.value,
}),
(Z.value = 2),
(O.value = `原邮箱验证通过`));
} catch (e) {
N(e, `验证失败`);
} finally {
Q.value = !1;
}
}
// 向草稿中的新邮箱发送 update 场景验证码。
async function zn() {
if (!(Q.value || w(`email`))) {
(M(), (Q.value = !0));
try {
if (!X.newEmail.trim()) throw Error(`请输入新邮箱`);
(await jn(`email`, `update`, {
email: X.newEmail.trim(),
}),
(O.value = `验证码已发送`));
} catch (e) {
N(e, `发送失败`);
} finally {
Q.value = !1;
}
}
}
// 提交新邮箱及验证码;成功后重载账户资料并清空步骤输入。
async function Bn() {
(M(), (Q.value = !0));
try {
(await b.put(`/account/email`, {
email: X.newEmail,
code: X.code,
}),
(O.value = `邮箱修改成功`),
(Z.value = 1),
(X.newEmail = X.code = ``),
(In.value = ``),
await Qt());
} catch (e) {
N(e, `修改失败`);
} finally {
Q.value = !1;
}
}
return (
watch(
T,
(e) => {
(M(), e === `profile` && en(), e === `warning` && wn());
},
{
immediate: !0,
},
),
onMounted(async () => {
(Jt().catch(() => {}), en(), await Qt(), (Gt.value = !1));
}),
// 按当前标签展示独立表单,锁定字段与安全验证弹窗共用账户配置;不要把某个标签的忙碌态误用于其他字段。
(n, r) => {
let te = NuxtLink,
ne = skeleton,
a = message,
c = button,
l = inputtext,
g = select,
y = password,
ae = CaptchaField,
oe = SensitiveValue,
se = toggleswitch,
ce = SecurityVerificationDialog,
b = ClientLevelDialog;
return (
openBlock(),
createElementBlock(`div`, Ce, [
unref(C)
? (openBlock(),
createElementBlock(`div`, we, [
unref(C)
? (openBlock(),
createElementBlock(
`button`,
{
key: 0,
type: `button`,
class: `level-badge`,
style: normalizeStyle({
color: unref(C).background_color || void 0,
borderColor:
unref(C).background_color || void 0,
}),
onClick: (r[0] ||= (e) => (Kt.value = !0)),
},
toDisplayString(unref(C).name),
5,
))
: createCommentVNode(``, !0),
]))
: createCommentVNode(``, !0),
createElementVNode(`nav`, Te, [
createVNode(
te,
{
to: `/account/api-keys`,
class: `account-management-link`,
},
{
default: withCtx(() => [
...(r[31] ||= [
createElementVNode(
`i`,
{
class: `pi pi-key`,
"aria-hidden": `true`,
},
null,
-1,
),
createTextVNode(`API 密钥`, -1),
]),
]),
_: 1,
},
),
createVNode(
te,
{
to: `/account/connections`,
class: `account-management-link`,
},
{
default: withCtx(() => [
...(r[32] ||= [
createElementVNode(
`i`,
{
class: `pi pi-link`,
"aria-hidden": `true`,
},
null,
-1,
),
createTextVNode(`关联账号`, -1),
]),
]),
_: 1,
},
),
]),
unref(Gt)
? (openBlock(),
createElementBlock(`div`, Ee, [
createVNode(ne, {
height: `200px`,
}),
]))
: unref(S)
? unref(S)
? (openBlock(),
createElementBlock(
Fragment,
{
key: 3,
},
[
createElementVNode(`div`, Oe, [
(openBlock(),
createElementBlock(
Fragment,
null,
renderList(E, (t, n) =>
createElementVNode(
`button`,
{
key: t.value,
id: `account-tab-${t.value}`,
"aria-controls": `account-panel-${t.value}`,
tabindex: unref(T) === t.value ? 0 : -1,
type: `button`,
role: `tab`,
class: normalizeClass([
`tab`,
{
active: unref(T) === t.value,
},
]),
"aria-selected": unref(T) === t.value,
onClick: (e) => (T.value = t.value),
onKeydown: (e) => Xt(e, n),
},
toDisplayString(t.label),
43,
ke,
),
),
64,
)),
]),
unref(D)
? (openBlock(),
createBlock(
a,
{
key: 0,
severity: `error`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(D)),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
unref(O)
? (openBlock(),
createBlock(
a,
{
key: 1,
severity: `success`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(O)),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
unref(T) === `profile`
? (openBlock(),
createElementBlock(`section`, Ae, [
(r[34] ||= createElementVNode(
`h3`,
{
class: `sec-title`,
},
`资料`,
-1,
)),
(r[35] ||= createElementVNode(
`p`,
{
class: `sec-desc`,
},
`请在此处更新您的个人信息。确保所有信息都是最新和准确的,以便我们能够及时联系您并提供更好的服务。`,
-1,
)),
(r[36] ||= createElementVNode(
`div`,
{
class: `divider`,
},
null,
-1,
)),
createElementVNode(`div`, je, [
createElementVNode(
`label`,
{
for: `${unref(x)}-p-username`,
},
`姓名`,
8,
Me,
),
createVNode(
l,
{
id: `${unref(x)}-p-username`,
modelValue: unref(P).username,
"onUpdate:modelValue": (r[1] ||= (e) =>
(unref(P).username = e)),
placeholder: `输入您的姓名`,
fluid: ``,
},
null,
8,
[`id`, `modelValue`],
),
]),
createElementVNode(`div`, Ne, [
createElementVNode(
`label`,
{
for: `${unref(x)}-p-company`,
},
`组织机构名称`,
8,
Pe,
),
createVNode(
l,
{
id: `${unref(x)}-p-company`,
modelValue: unref(P).company,
"onUpdate:modelValue": (r[2] ||= (e) =>
(unref(P).company = e)),
placeholder: `输入您的组织机构名称`,
fluid: ``,
},
null,
8,
[`id`, `modelValue`],
),
]),
createElementVNode(`div`, Fe, [
createElementVNode(
`span`,
{
id: `${unref(x)}-country-label`,
class: `field-label`,
},
`国家/地区`,
8,
Ie,
),
createVNode(
g,
{
"aria-labelledby": `${unref(x)}-country-label`,
modelValue: unref(P).country_id,
"onUpdate:modelValue": (r[3] ||= (e) =>
(unref(P).country_id = e)),
options: unref(Zt),
optionLabel: `name`,
optionValue: `id`,
filter: ``,
placeholder: `选择国家/地区`,
fluid: ``,
},
null,
8,
[
`aria-labelledby`,
`modelValue`,
`options`,
],
),
]),
createElementVNode(`div`, Le, [
createElementVNode(
`label`,
{
for: `${unref(x)}-p-address`,
},
`地址`,
8,
Re,
),
createVNode(
l,
{
id: `${unref(x)}-p-address`,
modelValue: unref(P).address,
"onUpdate:modelValue": (r[4] ||= (e) =>
(unref(P).address = e)),
placeholder: `输入您的地址`,
fluid: ``,
},
null,
8,
[`id`, `modelValue`],
),
]),
createElementVNode(`div`, ze, [
(r[33] ||= createElementVNode(
`label`,
null,
`社交账户(关联后可快捷登录)`,
-1,
)),
createElementVNode(
`p`,
Be,
toDisplayString(
unref(S).oauth?.length
? `已关联 ${unref(S).oauth.length} 个社交账户`
: `当前未启用社交登录渠道`,
),
1,
),
]),
createElementVNode(`div`, Ve, [
createVNode(c, {
label: `取消`,
icon: `pi pi-times`,
severity: `secondary`,
outlined: ``,
onClick: cn,
}),
createVNode(
c,
{
label: `保存变更`,
icon: `pi pi-check`,
loading: unref(on),
onClick: sn,
},
null,
8,
[`loading`],
),
]),
]))
: unref(T) === `password`
? (openBlock(),
createElementBlock(`section`, He, [
(r[38] ||= createElementVNode(
`h3`,
{
class: `sec-title`,
},
`密码`,
-1,
)),
(r[39] ||= createElementVNode(
`p`,
{
class: `sec-desc`,
},
`定期更换密码可以提升账户安全性。新密码需包含字母与数字,长度不少于 6 位。`,
-1,
)),
(r[40] ||= createElementVNode(
`div`,
{
class: `divider`,
},
null,
-1,
)),
w(`password`)
? (openBlock(),
createBlock(
a,
{
key: 0,
severity: `info`,
closable: !1,
},
{
default: withCtx(() => [
...(r[37] ||= [
createTextVNode(
` 站点已禁止自行修改密码,如需变更请联系客服。 `,
-1,
),
]),
]),
_: 1,
},
))
: (openBlock(),
createElementBlock(
Fragment,
{
key: 1,
},
[
createElementVNode(`div`, Ue, [
createElementVNode(
`label`,
{
for: `${unref(x)}-password-mode`,
},
`验证方式`,
8,
We,
),
createVNode(
g,
{
"input-id": `${unref(x)}-password-mode`,
modelValue: unref(L),
"onUpdate:modelValue":
(r[5] ||= (e) =>
isRef(L)
? (L.value = e)
: null),
options: [
{
label: `当前密码`,
value: `password`,
},
{
label: `绑定联系方式验证码`,
value: `code`,
disabled:
!unref(_n).length,
},
],
"option-label": `label`,
"option-value": `value`,
"option-disabled": `disabled`,
disabled:
unref(I) || unref(k),
},
null,
8,
[
`input-id`,
`modelValue`,
`options`,
`disabled`,
],
),
]),
unref(L) === `password`
? (openBlock(),
createElementBlock(`div`, Ge, [
createElementVNode(
`label`,
{
for: `${unref(x)}-old-pwd`,
},
`当前密码`,
8,
Ke,
),
createVNode(
y,
{
"input-id": `${unref(x)}-old-pwd`,
modelValue:
unref(F).old_password,
"onUpdate:modelValue":
(r[6] ||= (e) =>
(unref(
F,
).old_password = e)),
feedback: !1,
toggleMask: ``,
fluid: ``,
placeholder: `输入当前密码`,
autocomplete: `current-password`,
},
null,
8,
[`input-id`, `modelValue`],
),
]))
: (openBlock(),
createElementBlock(
Fragment,
{
key: 1,
},
[
createElementVNode(
`div`,
qe,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-password-method`,
},
`接收验证码`,
8,
Je,
),
createVNode(
g,
{
"input-id": `${unref(x)}-password-method`,
modelValue:
unref(R),
"onUpdate:modelValue":
(r[7] ||= (e) =>
isRef(R)
? (R.value =
e)
: null),
options: unref(_n),
"option-label": `label`,
"option-value": `value`,
disabled:
unref(I) ||
unref(V),
},
null,
8,
[
`input-id`,
`modelValue`,
`options`,
`disabled`,
],
),
],
),
createElementVNode(
`div`,
Ye,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-password-code`,
},
`验证码`,
8,
Xe,
),
createVNode(
l,
{
id: `${unref(x)}-password-code`,
modelValue:
unref(z),
"onUpdate:modelValue":
(r[8] ||= (e) =>
isRef(z)
? (z.value =
e)
: null),
autocomplete: `one-time-code`,
},
null,
8,
[`id`, `modelValue`],
),
createVNode(
c,
{
label: unref(H)
? `${unref(H)}s`
: `获取验证码`,
loading: unref(V),
disabled:
unref(H) > 0 ||
unref(I),
onClick: vn,
},
null,
8,
[
`label`,
`loading`,
`disabled`,
],
),
],
),
unref(ln)
? (openBlock(),
createBlock(
ae,
{
key: 0,
modelValue:
unref(pn),
"onUpdate:modelValue":
(r[9] ||= (e) =>
isRef(pn)
? (pn.value =
e)
: null),
img: unref(fn),
provider: unref(un),
"captcha-id":
unref(dn),
loading: unref(mn),
disabled:
unref(V) ||
unref(I),
onVerified:
unref(B).complete,
onInvalid:
unref(B)
.invalidate,
onRefresh:
unref(B).load,
},
null,
8,
[
`modelValue`,
`img`,
`provider`,
`captcha-id`,
`loading`,
`disabled`,
`onVerified`,
`onInvalid`,
`onRefresh`,
],
))
: createCommentVNode(
``,
!0,
),
unref(hn)
? (openBlock(),
createBlock(
a,
{
key: 1,
severity: `error`,
closable: !1,
},
{
default: withCtx(
() => [
createTextVNode(
toDisplayString(
unref(hn),
),
1,
),
],
),
_: 1,
},
))
: createCommentVNode(
``,
!0,
),
],
64,
)),
createElementVNode(`div`, Ze, [
createElementVNode(
`label`,
{
for: `${unref(x)}-new-pwd`,
},
`新密码`,
8,
Qe,
),
createVNode(
y,
{
"input-id": `${unref(x)}-new-pwd`,
modelValue:
unref(F).new_password,
"onUpdate:modelValue":
(r[10] ||= (e) =>
(unref(F).new_password =
e)),
feedback: !1,
toggleMask: ``,
fluid: ``,
placeholder: `输入新密码`,
autocomplete: `new-password`,
},
null,
8,
[`input-id`, `modelValue`],
),
]),
createElementVNode(`div`, $e, [
createElementVNode(
`label`,
{
for: `${unref(x)}-re-pwd`,
},
`确认新密码`,
8,
et,
),
createVNode(
y,
{
"input-id": `${unref(x)}-re-pwd`,
modelValue:
unref(F).repassword,
"onUpdate:modelValue":
(r[11] ||= (e) =>
(unref(F).repassword =
e)),
feedback: !1,
toggleMask: ``,
fluid: ``,
placeholder: `再次输入新密码`,
autocomplete: `new-password`,
},
null,
8,
[`input-id`, `modelValue`],
),
]),
createElementVNode(`div`, tt, [
createVNode(c, {
label: `取消`,
icon: `pi pi-times`,
severity: `secondary`,
outlined: ``,
onClick: (r[12] ||= (e) =>
(unref(F).old_password =
unref(F).new_password =
unref(F).repassword =
``)),
}),
createVNode(
c,
{
label: `保存变更`,
icon: `pi pi-check`,
loading: unref(I),
onClick: yn,
},
null,
8,
[`loading`],
),
]),
],
64,
)),
]))
: unref(T) === `operate`
? (openBlock(),
createElementBlock(`section`, nt, [
(r[41] ||= createElementVNode(
`h3`,
{
class: `sec-title`,
},
`操作密码`,
-1,
)),
(r[42] ||= createElementVNode(
`p`,
{
class: `sec-desc`,
},
` 关机、重启、重置密码、重装系统等敏感操作需要验证操作密码。首次设置时无需填写原密码。 `,
-1,
)),
(r[43] ||= createElementVNode(
`div`,
{
class: `divider`,
},
null,
-1,
)),
createElementVNode(`div`, rt, [
createElementVNode(
`label`,
{
for: `${unref(x)}-old-opwd`,
},
`原操作密码`,
8,
it,
),
createVNode(
y,
{
"input-id": `${unref(x)}-old-opwd`,
modelValue:
unref(K).origin_operate_password,
"onUpdate:modelValue": (r[13] ||= (
e,
) =>
(unref(
K,
).origin_operate_password = e)),
feedback: !1,
toggleMask: ``,
fluid: ``,
placeholder: `尚未设置过则留空`,
},
null,
8,
[`input-id`, `modelValue`],
),
]),
createElementVNode(`div`, at, [
createElementVNode(
`label`,
{
for: `${unref(x)}-new-opwd`,
},
`新操作密码`,
8,
ot,
),
createVNode(
y,
{
"input-id": `${unref(x)}-new-opwd`,
modelValue:
unref(K).operate_password,
"onUpdate:modelValue": (r[14] ||= (
e,
) =>
(unref(K).operate_password = e)),
feedback: !1,
toggleMask: ``,
fluid: ``,
placeholder: `输入新的操作密码`,
},
null,
8,
[`input-id`, `modelValue`],
),
]),
createElementVNode(`div`, st, [
createElementVNode(
`label`,
{
for: `${unref(x)}-re-opwd`,
},
`确认新操作密码`,
8,
ct,
),
createVNode(
y,
{
"input-id": `${unref(x)}-re-opwd`,
modelValue:
unref(K).re_operate_password,
"onUpdate:modelValue": (r[15] ||= (
e,
) =>
(unref(K).re_operate_password =
e)),
feedback: !1,
toggleMask: ``,
fluid: ``,
placeholder: `再次输入新的操作密码`,
},
null,
8,
[`input-id`, `modelValue`],
),
]),
createElementVNode(`div`, lt, [
createVNode(c, {
label: `取消`,
icon: `pi pi-times`,
severity: `secondary`,
outlined: ``,
onClick: (r[16] ||= (e) =>
(unref(K).origin_operate_password =
unref(K).operate_password =
unref(K).re_operate_password =
``)),
}),
createVNode(
c,
{
label: `保存变更`,
icon: `pi pi-check`,
loading: unref(Dn),
onClick: On,
},
null,
8,
[`loading`],
),
]),
]))
: unref(T) === `phone`
? (openBlock(),
createElementBlock(`section`, ut, [
(r[46] ||= createElementVNode(
`h3`,
{
class: `sec-title`,
},
`手机号`,
-1,
)),
createElementVNode(`p`, dt, [
(r[44] ||= createTextVNode(
`当前绑定:`,
-1,
)),
createVNode(
oe,
{
value: unref(S).phone,
kind: `phone`,
label: `手机号`,
prefix: `+${unref(S).phone_code || 86}`,
"reset-key": unref(S).id,
placeholder: `未绑定`,
},
null,
8,
[`value`, `prefix`, `reset-key`],
),
createTextVNode(
`。` +
toDisplayString(
unref(S).phone
? `修改手机号需要先验证原手机号,再验证新手机号。`
: `当前未绑定手机号,请完成新手机号验证。`,
),
1,
),
]),
(r[47] ||= createElementVNode(
`div`,
{
class: `divider`,
},
null,
-1,
)),
w(`phone`)
? createCommentVNode(``, !0)
: (openBlock(),
createElementBlock(`div`, ft, [
unref($).needed.value
? (openBlock(),
createBlock(
ae,
{
key: `phone-${unref(J)}`,
modelValue:
unref($).value.value,
"onUpdate:modelValue":
(r[17] ||= (e) =>
(unref(
$,
).value.value = e)),
img: unref($).img.value,
provider:
unref($).provider.value,
"captcha-id":
unref($).captchaId
.value,
loading:
unref($).loading.value,
disabled: unref(Y),
onVerified:
unref($).complete,
onInvalid:
unref($).invalidate,
onRefresh: unref($).load,
},
null,
8,
[
`modelValue`,
`img`,
`provider`,
`captcha-id`,
`loading`,
`disabled`,
`onVerified`,
`onInvalid`,
`onRefresh`,
],
))
: createCommentVNode(``, !0),
unref($).error.value
? (openBlock(),
createBlock(
a,
{
key: 1,
severity: `error`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(
unref($).error
.value,
),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
])),
w(`phone`)
? (openBlock(),
createBlock(
a,
{
key: 1,
severity: `info`,
closable: !1,
},
{
default: withCtx(() => [
...(r[45] ||= [
createTextVNode(
` 站点已禁止自行修改手机号,如需变更请联系客服。 `,
-1,
),
]),
]),
_: 1,
},
))
: unref(J) === 1
? (openBlock(),
createElementBlock(
Fragment,
{
key: 2,
},
[
createElementVNode(
`div`,
pt,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-old-phone-code`,
},
`原手机验证码`,
8,
mt,
),
createElementVNode(
`div`,
ht,
[
createVNode(
l,
{
id: `${unref(x)}-old-phone-code`,
modelValue:
unref(kn),
"onUpdate:modelValue":
(r[18] ||= (
e,
) =>
isRef(kn)
? (kn.value =
e)
: null),
placeholder: `输入收到的验证码`,
},
null,
8,
[
`id`,
`modelValue`,
],
),
createVNode(
c,
{
label: `获取验证码`,
severity: `secondary`,
outlined: ``,
loading: unref(Y),
onClick: Mn,
},
null,
8,
[`loading`],
),
],
),
],
),
createElementVNode(
`div`,
gt,
[
createVNode(
c,
{
label: `下一步`,
icon: `pi pi-arrow-right`,
loading: unref(Y),
onClick: Nn,
},
null,
8,
[`loading`],
),
],
),
],
64,
))
: (openBlock(),
createElementBlock(
Fragment,
{
key: 3,
},
[
createElementVNode(
`div`,
_t,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-new-phone`,
},
`新手机号`,
8,
vt,
),
createElementVNode(
`div`,
bt,
[
createVNode(
PhoneCodeField,
),
createVNode(
l,
{
id: `${unref(x)}-new-phone`,
modelValue:
unref(q)
.newPhone,
"onUpdate:modelValue":
(r[20] ||= (
e,
) =>
(unref(
q,
).newPhone =
e)),
placeholder: `输入新手机号`,
},
null,
8,
[
`id`,
`modelValue`,
],
),
],
),
],
),
createElementVNode(
`div`,
xt,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-new-phone-code`,
},
`新手机验证码`,
8,
St,
),
createElementVNode(
`div`,
Ct,
[
createVNode(
l,
{
id: `${unref(x)}-new-phone-code`,
modelValue:
unref(q).code,
"onUpdate:modelValue":
(r[21] ||= (
e,
) =>
(unref(
q,
).code = e)),
placeholder: `输入收到的验证码`,
},
null,
8,
[
`id`,
`modelValue`,
],
),
createVNode(
c,
{
label: `获取验证码`,
severity: `secondary`,
outlined: ``,
loading: unref(Y),
onClick: Pn,
},
null,
8,
[`loading`],
),
],
),
],
),
createElementVNode(
`div`,
wt,
[
createVNode(c, {
label: `上一步`,
severity: `secondary`,
text: ``,
onClick: (r[22] ||= (
e,
) => (J.value = 1)),
}),
createVNode(
c,
{
label: `保存变更`,
icon: `pi pi-check`,
loading: unref(Y),
onClick: Fn,
},
null,
8,
[`loading`],
),
],
),
],
64,
)),
]))
: unref(T) === `email`
? (openBlock(),
createElementBlock(`section`, Tt, [
(r[50] ||= createElementVNode(
`h3`,
{
class: `sec-title`,
},
`邮箱`,
-1,
)),
createElementVNode(`p`, Et, [
(r[48] ||= createTextVNode(
`当前绑定:`,
-1,
)),
createVNode(
oe,
{
value: unref(S).email,
kind: `email`,
label: `邮箱`,
"reset-key": unref(S).id,
placeholder: `未绑定`,
},
null,
8,
[`value`, `reset-key`],
),
createTextVNode(
`。` +
toDisplayString(
unref(S).email
? `修改邮箱需要先验证原邮箱,再验证新邮箱。`
: `当前未绑定邮箱,请完成新邮箱验证。`,
),
1,
),
]),
(r[51] ||= createElementVNode(
`div`,
{
class: `divider`,
},
null,
-1,
)),
w(`email`)
? createCommentVNode(``, !0)
: (openBlock(),
createElementBlock(`div`, Dt, [
unref($).needed.value
? (openBlock(),
createBlock(
ae,
{
key: `email-${unref(Z)}`,
modelValue:
unref($).value.value,
"onUpdate:modelValue":
(r[23] ||= (e) =>
(unref(
$,
).value.value = e)),
img: unref($).img.value,
provider:
unref($).provider
.value,
"captcha-id":
unref($).captchaId
.value,
loading:
unref($).loading
.value,
disabled: unref(Q),
onVerified:
unref($).complete,
onInvalid:
unref($).invalidate,
onRefresh:
unref($).load,
},
null,
8,
[
`modelValue`,
`img`,
`provider`,
`captcha-id`,
`loading`,
`disabled`,
`onVerified`,
`onInvalid`,
`onRefresh`,
],
))
: createCommentVNode(``, !0),
unref($).error.value
? (openBlock(),
createBlock(
a,
{
key: 1,
severity: `error`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(
unref($).error
.value,
),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
])),
w(`email`)
? (openBlock(),
createBlock(
a,
{
key: 1,
severity: `info`,
closable: !1,
},
{
default: withCtx(() => [
...(r[49] ||= [
createTextVNode(
` 站点已禁止自行修改邮箱,如需变更请联系客服。 `,
-1,
),
]),
]),
_: 1,
},
))
: unref(Z) === 1
? (openBlock(),
createElementBlock(
Fragment,
{
key: 2,
},
[
createElementVNode(
`div`,
Ot,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-old-email-code`,
},
`原邮箱验证码`,
8,
kt,
),
createElementVNode(
`div`,
At,
[
createVNode(
l,
{
id: `${unref(x)}-old-email-code`,
modelValue:
unref(In),
"onUpdate:modelValue":
(r[24] ||= (
e,
) =>
isRef(In)
? (In.value =
e)
: null),
placeholder: `输入收到的验证码`,
},
null,
8,
[
`id`,
`modelValue`,
],
),
createVNode(
c,
{
label: `获取验证码`,
severity: `secondary`,
outlined: ``,
loading:
unref(Q),
onClick: Ln,
},
null,
8,
[`loading`],
),
],
),
],
),
createElementVNode(
`div`,
jt,
[
createVNode(
c,
{
label: `下一步`,
icon: `pi pi-arrow-right`,
loading: unref(Q),
onClick: Rn,
},
null,
8,
[`loading`],
),
],
),
],
64,
))
: (openBlock(),
createElementBlock(
Fragment,
{
key: 3,
},
[
createElementVNode(
`div`,
Mt,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-new-email`,
},
`新邮箱`,
8,
Nt,
),
createVNode(
l,
{
id: `${unref(x)}-new-email`,
modelValue:
unref(X).newEmail,
"onUpdate:modelValue":
(r[25] ||= (e) =>
(unref(
X,
).newEmail =
e)),
placeholder: `输入新邮箱`,
fluid: ``,
},
null,
8,
[`id`, `modelValue`],
),
],
),
createElementVNode(
`div`,
Pt,
[
createElementVNode(
`label`,
{
for: `${unref(x)}-new-email-code`,
},
`新邮箱验证码`,
8,
Ft,
),
createElementVNode(
`div`,
It,
[
createVNode(
l,
{
id: `${unref(x)}-new-email-code`,
modelValue:
unref(X).code,
"onUpdate:modelValue":
(r[26] ||= (
e,
) =>
(unref(
X,
).code =
e)),
placeholder: `输入收到的验证码`,
},
null,
8,
[
`id`,
`modelValue`,
],
),
createVNode(
c,
{
label: `获取验证码`,
severity: `secondary`,
outlined: ``,
loading:
unref(Q),
onClick: zn,
},
null,
8,
[`loading`],
),
],
),
],
),
createElementVNode(
`div`,
Lt,
[
createVNode(c, {
label: `上一步`,
severity: `secondary`,
text: ``,
onClick: (r[27] ||= (
e,
) => (Z.value = 1)),
}),
createVNode(
c,
{
label: `保存变更`,
icon: `pi pi-check`,
loading: unref(Q),
onClick: Bn,
},
null,
8,
[`loading`],
),
],
),
],
64,
)),
]))
: unref(T) === `realname`
? (openBlock(),
createBlock(index, {
key: 7,
embedded: ``,
}))
: (openBlock(),
createElementBlock(`section`, Rt, [
(r[52] ||= createElementVNode(
`h3`,
{
class: `sec-title`,
},
`流量预警`,
-1,
)),
(r[53] ||= createElementVNode(
`p`,
{
class: `sec-desc`,
},
` 开启后,当实例剩余流量低于设定比例时会通过站内信 / 邮件提醒你,避免因流量耗尽导致服务中断。 `,
-1,
)),
(r[54] ||= createElementVNode(
`div`,
{
class: `divider`,
},
null,
-1,
)),
unref(Sn)
? (openBlock(),
createElementBlock(`div`, zt, [
createVNode(ne, {
height: `80px`,
}),
]))
: (openBlock(),
createElementBlock(`div`, Bt, [
(openBlock(),
createElementBlock(
Fragment,
null,
renderList(bn, (t) =>
createElementVNode(
`div`,
{
key: t.module,
class: `warn-row`,
},
[
createElementVNode(
`div`,
{
id: `${unref(x)}-${t.module}-label`,
class: `warn-name`,
},
toDisplayString(
t.label,
),
9,
Vt,
),
createElementVNode(
`span`,
{
id: `${unref(x)}-${t.module}-percent-label`,
class: `sr-only`,
},
`剩余流量预警比例`,
8,
Ht,
),
createElementVNode(
`span`,
{
id: `${unref(x)}-${t.module}-switch-label`,
class: `sr-only`,
},
`启用流量预警`,
8,
Ut,
),
unref(G)[t.module]
? (openBlock(),
createElementBlock(
`span`,
Wt,
toDisplayString(
unref(G)[
t.module
],
),
1,
))
: createCommentVNode(
``,
!0,
),
createVNode(
g,
{
modelValue:
unref(W)[
t.module
].leave_percent,
"onUpdate:modelValue":
(e) =>
(unref(W)[
t.module
].leave_percent =
e),
"aria-labelledby": `${unref(x)}-${t.module}-label ${unref(x)}-${t.module}-percent-label`,
options: xn,
disabled:
!!unref(G)[
t.module
] ||
!unref(W)[
t.module
]
?.warning_switch,
class: `warn-select`,
},
{
option: withCtx(
({
option: t,
}) => [
createTextVNode(
`剩余 ` +
toDisplayString(
t,
) +
`%`,
1,
),
],
),
value: withCtx(
({
value: t,
}) => [
createTextVNode(
toDisplayString(
t
? `剩余 ${t}%`
: `未设置`,
),
1,
),
],
),
_: 1,
},
8,
[
`modelValue`,
`onUpdate:modelValue`,
`aria-labelledby`,
`disabled`,
],
),
createVNode(
se,
{
"aria-labelledby": `${unref(x)}-${t.module}-label ${unref(x)}-${t.module}-switch-label`,
modelValue:
unref(W)[
t.module
]
.warning_switch,
trueValue: 1,
falseValue: 0,
disabled:
!!unref(G)[
t.module
],
"onUpdate:modelValue":
(e) =>
Tn(
t.module,
!!e,
),
},
null,
8,
[
`aria-labelledby`,
`modelValue`,
`disabled`,
`onUpdate:modelValue`,
],
),
createVNode(
c,
{
label: `保存`,
size: `small`,
loading:
unref(Cn) ===
t.module,
disabled:
!!unref(G)[
t.module
],
onClick: (e) =>
En(t.module),
},
null,
8,
[
`loading`,
`disabled`,
`onClick`,
],
),
],
),
),
64,
)),
])),
])),
],
64,
))
: createCommentVNode(``, !0)
: (openBlock(),
createElementBlock(`div`, De, [
createVNode(
a,
{
severity: `error`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(
unref(D) || `账户信息加载失败,请稍后重试`,
),
1,
),
]),
_: 1,
},
),
createVNode(c, {
label: `重试`,
severity: `secondary`,
text: ``,
onClick: Qt,
}),
])),
createVNode(
ce,
{
visible: unref(k),
"onUpdate:visible": (r[28] ||= (e) =>
isRef(k) ? (k.value = e) : null),
challenge: unref(tn),
busy: unref(j),
"request-error": unref(D),
context: {
scene: `account`,
action: unref(nn),
},
onVerified: an,
onCancel: (r[29] ||= (e) => (A.value = null)),
},
null,
8,
[`visible`, `challenge`, `busy`, `request-error`, `context`],
),
createVNode(
b,
{
modelValue: unref(Kt),
"onUpdate:modelValue": (r[30] ||= (e) =>
isRef(Kt) ? (Kt.value = e) : null),
"account-level": unref(C),
},
null,
8,
[`modelValue`, `account-level`],
),
])
);
}
);
},
}),
[[`__scopeId`, `data-v-8ca4eb3d`]],
);
export {};
export default x;
</script>