de3fd0945b
Signed-off-by: Dinger <quantdinger@gmail.com>
1 line
46 KiB
JavaScript
1 line
46 KiB
JavaScript
"use strict";(self["webpackChunkvue_antd_pro"]=self["webpackChunkvue_antd_pro"]||[]).push([[878],{68083:function(e,t,a){a.r(t),a.d(t,{default:function(){return h}});var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"profile-page",class:{"theme-dark":e.isDarkTheme}},[t("div",{staticClass:"page-header"},[t("h2",{staticClass:"page-title"},[t("a-icon",{attrs:{type:"user"}}),t("span",[e._v(e._s(e.$t("profile.title")||"My Profile"))])],1),t("p",{staticClass:"page-desc"},[e._v(e._s(e.$t("profile.description")||"Manage your account settings and preferences"))])]),t("a-row",{staticClass:"profile-cards-row",attrs:{gutter:24}},[t("a-col",{staticClass:"profile-card-col",attrs:{xs:24,md:8}},[t("a-card",{staticClass:"profile-card",attrs:{bordered:!1}},[t("div",{staticClass:"avatar-section"},[t("a-avatar",{attrs:{size:100,src:e.profile.avatar||"/avatar2.jpg"}}),t("h3",{staticClass:"username"},[e._v(e._s(e.profile.nickname||e.profile.username))]),t("p",{staticClass:"user-role"},[t("a-tag",{attrs:{color:e.getRoleColor(e.profile.role)}},[e._v(" "+e._s(e.getRoleLabel(e.profile.role))+" ")]),e.isVip?t("a-tag",{attrs:{color:"gold"}},[t("a-icon",{attrs:{type:"crown"}}),e._v(" VIP ")],1):e._e()],1)],1),t("a-divider"),t("div",{staticClass:"profile-info"},[t("div",{staticClass:"info-item"},[t("a-icon",{attrs:{type:"user"}}),t("span",{staticClass:"label"},[e._v(e._s(e.$t("profile.username")||"Username")+":")]),t("span",{staticClass:"value"},[e._v(e._s(e.profile.username))])],1),t("div",{staticClass:"info-item"},[t("a-icon",{attrs:{type:"mail"}}),t("span",{staticClass:"label"},[e._v(e._s(e.$t("profile.email")||"Email")+":")]),t("span",{staticClass:"value"},[e._v(e._s(e.profile.email||"-"))])],1),t("div",{staticClass:"info-item"},[t("a-icon",{attrs:{type:"calendar"}}),t("span",{staticClass:"label"},[e._v(e._s(e.$t("profile.lastLogin")||"Last Login")+":")]),t("span",{staticClass:"value"},[e._v(e._s(e.formatTime(e.profile.last_login_at)||"-"))])],1)])],1)],1),t("a-col",{staticClass:"right-cards-col",attrs:{xs:24,md:16}},[t("a-row",{staticClass:"right-cards-row",attrs:{gutter:16}},[t("a-col",{attrs:{xs:24,md:12}},[t("a-card",{staticClass:"credits-card",attrs:{bordered:!1}},[t("div",{staticClass:"credits-header"},[t("h3",{staticClass:"credits-title"},[t("a-icon",{attrs:{type:"wallet"}}),e._v(" "+e._s(e.$t("profile.credits.title")||"我的积分")+" ")],1)]),t("div",{staticClass:"credits-body"},[t("div",{staticClass:"credits-amount"},[t("span",{staticClass:"amount-value"},[e._v(e._s(e.formatCredits(e.billing.credits)))]),t("span",{staticClass:"amount-label"},[e._v(e._s(e.$t("profile.credits.unit")||"积分"))])]),e.billing.vip_expires_at?t("div",{staticClass:"vip-status"},[t("a-icon",{style:{color:e.isVip?"#faad14":"#999"},attrs:{type:"crown"}}),e.isVip?t("span",{staticClass:"vip-active"},[e._v(" "+e._s(e.$t("profile.credits.vipExpires")||"VIP有效期至")+": "+e._s(e.formatDate(e.billing.vip_expires_at))+" ")]):t("span",{staticClass:"vip-expired"},[e._v(" "+e._s(e.$t("profile.credits.vipExpired")||"VIP已过期")+" ")])],1):e.billing.is_vip?e._e():t("div",{staticClass:"vip-status"},[t("span",{staticClass:"no-vip"},[e._v(e._s(e.$t("profile.credits.noVip")||"非VIP用户"))])])]),t("a-divider"),t("div",{staticClass:"credits-actions"},[t("a-button",{attrs:{type:"primary",icon:"shopping"},on:{click:e.handleRecharge}},[e._v(" "+e._s(e.$t("profile.credits.recharge")||"开通/充值")+" ")])],1),e.billing.billing_enabled?t("div",{staticClass:"credits-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.credits.hint")||"使用AI分析/回测/监控等功能会消耗积分;VIP仅可免费使用VIP免费指标。"))])],1):e._e()],1)],1),t("a-col",{attrs:{xs:24,md:12}},[t("a-card",{staticClass:"referral-card",attrs:{bordered:!1}},[t("div",{staticClass:"referral-header"},[t("h3",{staticClass:"referral-title"},[t("a-icon",{attrs:{type:"team"}}),e._v(" "+e._s(e.$t("profile.referral.title")||"邀请好友")+" ")],1)]),t("div",{staticClass:"referral-body"},[t("div",{staticClass:"referral-stats"},[t("div",{staticClass:"stat-item"},[t("span",{staticClass:"stat-value"},[e._v(e._s(e.referralData.total||0))]),t("span",{staticClass:"stat-label"},[e._v(e._s(e.$t("profile.referral.totalInvited")||"已邀请"))])]),e.referralData.referral_bonus>0?t("div",{staticClass:"stat-item"},[t("span",{staticClass:"stat-value"},[e._v("+"+e._s(e.referralData.referral_bonus))]),t("span",{staticClass:"stat-label"},[e._v(e._s(e.$t("profile.referral.bonusPerInvite")||"每邀请获得"))])]):e._e()]),t("a-divider",{staticStyle:{margin:"12px 0"}}),t("div",{staticClass:"referral-link-section"},[t("div",{staticClass:"link-label"},[e._v(e._s(e.$t("profile.referral.yourLink")||"您的邀请链接"))]),t("div",{staticClass:"link-box"},[t("a-input",{attrs:{value:e.referralLink,readonly:"",size:"small"}},[t("a-tooltip",{attrs:{slot:"suffix",title:e.$t("profile.referral.copyLink")||"复制链接"},slot:"suffix"},[t("a-icon",{staticStyle:{cursor:"pointer"},attrs:{type:"copy"},on:{click:e.copyReferralLink}})],1)],1)],1)]),e.referralData.register_bonus>0?t("div",{staticClass:"referral-hint"},[t("a-icon",{attrs:{type:"gift"}}),t("span",[e._v(e._s(e.$t("profile.referral.newUserBonus")||"新用户注册获得")+" "+e._s(e.referralData.register_bonus)+" "+e._s(e.$t("profile.credits.unit")||"积分"))])],1):e._e()],1)])],1)],1)],1)],1),t("a-row",{staticStyle:{"margin-top":"24px"},attrs:{gutter:24}},[t("a-col",{attrs:{xs:24}},[t("a-card",{staticClass:"edit-card",attrs:{bordered:!1}},[t("a-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[t("a-tab-pane",{key:"basic",attrs:{tab:e.$t("profile.basicInfo")||"Basic Info"}},[t("a-form",{staticClass:"profile-form",attrs:{form:e.profileForm,layout:"vertical"}},[t("a-form-item",{attrs:{label:e.$t("profile.nickname")||"Nickname"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["nickname",{initialValue:e.profile.nickname}],expression:"['nickname', { initialValue: profile.nickname }]"}],attrs:{placeholder:e.$t("profile.nicknamePlaceholder")||"Enter your nickname"}},[t("a-icon",{attrs:{slot:"prefix",type:"smile"},slot:"prefix"})],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.email")||"Email"}},[t("a-input",{attrs:{value:e.profile.email||"-",disabled:""}},[t("a-icon",{attrs:{slot:"prefix",type:"mail"},slot:"prefix"}),t("a-tooltip",{attrs:{slot:"suffix",title:e.$t("profile.emailCannotChange")||"Email cannot be changed after registration"},slot:"suffix"},[t("a-icon",{staticStyle:{color:"rgba(0,0,0,.45)"},attrs:{type:"info-circle"}})],1)],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.timezone")||"时区"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["timezone",{initialValue:e.profile.timezone||""}],expression:"['timezone', { initialValue: profile.timezone || '' }]"}],attrs:{placeholder:e.$t("profile.timezonePlaceholder")||"跟随浏览器/系统","show-search":"","allow-clear":"","option-filter-prop":"children"}},[t("a-select-option",{attrs:{value:""}},[e._v(" "+e._s(e.$t("profile.timezoneBrowser")||"跟随浏览器")+" ")]),e._l(e.timezoneIanaList,function(a){return t("a-select-option",{key:a,attrs:{value:a}},[e._v(" "+e._s(a)+" ")])})],2)],1),t("a-form-item",[t("a-button",{attrs:{type:"primary",loading:e.saving},on:{click:e.handleSaveProfile}},[t("a-icon",{attrs:{type:"save"}}),e._v(" "+e._s(e.$t("common.save")||"Save")+" ")],1)],1)],1)],1),t("a-tab-pane",{key:"password",attrs:{tab:e.$t("profile.changePassword")||"Change Password"}},[t("a-form",{staticClass:"password-form",attrs:{form:e.passwordForm,layout:"vertical"}},[t("a-alert",{staticStyle:{"margin-bottom":"24px"},attrs:{message:e.$t("profile.passwordHintNew")||"For security, email verification is required to change password. Password must be at least 8 characters with uppercase, lowercase, and number.",type:"info",showIcon:""}}),t("a-form-item",{attrs:{label:e.$t("profile.verificationCode")||"Verification Code"}},[t("a-row",{attrs:{gutter:12}},[t("a-col",{attrs:{span:16}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["code",{rules:[{required:!0,message:e.$t("profile.codeRequired")||"Please enter verification code"}]}],expression:"['code', {\n rules: [{ required: true, message: $t('profile.codeRequired') || 'Please enter verification code' }]\n }]"}],attrs:{placeholder:e.$t("profile.codePlaceholder")||"Enter verification code"}},[t("a-icon",{attrs:{slot:"prefix",type:"safety-certificate"},slot:"prefix"})],1)],1),t("a-col",{attrs:{span:8}},[t("a-button",{attrs:{block:"",loading:e.sendingPwdCode,disabled:e.sendingPwdCode||e.pwdCodeCountdown>0||!e.profile.email},on:{click:e.handleSendPwdCode}},[e._v(" "+e._s(e.pwdCodeCountdown>0?"".concat(e.pwdCodeCountdown,"s"):e.$t("profile.sendCode")||"Send Code")+" ")])],1)],1),e.profile.email?t("div",{staticClass:"email-hint"},[e._v(" "+e._s(e.$t("profile.codeWillSendTo")||"Code will be sent to")+": "+e._s(e.profile.email)+" ")]):t("div",{staticClass:"email-hint email-warning"},[e._v(" "+e._s(e.$t("profile.noEmailWarning")||"Please set your email first in Basic Info tab")+" ")])],1),t("a-form-item",{attrs:{label:e.$t("profile.newPassword")||"New Password"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["new_password",{rules:[{required:!0,message:e.$t("profile.newPasswordRequired")||"Please enter new password"},{validator:e.validateNewPassword}]}],expression:"['new_password', {\n rules: [\n { required: true, message: $t('profile.newPasswordRequired') || 'Please enter new password' },\n { validator: validateNewPassword }\n ]\n }]"}],attrs:{placeholder:e.$t("profile.newPasswordPlaceholder")||"Enter new password"}},[t("a-icon",{attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.confirmPassword")||"Confirm Password"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["confirm_password",{rules:[{required:!0,message:e.$t("profile.confirmPasswordRequired")||"Please confirm password"},{validator:e.validateConfirmPassword}]}],expression:"['confirm_password', {\n rules: [\n { required: true, message: $t('profile.confirmPasswordRequired') || 'Please confirm password' },\n { validator: validateConfirmPassword }\n ]\n }]"}],attrs:{placeholder:e.$t("profile.confirmPasswordPlaceholder")||"Confirm new password"}},[t("a-icon",{attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),t("a-form-item",[t("a-button",{attrs:{type:"primary",loading:e.changingPassword,disabled:!e.profile.email},on:{click:e.handleChangePassword}},[t("a-icon",{attrs:{type:"key"}}),e._v(" "+e._s(e.$t("profile.changePassword")||"Change Password")+" ")],1)],1)],1)],1),t("a-tab-pane",{key:"credits",attrs:{tab:e.$t("profile.creditsLog")||"消费记录"}},[t("a-table",{attrs:{columns:e.creditsLogColumns,dataSource:e.creditsLog,loading:e.creditsLogLoading,pagination:e.creditsLogPagination,rowKey:function(e){return e.id},size:"small"},on:{change:e.handleCreditsLogChange},scopedSlots:e._u([{key:"action",fn:function(a){return[t("a-tag",{attrs:{color:e.getActionColor(a)}},[e._v(" "+e._s(e.getActionLabel(a))+" ")])]}},{key:"amount",fn:function(a){return[t("span",{class:a>=0?"amount-positive":"amount-negative"},[e._v(" "+e._s(a>=0?"+":"")+e._s(a)+" ")])]}},{key:"created_at",fn:function(t){return[e._v(" "+e._s(e.formatCreditsLogTime(t))+" ")]}}])})],1),t("a-tab-pane",{key:"notifications",attrs:{tab:e.$t("profile.notifications.title")||"通知设置"}},[t("div",{staticClass:"notification-settings-form"},[t("a-alert",{staticStyle:{"margin-bottom":"24px"},attrs:{message:e.$t("profile.notifications.hint")||"配置您的默认通知方式,在创建资产监控和预警时将自动使用这些设置",type:"info",showIcon:""}}),t("a-form",{staticStyle:{"max-width":"600px"},attrs:{form:e.notificationForm,layout:"vertical"}},[t("a-form-item",{attrs:{label:e.$t("profile.notifications.defaultChannels")||"默认通知渠道"}},[t("a-checkbox-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["default_channels",{initialValue:e.notificationSettings.default_channels||["browser"]}],expression:"['default_channels', { initialValue: notificationSettings.default_channels || ['browser'] }]"}]},[t("a-row",{attrs:{gutter:16}},[t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"browser"}},[t("a-icon",{attrs:{type:"bell"}}),e._v(" "+e._s(e.$t("profile.notifications.browser")||"站内通知")+" ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"telegram"}},[t("a-icon",{attrs:{type:"send"}}),e._v(" Telegram ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"email"}},[t("a-icon",{attrs:{type:"mail"}}),e._v(" "+e._s(e.$t("profile.notifications.email")||"邮件")+" ")],1)],1)],1),t("a-row",{staticStyle:{"margin-top":"8px"},attrs:{gutter:16}},[t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"phone"}},[t("a-icon",{attrs:{type:"phone"}}),e._v(" "+e._s(e.$t("profile.notifications.phone")||"短信")+" ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"discord"}},[t("a-icon",{attrs:{type:"message"}}),e._v(" Discord ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"webhook"}},[t("a-icon",{attrs:{type:"api"}}),e._v(" Webhook ")],1)],1)],1)],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.telegramBotToken")||"Telegram Bot Token"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["telegram_bot_token",{initialValue:e.notificationSettings.telegram_bot_token}],expression:"['telegram_bot_token', { initialValue: notificationSettings.telegram_bot_token }]"}],attrs:{placeholder:e.$t("profile.notifications.telegramBotTokenPlaceholder")||"请输入您的 Telegram Bot Token"}},[t("a-icon",{attrs:{slot:"prefix",type:"robot"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(" "+e._s(e.$t("profile.notifications.telegramBotTokenHint")||"通过 @BotFather 创建机器人获取 Token")+" "),t("a",{attrs:{href:"https://t.me/BotFather",target:"_blank",rel:"noopener noreferrer"}},[e._v("@BotFather")])])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.telegramChatId")||"Telegram Chat ID"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["telegram_chat_id",{initialValue:e.notificationSettings.telegram_chat_id}],expression:"['telegram_chat_id', { initialValue: notificationSettings.telegram_chat_id }]"}],attrs:{placeholder:e.$t("profile.notifications.telegramPlaceholder")||"请输入您的 Telegram Chat ID(如 123456789)"}},[t("a-icon",{attrs:{slot:"prefix",type:"message"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.telegramHint")||"发送 /start 给 @userinfobot 可获取您的 Chat ID"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.notifyEmail")||"通知邮箱"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{initialValue:e.notificationSettings.email||e.profile.email}],expression:"['email', { initialValue: notificationSettings.email || profile.email }]"}],attrs:{placeholder:e.$t("profile.notifications.emailPlaceholder")||"接收通知的邮箱地址"}},[t("a-icon",{attrs:{slot:"prefix",type:"mail"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.emailHint")||"默认使用账户邮箱,可设置其他邮箱接收通知"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.phone")||"手机号(短信通知)"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["phone",{initialValue:e.notificationSettings.phone}],expression:"['phone', { initialValue: notificationSettings.phone }]"}],attrs:{placeholder:e.$t("profile.notifications.phonePlaceholder")||"请输入手机号(如 +8613800138000)"}},[t("a-icon",{attrs:{slot:"prefix",type:"phone"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.phoneHint")||"需要管理员配置 Twilio 服务后才能使用短信通知"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.discordWebhook")||"Discord Webhook"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["discord_webhook",{initialValue:e.notificationSettings.discord_webhook}],expression:"['discord_webhook', { initialValue: notificationSettings.discord_webhook }]"}],attrs:{placeholder:e.$t("profile.notifications.discordPlaceholder")||"https://discord.com/api/webhooks/..."}},[t("a-icon",{attrs:{slot:"prefix",type:"message"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.discordHint")||"在 Discord 服务器设置中创建 Webhook"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.webhookUrl")||"Webhook URL"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["webhook_url",{initialValue:e.notificationSettings.webhook_url}],expression:"['webhook_url', { initialValue: notificationSettings.webhook_url }]"}],attrs:{placeholder:e.$t("profile.notifications.webhookPlaceholder")||"https://your-server.com/webhook"}},[t("a-icon",{attrs:{slot:"prefix",type:"api"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.webhookHint")||"自定义 Webhook 地址,将以 POST JSON 方式推送通知"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.webhookToken")||"Webhook Token(可选)"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["webhook_token",{initialValue:e.notificationSettings.webhook_token}],expression:"['webhook_token', { initialValue: notificationSettings.webhook_token }]"}],attrs:{placeholder:e.$t("profile.notifications.webhookTokenPlaceholder")||"用于验证请求的 Bearer Token"}},[t("a-icon",{attrs:{slot:"prefix",type:"key"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.webhookTokenHint")||"将作为 Authorization: Bearer Token 发送到 Webhook"))])],1)],1),t("a-form-item",[t("a-button",{attrs:{type:"primary",loading:e.savingNotifications},on:{click:e.handleSaveNotifications}},[t("a-icon",{attrs:{type:"save"}}),e._v(" "+e._s(e.$t("common.save")||"保存")+" ")],1),t("a-button",{staticStyle:{"margin-left":"12px"},attrs:{loading:e.testingNotification},on:{click:e.handleTestNotification}},[t("a-icon",{attrs:{type:"experiment"}}),e._v(" "+e._s(e.$t("profile.notifications.testBtn")||"发送测试通知")+" ")],1)],1)],1)],1)]),t("a-tab-pane",{key:"exchange",attrs:{tab:e.$t("profile.exchange.title")||"交易所配置"}},[t("div",{staticClass:"exchange-config-section"},[t("a-alert",{staticStyle:{"margin-bottom":"16px"},attrs:{message:e.$t("profile.exchange.hint"),type:"info",showIcon:""}}),t("div",{staticStyle:{"margin-bottom":"16px","text-align":"right"}},[t("a-button",{staticStyle:{"margin-right":"12px"},on:{click:e.openExchangeSignupModal}},[t("a-icon",{attrs:{type:"rocket"}}),e._v(" "+e._s(e.$t("profile.exchange.openAccount"))+" ")],1),t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.openAddExchangeModal}},[e._v(" "+e._s(e.$t("profile.exchange.addAccount"))+" ")])],1),t("a-table",{attrs:{columns:e.exchangeColumns,dataSource:e.exchangeCredentials,loading:e.exchangeLoading,rowKey:function(e){return e.id},locale:{emptyText:e.$t("profile.exchange.noAccounts")||"暂无交易所账户,请点击上方按钮添加"},size:"small"},scopedSlots:e._u([{key:"exchange_id",fn:function(a,i){return[t("span",{staticStyle:{"text-transform":"capitalize","font-weight":"500"}},[e._v(e._s(e.getExchangeDisplayName(a)))]),i.enable_demo_trading?t("a-tag",{staticStyle:{"margin-left":"6px"},attrs:{color:"orange",size:"small"}},[e._v(" "+e._s(e.$t("profile.exchange.demoTag"))+" ")]):e._e()]}},{key:"api_key_hint",fn:function(a,i){return[t("span",{staticClass:"credential-hint"},[e._v(e._s(a||i.name||"-"))])]}},{key:"created_at",fn:function(t){return[e._v(" "+e._s(e.formatTime(t))+" ")]}},{key:"action",fn:function(a,i){return[t("a-popconfirm",{attrs:{title:e.$t("profile.exchange.deleteConfirm"),okText:e.$t("common.confirm"),cancelText:e.$t("common.cancel")},on:{confirm:function(t){return e.handleDeleteCredential(i.id)}}},[t("a-button",{attrs:{type:"danger",size:"small",ghost:"",icon:"delete"}},[e._v(" "+e._s(e.$t("common.delete"))+" ")])],1)]}}])})],1)]),t("a-tab-pane",{key:"referrals",attrs:{tab:e.$t("profile.referral.listTab")||"邀请列表"}},[t("a-table",{attrs:{columns:e.referralColumns,dataSource:e.referralData.list||[],loading:e.referralLoading,pagination:e.referralPagination,rowKey:function(e){return e.id},locale:{emptyText:e.$t("profile.referral.noReferrals")||"暂无邀请记录"},size:"small"},on:{change:e.handleReferralChange},scopedSlots:e._u([{key:"user",fn:function(a,i){return[t("div",{staticClass:"referral-user-cell"},[t("a-avatar",{attrs:{size:32,src:i.avatar||"/avatar2.jpg"}}),t("div",{staticClass:"user-info"},[t("span",{staticClass:"nickname"},[e._v(e._s(i.nickname||i.username))]),t("span",{staticClass:"username"},[e._v("@"+e._s(i.username))])])],1)]}},{key:"created_at",fn:function(t){return[e._v(" "+e._s(e.formatTime(t))+" ")]}}])})],1)],1)],1)],1)],1),t("exchange-account-modal",{attrs:{visible:e.showAddExchangeModal},on:{"update:visible":function(t){e.showAddExchangeModal=t},success:e.loadExchangeCredentials}}),t("a-modal",{attrs:{title:e.$t("profile.exchange.openAccountTitle"),visible:e.showExchangeSignupModal,"wrap-class-name":e.exchangeModalWrapClass,footer:null,width:"860px"},on:{cancel:function(t){e.showExchangeSignupModal=!1}}},[t("div",{staticClass:"exchange-signup-modal"},[t("div",{staticClass:"exchange-signup-promo"},[e._v(e._s(e.$t("profile.exchange.openAccountPromo")))]),t("div",{staticClass:"exchange-signup-grid"},e._l(e.exchangeSignupCards,function(a){return t("div",{key:a.id,staticClass:"exchange-signup-card"},[t("div",{staticClass:"exchange-signup-card__header"},[t("div",{staticClass:"exchange-signup-logo",style:{background:a.brandBg,color:a.brandColor}},[e._v(" "+e._s(a.short)+" ")]),t("div",{staticClass:"exchange-signup-meta"},[t("div",{staticClass:"exchange-signup-name"},[e._v(e._s(a.name))])])]),t("div",{staticClass:"exchange-signup-actions"},[t("a-button",{attrs:{type:"primary",block:"",disabled:!a.signupUrl},on:{click:function(t){return e.openExchangeSignupLink(a.signupUrl)}}},[e._v(" "+e._s(e.$t("profile.exchange.openAccountButton"))+" ")])],1)])}),0)])])],1)},r=[],n=a(81127),o=a(56252),s=(a(74423),a(84841)),l=a(53003),c=a(42430),d=a(55434),f=a(40011),u={name:"Profile",components:{ExchangeAccountModal:f.A},mixins:[d.t],data:function(){return{loading:!1,saving:!1,changingPassword:!1,sendingPwdCode:!1,pwdCodeCountdown:0,pwdCodeTimer:null,activeTab:"basic",profile:{id:null,username:"",nickname:"",email:"",avatar:"",timezone:"",role:"user",last_login_at:null},timezoneIanaList:["UTC","Etc/UTC","Asia/Shanghai","Asia/Hong_Kong","Asia/Taipei","Asia/Tokyo","Asia/Seoul","Asia/Singapore","Asia/Dubai","Asia/Kolkata","Europe/London","Europe/Paris","Europe/Berlin","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Sao_Paulo","Australia/Sydney","Pacific/Auckland"],creditsLog:[],creditsLogLoading:!1,creditsLogPagination:{current:1,pageSize:10,total:0},referralData:{list:[],total:0,referral_code:"",referral_bonus:0,register_bonus:0},referralLoading:!1,referralPagination:{current:1,pageSize:10,total:0},billing:{credits:0,is_vip:!1,vip_expires_at:null,billing_enabled:!1,feature_costs:{}},rechargeTelegramUrl:"https://t.me/your_support_bot",notificationSettings:{default_channels:["browser"],telegram_bot_token:"",telegram_chat_id:"",email:"",phone:"",discord_webhook:"",webhook_url:"",webhook_token:""},savingNotifications:!1,testingNotification:!1,exchangeCredentials:[],exchangeLoading:!1,showAddExchangeModal:!1,showExchangeSignupModal:!1,exchangeSignupCards:[{id:"binance",name:"Binance",short:"BN",brandBg:"rgba(243, 186, 47, 0.16)",brandColor:"#f0b90b",signupUrl:"https://www.bsmkweb.cc/register?ref=QUANTDINGER"},{id:"bitget",name:"Bitget",short:"BG",brandBg:"rgba(0, 193, 255, 0.14)",brandColor:"#00c1ff",signupUrl:"https://partner.hdmune.cn/bg/7r4xz8kd"},{id:"bybit",name:"Bybit",short:"BY",brandBg:"rgba(247, 166, 0, 0.14)",brandColor:"#f7a600",signupUrl:"https://partner.bybit.com/b/DINGER"},{id:"okx",name:"OKX",short:"OK",brandBg:"rgba(17, 24, 39, 0.08)",brandColor:"#111827",signupUrl:"https://www.xqmnobxky.com/join/QUANTDINGER"},{id:"gate",name:"Gate.io",short:"GT",brandBg:"rgba(42, 93, 255, 0.12)",brandColor:"#2a5dff",signupUrl:"https://www.gateport.company/share/DINGER"},{id:"htx",name:"HTX",short:"HX",brandBg:"rgba(22, 119, 255, 0.12)",brandColor:"#1677ff",signupUrl:"https://www.htx.com/invite/zh-cn/1f?invite_code=dinger"}]}},computed:{isDarkTheme:function(){return"dark"===this.navTheme||"realdark"===this.navTheme},exchangeModalWrapClass:function(){var e="profile-exchange-modal";return this.isDarkTheme?"".concat(e," ").concat(e,"--dark"):e},isVip:function(){if(!this.billing.vip_expires_at)return!1;var e=new Date(this.billing.vip_expires_at);return e>new Date},creditsLogColumns:function(){return[{title:this.$t("profile.creditsLog.time")||"时间",dataIndex:"created_at",width:160,scopedSlots:{customRender:"created_at"}},{title:this.$t("profile.creditsLog.action")||"类型",dataIndex:"action",width:100,scopedSlots:{customRender:"action"}},{title:this.$t("profile.creditsLog.amount")||"变动",dataIndex:"amount",width:100,scopedSlots:{customRender:"amount"}},{title:this.$t("profile.creditsLog.balance")||"余额",dataIndex:"balance_after",width:100},{title:this.$t("profile.creditsLog.remark")||"备注",dataIndex:"remark",ellipsis:!0}]},referralColumns:function(){return[{title:this.$t("profile.referral.user")||"用户",dataIndex:"username",scopedSlots:{customRender:"user"}},{title:this.$t("profile.referral.registerTime")||"注册时间",dataIndex:"created_at",width:180,scopedSlots:{customRender:"created_at"}}]},referralLink:function(){var e=window.location.origin+window.location.pathname,t=this.referralData.referral_code||this.profile.id;return"".concat(e,"#/user/login?ref=").concat(t)},exchangeColumns:function(){return[{title:this.$t("profile.exchange.colExchange")||"Exchange",dataIndex:"exchange_id",width:140,scopedSlots:{customRender:"exchange_id"}},{title:this.$t("profile.exchange.colName")||"Name",dataIndex:"name",width:140,customRender:function(e){return e||"-"}},{title:this.$t("profile.exchange.colHint")||"Connection Info",dataIndex:"api_key_hint",scopedSlots:{customRender:"api_key_hint"}},{title:this.$t("profile.exchange.colCreatedAt")||"Created At",dataIndex:"created_at",width:180,scopedSlots:{customRender:"created_at"}},{title:this.$t("profile.exchange.colActions")||"Actions",width:120,scopedSlots:{customRender:"action"}}]}},watch:{activeTab:function(e){"credits"===e&&0===this.creditsLog.length&&this.loadCreditsLog(),"referrals"!==e||this.referralData.list&&0!==this.referralData.list.length||this.loadReferrals(),"notifications"!==e||this.notificationSettings.telegram_chat_id||this.notificationSettings.discord_webhook||this.loadNotificationSettings(),"exchange"===e&&0===this.exchangeCredentials.length&&this.loadExchangeCredentials()}},beforeCreate:function(){this.profileForm=this.$form.createForm(this,{name:"profile"}),this.passwordForm=this.$form.createForm(this,{name:"password"}),this.notificationForm=this.$form.createForm(this,{name:"notification"})},mounted:function(){this.loadProfile(),this.loadReferrals()},beforeDestroy:function(){this.pwdCodeTimer&&clearInterval(this.pwdCodeTimer)},methods:{loadProfile:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var a;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.loading=!0,t.p=1,t.n=2,(0,s.E$)();case 2:a=t.v,1===a.code?(e.profile=a.data,a.data.billing&&(e.billing=a.data.billing),a.data.notification_settings&&(e.notificationSettings={default_channels:a.data.notification_settings.default_channels||["browser"],telegram_bot_token:a.data.notification_settings.telegram_bot_token||"",telegram_chat_id:a.data.notification_settings.telegram_chat_id||"",email:a.data.notification_settings.email||a.data.email||"",phone:a.data.notification_settings.phone||"",discord_webhook:a.data.notification_settings.discord_webhook||"",webhook_url:a.data.notification_settings.webhook_url||"",webhook_token:a.data.notification_settings.webhook_token||""}),e.$nextTick(function(){e.profileForm.setFieldsValue({nickname:e.profile.nickname,email:e.profile.email,timezone:e.profile.timezone||""})})):e.$message.error(a.msg||"Failed to load profile"),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load profile");case 4:return t.p=4,e.loading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},loadRechargeUrl:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var a;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if("admin"!==e.profile.role){t.n=4;break}return t.p=1,t.n=2,(0,l.YT)();case 2:a=t.v,1===a.code&&a.data&&a.data.billing&&(e.rechargeTelegramUrl=a.data.billing.RECHARGE_TELEGRAM_URL||e.rechargeTelegramUrl),t.n=4;break;case 3:t.p=3,t.v;case 4:return t.a(2)}},t,null,[[1,3]])}))()},handleRecharge:function(){this.$router.push("/billing")},formatCredits:function(e){return e||0===e?Number(e).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}):"0"},formatDate:function(e){if(!e)return"";var t=new Date(e);return t.toLocaleDateString()},handleSaveProfile:function(){var e=this;this.profileForm.validateFields(function(){var t=(0,o.A)((0,n.A)().m(function t(a,i){var r;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(!a){t.n=1;break}return t.a(2);case 1:return e.saving=!0,t.p=2,t.n=3,(0,s.r7)({nickname:i.nickname,timezone:null!=i.timezone?i.timezone:""});case 3:r=t.v,1===r.code?(e.$message.success(r.msg||"Profile updated successfully"),e.loadProfile(),e.$store.dispatch("FetchUserInfo").catch(function(){})):e.$message.error(r.msg||"Update failed"),t.n=5;break;case 4:t.p=4,t.v,e.$message.error("Update failed");case 5:return t.p=5,e.saving=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e,a){return t.apply(this,arguments)}}())},validateConfirmPassword:function(e,t,a){var i=this.passwordForm.getFieldValue("new_password");t&&t!==i?a(this.$t("profile.passwordMismatch")||"Passwords do not match"):a()},handleSendPwdCode:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var i,r,o,s,l;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(e.profile.email){t.n=1;break}return e.$message.error(e.$t("profile.noEmailWarning")||"Please set your email first"),t.a(2);case 1:return e.sendingPwdCode=!0,t.p=2,t.n=3,a.e(824).then(a.bind(a,95824));case 3:return i=t.v,r=i.sendVerificationCode,t.n=4,r({email:e.profile.email,type:"change_password"});case 4:o=t.v,1===o.code?(e.$message.success(e.$t("profile.codeSent")||"Verification code sent"),e.startPwdCodeCountdown()):e.$message.error(o.msg||"Failed to send code"),t.n=6;break;case 5:t.p=5,l=t.v,e.$message.error((null===(s=l.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.msg)||"Failed to send code");case 6:return t.p=6,e.sendingPwdCode=!1,t.f(6);case 7:return t.a(2)}},t,null,[[2,5,6,7]])}))()},startPwdCodeCountdown:function(){var e=this;this.pwdCodeCountdown=60,this.pwdCodeTimer=setInterval(function(){e.pwdCodeCountdown--,e.pwdCodeCountdown<=0&&(clearInterval(e.pwdCodeTimer),e.pwdCodeTimer=null)},1e3)},validateNewPassword:function(e,t,a){t?t.length<8?a(new Error(this.$t("user.register.pwdMinLength")||"At least 8 characters")):/[A-Z]/.test(t)?/[a-z]/.test(t)?/[0-9]/.test(t)?a():a(new Error(this.$t("user.register.pwdNumber")||"At least one number")):a(new Error(this.$t("user.register.pwdLowercase")||"At least one lowercase letter")):a(new Error(this.$t("user.register.pwdUppercase")||"At least one uppercase letter")):a()},handleChangePassword:function(){var e=this;this.passwordForm.validateFields(function(){var t=(0,o.A)((0,n.A)().m(function t(i,r){var o,s,l,c,d;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(!i){t.n=1;break}return t.a(2);case 1:return e.changingPassword=!0,t.p=2,t.n=3,a.e(824).then(a.bind(a,95824));case 3:return o=t.v,s=o.changePassword,t.n=4,s({code:r.code,new_password:r.new_password});case 4:l=t.v,1===l.code?(e.$message.success(l.msg||"Password changed successfully"),e.passwordForm.resetFields()):e.$message.error(l.msg||"Change password failed"),t.n=6;break;case 5:t.p=5,d=t.v,e.$message.error((null===(c=d.response)||void 0===c||null===(c=c.data)||void 0===c?void 0:c.msg)||"Change password failed");case 6:return t.p=6,e.changingPassword=!1,t.f(6);case 7:return t.a(2)}},t,null,[[2,5,6,7]])}));return function(e,a){return t.apply(this,arguments)}}())},getRoleColor:function(e){var t={admin:"red",manager:"orange",user:"blue",viewer:"default"};return t[e]||"default"},getRoleLabel:function(e){var t={admin:this.$t("userManage.roleAdmin")||"Admin",manager:this.$t("userManage.roleManager")||"Manager",user:this.$t("userManage.roleUser")||"User",viewer:this.$t("userManage.roleViewer")||"Viewer"};return t[e]||e},_profileDateTimeLocaleOptions:function(){var e=String(this.profile&&this.profile.timezone||"").trim();if(!e)return{};try{return Intl.DateTimeFormat(void 0,{timeZone:e}).format(new Date),{timeZone:e}}catch(t){return{}}},formatTime:function(e){if(!e)return"";var t=new Date("number"===typeof e?1e3*e:e);return Number.isNaN(t.getTime())?"":t.toLocaleString(void 0,this._profileDateTimeLocaleOptions())},formatCreditsLogTime:function(e){if(!e)return"";if("string"===typeof e){var t=e.trim();if(t.endsWith("Z")&&t.includes("T"))return t.replace("T"," ").replace("Z","")}return this.formatTime(e)},loadCreditsLog:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var a;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.creditsLogLoading=!0,t.p=1,t.n=2,(0,s.v9)({page:e.creditsLogPagination.current,page_size:e.creditsLogPagination.pageSize});case 2:a=t.v,1===a.code&&(e.creditsLog=a.data.items||[],e.creditsLogPagination.total=a.data.total||0),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load credits log");case 4:return t.p=4,e.creditsLogLoading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},handleCreditsLogChange:function(e){this.creditsLogPagination.current=e.current,this.loadCreditsLog()},loadReferrals:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var a;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.referralLoading=!0,t.p=1,t.n=2,(0,s.rx)({page:e.referralPagination.current,page_size:e.referralPagination.pageSize});case 2:a=t.v,1===a.code&&(e.referralData={list:a.data.list||[],total:a.data.total||0,referral_code:a.data.referral_code||"",referral_bonus:a.data.referral_bonus||0,register_bonus:a.data.register_bonus||0},e.referralPagination.total=a.data.total||0),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load referral data");case 4:return t.p=4,e.referralLoading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},handleReferralChange:function(e){this.referralPagination.current=e.current,this.loadReferrals()},copyReferralLink:function(){var e=this,t=this.referralLink;navigator.clipboard?navigator.clipboard.writeText(t).then(function(){e.$message.success(e.$t("profile.referral.linkCopied")||"邀请链接已复制")}).catch(function(){e.fallbackCopy(t)}):this.fallbackCopy(t)},fallbackCopy:function(e){var t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{document.execCommand("copy"),this.$message.success(this.$t("profile.referral.linkCopied")||"邀请链接已复制")}catch(a){this.$message.error("Copy failed")}document.body.removeChild(t)},getActionColor:function(e){var t={consume:"red",recharge:"green",admin_adjust:"blue",refund:"orange",vip_grant:"gold",vip_revoke:"default",register_bonus:"cyan",referral_bonus:"purple",indicator_purchase:"volcano",indicator_sale:"lime"};return t[e]||"default"},getActionLabel:function(e){var t={consume:this.$t("profile.creditsLog.actionConsume")||"消费",recharge:this.$t("profile.creditsLog.actionRecharge")||"充值",admin_adjust:this.$t("profile.creditsLog.actionAdjust")||"调整",refund:this.$t("profile.creditsLog.actionRefund")||"退款",vip_grant:this.$t("profile.creditsLog.actionVipGrant")||"VIP授予",vip_revoke:this.$t("profile.creditsLog.actionVipRevoke")||"VIP取消",register_bonus:this.$t("profile.creditsLog.actionRegisterBonus")||"注册奖励",referral_bonus:this.$t("profile.creditsLog.actionReferralBonus")||"邀请奖励",indicator_purchase:this.$t("profile.creditsLog.actionIndicatorPurchase")||"购买指标",indicator_sale:this.$t("profile.creditsLog.actionIndicatorSale")||"出售指标"};return t[e]||e},loadExchangeCredentials:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var a;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.exchangeLoading=!0,t.p=1,t.n=2,(0,c.IA)();case 2:a=t.v,1===a.code&&a.data&&(e.exchangeCredentials=a.data.items||[]),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load exchange accounts");case 4:return t.p=4,e.exchangeLoading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},openAddExchangeModal:function(){this.showAddExchangeModal=!0},openExchangeSignupModal:function(){this.showExchangeSignupModal=!0},openExternalLink:function(e){e&&window.open(e,"_blank")},openExchangeSignupLink:function(e){this.openExternalLink(e)},getExchangeDisplayName:function(e){var t={binance:"Binance",okx:"OKX",bitget:"Bitget",bybit:"Bybit",coinbaseexchange:"Coinbase",kraken:"Kraken",kucoin:"KuCoin",gate:"Gate.io",bitfinex:"Bitfinex",deepcoin:"Deepcoin",htx:"HTX",ibkr:"IBKR",mt5:"MetaTrader 5"};return t[e]||e},handleDeleteCredential:function(e){var t=this;return(0,o.A)((0,n.A)().m(function a(){var i;return(0,n.A)().w(function(a){while(1)switch(a.p=a.n){case 0:return a.p=0,a.n=1,(0,c.kI)(e);case 1:i=a.v,1===i.code?(t.$message.success(t.$t("profile.exchange.deleteSuccess")),t.loadExchangeCredentials()):t.$message.error(i.msg||"Delete failed"),a.n=3;break;case 2:a.p=2,a.v,t.$message.error("Delete failed");case 3:return a.a(2)}},a,null,[[0,2]])}))()},loadNotificationSettings:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var a;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,(0,s.vF)();case 1:a=t.v,1===a.code&&a.data&&(e.notificationSettings={default_channels:a.data.default_channels||["browser"],telegram_bot_token:a.data.telegram_bot_token||"",telegram_chat_id:a.data.telegram_chat_id||"",email:a.data.email||e.profile.email||"",phone:a.data.phone||"",discord_webhook:a.data.discord_webhook||"",webhook_url:a.data.webhook_url||"",webhook_token:a.data.webhook_token||""},e.$nextTick(function(){e.notificationForm.setFieldsValue({default_channels:e.notificationSettings.default_channels,telegram_bot_token:e.notificationSettings.telegram_bot_token,telegram_chat_id:e.notificationSettings.telegram_chat_id,email:e.notificationSettings.email,phone:e.notificationSettings.phone,discord_webhook:e.notificationSettings.discord_webhook,webhook_url:e.notificationSettings.webhook_url,webhook_token:e.notificationSettings.webhook_token})})),t.n=3;break;case 2:t.p=2,t.v;case 3:return t.a(2)}},t,null,[[0,2]])}))()},_mapNotifyTestError:function(e,t){var a=(t||"").trim();if("email"===e){if("missing_SMTP_HOST"===a)return this.$t("profile.notifications.errSmtpHost")||"email:服务器未配置发信 SMTP(管理员在「系统设置 → 邮件」或环境变量 SMTP_HOST/SMTP_USER 等)";if("missing_SMTP_FROM"===a)return this.$t("profile.notifications.errSmtpFrom")||"email:未配置发件人 SMTP_FROM(或 SMTP_USER)";if("missing_email_target"===a)return this.$t("profile.notifications.errEmailTarget")||"email:未填写通知邮箱且账号无邮箱"}return a?"".concat(e,": ").concat(a):""},handleSaveNotifications:function(){var e=this;this.notificationForm.validateFields(function(){var t=(0,o.A)((0,n.A)().m(function t(a,i){var r;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(!a){t.n=1;break}return t.a(2);case 1:return e.savingNotifications=!0,t.p=2,t.n=3,(0,s.Gl)({default_channels:i.default_channels||["browser"],telegram_bot_token:i.telegram_bot_token||"",telegram_chat_id:i.telegram_chat_id||"",email:i.email||"",phone:i.phone||"",discord_webhook:i.discord_webhook||"",webhook_url:i.webhook_url||"",webhook_token:i.webhook_token||""});case 3:r=t.v,1===r.code?(e.$message.success(e.$t("profile.notifications.saveSuccess")||"通知设置保存成功"),e.notificationSettings=r.data||e.notificationSettings):e.$message.error(r.msg||"保存失败"),t.n=5;break;case 4:t.p=4,t.v,e.$message.error("保存失败");case 5:return t.p=5,e.savingNotifications=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e,a){return t.apply(this,arguments)}}())},handleTestNotification:function(){var e=this;return(0,o.A)((0,n.A)().m(function t(){var a,i,r,o,l,c,d;return(0,n.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(a=e.notificationForm.getFieldsValue(),i=a.default_channels||[],0!==i.length){t.n=1;break}return e.$message.warning(e.$t("profile.notifications.selectChannel")||"请至少选择一个通知渠道"),t.a(2);case 1:if(!i.includes("telegram")){t.n=3;break}if(a.telegram_bot_token){t.n=2;break}return e.$message.warning(e.$t("profile.notifications.fillTelegramToken")||"请填写 Telegram Bot Token"),t.a(2);case 2:if(a.telegram_chat_id){t.n=3;break}return e.$message.warning(e.$t("profile.notifications.fillTelegram")||"请填写 Telegram Chat ID"),t.a(2);case 3:if(!i.includes("email")||a.email){t.n=4;break}return e.$message.warning(e.$t("profile.notifications.fillEmail")||"请填写通知邮箱"),t.a(2);case 4:if(!i.includes("phone")||a.phone){t.n=5;break}return e.$message.warning(e.$t("profile.notifications.fillPhone")||"请填写手机号"),t.a(2);case 5:if(!i.includes("discord")||a.discord_webhook){t.n=6;break}return e.$message.warning(e.$t("profile.notifications.fillDiscord")||"请填写 Discord Webhook URL"),t.a(2);case 6:if(!i.includes("webhook")||a.webhook_url){t.n=7;break}return e.$message.warning(e.$t("profile.notifications.fillWebhook")||"请填写 Webhook URL"),t.a(2);case 7:return e.testingNotification=!0,t.p=8,t.n=9,(0,s.Gl)({default_channels:i,telegram_bot_token:a.telegram_bot_token||"",telegram_chat_id:a.telegram_chat_id||"",email:a.email||"",phone:a.phone||"",discord_webhook:a.discord_webhook||"",webhook_url:a.webhook_url||"",webhook_token:a.webhook_token||""});case 9:if(r=t.v,1===r.code){t.n=10;break}return e.$message.error(r.msg||"保存设置失败"),t.a(2);case 10:return t.n=11,(0,s.hl)();case 11:if(o=t.v,1===o.code){t.n=12;break}return e.$message.error(o.msg||e.$t("profile.notifications.testFailed")||"测试通知发送失败"),t.a(2);case 12:l=o.data&&o.data.results||{},c=Object.keys(l).filter(function(e){return!l[e].ok}),0===c.length?e.$message.success(e.$t("profile.notifications.testSent")||"测试通知已发送,请检查各渠道"):(d=c.map(function(t){var a=l[t]&&l[t].error||"",i=e._mapNotifyTestError(t,a);return i||(a?"".concat(t,": ").concat(a):t)}).join(";"),e.$message.warning((e.$t("profile.notifications.testPartial")||"部分渠道发送失败")+" — ".concat(d),8)),t.n=14;break;case 13:t.p=13,t.v,e.$message.error(e.$t("profile.notifications.testFailed")||"发送测试通知失败");case 14:return t.p=14,e.testingNotification=!1,t.f(14);case 15:return t.a(2)}},t,null,[[8,13,14,15]])}))()}}},p=u,m=a(845),g=(0,m.A)(p,i,r,!1,null,"2151383b",null),h=g.exports},53003:function(e,t,a){a.d(t,{DZ:function(){return o},YT:function(){return n},_d:function(){return s},lo:function(){return r}});var i=a(75769);function r(){return(0,i.Ay)({url:"/api/settings/schema",method:"get"})}function n(){return(0,i.Ay)({url:"/api/settings/values",method:"get"})}function o(e){return(0,i.Ay)({url:"/api/settings/save",method:"post",data:e})}function s(){return(0,i.Ay)({url:"/api/settings/openrouter-balance",method:"get"})}},84841:function(e,t,a){a.d(t,{DK:function(){return w},E$:function(){return d},Gl:function(){return p},O0:function(){return c},TK:function(){return o},aU:function(){return r},cw:function(){return l},d$:function(){return k},hG:function(){return s},hl:function(){return m},kg:function(){return n},nY:function(){return v},r7:function(){return f},rx:function(){return h},v9:function(){return g},vF:function(){return u},vi:function(){return b},wq:function(){return _}});var i=a(75769);function r(e){return(0,i.Ay)({url:"/api/users/list",method:"get",params:e})}function n(e){return(0,i.Ay)({url:"/api/users/create",method:"post",data:e})}function o(e,t){return(0,i.Ay)({url:"/api/users/update",method:"put",params:{id:e},data:t})}function s(e){return(0,i.Ay)({url:"/api/users/delete",method:"delete",params:{id:e}})}function l(e){return(0,i.Ay)({url:"/api/users/reset-password",method:"post",data:e})}function c(){return(0,i.Ay)({url:"/api/users/roles",method:"get"})}function d(){return(0,i.Ay)({url:"/api/users/profile",method:"get"})}function f(e){return(0,i.Ay)({url:"/api/users/profile/update",method:"put",data:e})}function u(){return(0,i.Ay)({url:"/api/users/notification-settings",method:"get"})}function p(e){return(0,i.Ay)({url:"/api/users/notification-settings",method:"put",data:e})}function m(){return(0,i.Ay)({url:"/api/users/notification-settings/test",method:"post",data:{}})}function g(e){return(0,i.Ay)({url:"/api/users/my-credits-log",method:"get",params:e})}function h(e){return(0,i.Ay)({url:"/api/users/my-referrals",method:"get",params:e})}function _(e){return(0,i.Ay)({url:"/api/users/set-credits",method:"post",data:e})}function v(e){return(0,i.Ay)({url:"/api/users/set-vip",method:"post",data:e})}function w(e){return(0,i.Ay)({url:"/api/users/system-strategies",method:"get",params:e})}function b(e){return(0,i.Ay)({url:"/api/users/admin-orders",method:"get",params:e})}function k(e){return(0,i.Ay)({url:"/api/users/admin-ai-stats",method:"get",params:e})}}}]); |