| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233 |
- <template>
- <div :class="prefixCls" class="authorization-page">
- <AppHeader />
- <div class="authorization-content">
- <section class="left-pane">
- <div class="left-pane__content">
- <div class="left-pane__header">
- <div class="left-pane__badge">
- <SafetyCertificateOutlined />
- <span>{{ pageBadge }}</span>
- </div>
- <h1 class="left-pane__title">{{ pageTitle }}</h1>
- <p class="left-pane__subtitle">{{ pageSubtitle }}</p>
- </div>
- <div class="left-pane__visual">
- <div class="device-illustration">
- <div class="device-illustration__screen-shell">
- <div class="device-illustration__screen-dots">
- <span></span>
- <span></span>
- <span></span>
- </div>
- <div class="device-illustration__screen-body">
- <div class="device-illustration__line device-illustration__line--lg"></div>
- <div class="device-illustration__line device-illustration__line--md"></div>
- <div class="device-illustration__chart">
- <span></span>
- <span></span>
- <span></span>
- </div>
- </div>
- </div>
- <div class="device-illustration__stand"></div>
- <div class="device-illustration__shadow"></div>
- <div class="floating-card floating-card--left">
- <div class="floating-card__icon">
- <DesktopOutlined />
- </div>
- <div class="floating-card__content">
- <div class="floating-card__label">对象画像</div>
- <div class="floating-card__title">多源归集</div>
- </div>
- </div>
- <div class="floating-card floating-card--right">
- <div class="floating-card__icon floating-card__icon--indigo">
- <ApartmentOutlined />
- </div>
- <div class="floating-card__content">
- <div class="floating-card__label">关系分析</div>
- <div class="floating-card__title">图谱联动</div>
- </div>
- </div>
- </div>
- </div>
- <div class="left-pane__features">
- <div v-for="item in leftFeatures" :key="item.title" class="feature-item">
- <div class="feature-item__icon">
- <component :is="item.icon" />
- </div>
- <div class="feature-item__content">
- <h3 class="feature-item__title">{{ item.title }}</h3>
- <p class="feature-item__desc">{{ item.desc }}</p>
- </div>
- </div>
- </div>
- <div class="left-pane__footer">
- <p class="left-pane__footer-line">{{ productSetting.copyright }}</p>
- <p class="left-pane__footer-line">联系电话:{{ productSetting.companyPhone }}</p>
- </div>
- </div>
- </section>
- <section class="right-pane">
- <svg class="right-pane__curve" preserveAspectRatio="none" viewBox="0 0 100 100">
- <path d="M100,0 Q-40,50 100,100 Z" fill="currentColor" />
- </svg>
- <div class="right-pane__scroll">
- <!--
- 服务地址卡片:与授权 / 登录共用同一个大页面,按条件切换。
- 未绑定、或上次绑定的地址连不通时展示,此时其它校验都无从谈起。
- -->
- <div v-if="viewMode === 'server'" class="auth-card auth-card--server">
- <div class="auth-card__header">
- <h2 class="auth-card__title">连接后端服务</h2>
- <div v-if="serverWarning" class="auth-card__warning">{{ serverWarning }}</div>
- </div>
- <ServerAddressPanel :show-footer-tip="false" />
- <div class="auth-card__server-foot">
- <span class="auth-card__server-tip">地址保存在本机,下次启动自动复用</span>
- <Button
- v-if="showServerBack"
- type="link"
- size="small"
- class="auth-card__server-back-btn"
- @click="handleBackFromServer"
- >
- 返回登录
- </Button>
- </div>
- </div>
- <div v-else-if="viewMode === 'license'" class="auth-card">
- <div class="auth-card__header">
- <h2 class="auth-card__title">未授权时请先完成离线授权</h2>
- <div v-if="authorizationWarningMessage" class="auth-card__warning">
- {{ authorizationWarningMessage }}
- </div>
- </div>
- <div class="auth-card__steps">
- <div v-for="(item, index) in authorizationSteps" :key="item.title" class="step-card">
- <div class="step-card__index">{{ index + 1 }}</div>
- <h4 class="step-card__title">{{ item.title }}</h4>
- <p class="step-card__desc">{{ item.desc }}</p>
- <RightOutlined v-if="index < authorizationSteps.length - 1" class="step-card__arrow" />
- </div>
- </div>
- <div class="auth-card__section">
- <div class="auth-card__section-head">
- <h3 class="auth-card__section-title">获取机器码</h3>
- <span class="auth-card__section-tip">用于申请当前设备的离线授权文件</span>
- </div>
- <div class="machine-panel">
- <div class="machine-panel__value">
- {{ machineCode || '点击“获取机器码”后显示当前设备机器码' }}
- </div>
- <div class="machine-panel__actions">
- <Button class="ui-btn ui-btn--ghost" :loading="machineCodeLoading" @click="handleGetMachineCode">
- 获取机器码
- </Button>
- <Button class="ui-btn ui-btn--ghost" :disabled="!machineCode" @click="handleCopyMachineCode">
- <CopyOutlined />
- <span>复制</span>
- </Button>
- </div>
- </div>
- </div>
- <div class="auth-card__section">
- <div class="auth-card__section-head">
- <h3 class="auth-card__section-title">上传授权文件</h3>
- <span class="auth-card__section-tip">选择本地授权文件后执行离线授权</span>
- </div>
- <div class="upload-panel">
- <!-- Web 化:直接选择本机文件上传,不再通过 Electron 读取本机路径 -->
- <input
- ref="licenseFileInputRef"
- class="upload-panel__file-input"
- type="file"
- accept=".xlts"
- @change="handleLicenseFileChange"
- />
- <div
- class="upload-panel__dropzone"
- :class="{ 'upload-panel__dropzone--has-file': !!licenseFile }"
- role="button"
- tabindex="0"
- @click="openLicenseFilePicker"
- @keydown.enter.prevent="openLicenseFilePicker"
- @keydown.space.prevent="openLicenseFilePicker"
- >
- <UploadOutlined class="upload-panel__dropzone-icon" />
- <span class="upload-panel__dropzone-text">
- {{ licenseFileName || '请选择离线授权文件' }}
- </span>
- </div>
- <div class="upload-panel__actions">
- <Button class="ui-btn ui-btn--ghost" @click="openLicenseFilePicker">选择授权文件</Button>
- <Button
- type="primary"
- class="ui-btn ui-btn--primary"
- :loading="offlineAuthorizationLoading"
- :disabled="!licenseFile"
- @click="handleOfflineAuthorization"
- >
- 离线授权
- </Button>
- </div>
- </div>
- </div>
- <div class="auth-card__server">
- <LinkOutlined />
- <span class="auth-card__server-label">服务地址</span>
- <span class="auth-card__server-value">{{ serverOrigin }}</span>
- <Button type="link" size="small" class="auth-card__server-action" @click="goServerSetup">切换</Button>
- </div>
- </div>
- <div v-else-if="viewMode === 'login'" class="auth-card auth-card--login">
- <div class="auth-card__header">
- <span class="auth-card__eyebrow">账号登录</span>
- <h2 class="auth-card__title">登录进入案件工作台</h2>
- </div>
- <div v-if="hasAuthorizationSummary" class="license-summary">
- <div class="license-summary__head">
- <SafetyCertificateOutlined />
- <span>当前设备授权信息</span>
- </div>
- <dl class="license-summary__list">
- <div v-if="authorizationUnit" class="license-summary__row">
- <dt>授权单位</dt>
- <dd>{{ authorizationUnit }}</dd>
- </div>
- <div v-if="authorizationOverDateTime" class="license-summary__row">
- <dt>授权到期</dt>
- <dd>{{ authorizationOverDateTime }}</dd>
- </div>
- </dl>
- </div>
- <Form :model="loginForm" layout="vertical" class="login-form" @submit.prevent>
- <FormItem name="username" :rules="[{ required: true, message: '请输入用户名' }]">
- <label class="login-form__label" for="login-username">用户名</label>
- <Input
- id="login-username"
- v-model:value="loginForm.username"
- placeholder="请输入用户名"
- autocomplete="username"
- allow-clear
- />
- </FormItem>
- <FormItem name="password" :rules="[{ required: true, message: '请输入密码' }]">
- <label class="login-form__label" for="login-password">密码</label>
- <Input.Password
- id="login-password"
- v-model:value="loginForm.password"
- placeholder="请输入密码"
- autocomplete="current-password"
- @press-enter="handleLoginSubmit"
- />
- </FormItem>
- <Button
- type="primary"
- block
- class="login-form__submit"
- :loading="loginLoading"
- @click="handleLoginSubmit"
- >
- 登录
- </Button>
- </Form>
- <p class="login-form__tip">账号由管理员创建,如需开通请联系管理员</p>
- <div class="auth-card__server">
- <LinkOutlined />
- <span class="auth-card__server-label">服务地址</span>
- <span class="auth-card__server-value">{{ serverOrigin }}</span>
- <Button type="link" size="small" class="auth-card__server-action" @click="goServerSetup">切换</Button>
- </div>
- </div>
- </div>
- </section>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { computed, onMounted, reactive, ref } from 'vue';
- import { useRoute, useRouter } from 'vue-router';
- import { Button, Form, FormItem, Input, Modal } from 'ant-design-vue';
- import {
- ApartmentOutlined,
- CopyOutlined,
- DatabaseOutlined,
- DesktopOutlined,
- LinkOutlined,
- LockOutlined,
- LoginOutlined,
- NotificationOutlined,
- RightOutlined,
- SafetyCertificateOutlined,
- UploadOutlined,
- } from '@ant-design/icons-vue';
- import { PageEnum } from '@/core/enums/pageEnum';
- import { getApiOrigin, getBoundServerOrigin, isServerSetupMissing } from '@/core/settings/serverSetting';
- import { AppHeader } from '@/core/components/Application';
- import ServerAddressPanel from '@/core/components/ServerAddress/ServerAddressPanel.vue';
- import { authorizationInfoApi, checkAuthApi, machineCodeApi, offlineAuthorizationApi } from '@/core/api/sys/login';
- import { LOGIN_ACCOUNT_IN_USE } from '@/core/api/auth/authApi';
- import { useCopyToClipboard } from '@/core/hooks/web/useCopyToClipboard';
- import { useDesign } from '@/core/hooks/web/useDesign';
- import { productSetting } from '@/core/settings/productSetting';
- import { useMessage } from '@/core/hooks/web/useMessage';
- import { useAccountStore } from '@/core/store/modules/account';
- import { useUserStore } from '@/core/store/modules/case';
- import { getToken } from '@/core/utils/auth';
- import { initGlobalCaseConfig } from '@/core/logics/caseConfigGuide';
- import {
- extractAuthorizationCache,
- getAuthorizationExpiredMessage,
- isAuthorizationExpired,
- } from '@/core/utils/license';
- const router = useRouter();
- const route = useRoute();
- const { prefixCls } = useDesign('authorization-entry');
- const { showMessage } = useMessage();
- const { clipboardRef, isSuccessRef } = useCopyToClipboard();
- const userStore = useUserStore();
- const accountStore = useAccountStore();
- /** 当前生效的后端地址。切换地址会整页重载,所以取一次即可。 */
- const serverOrigin = getBoundServerOrigin() || getApiOrigin() || '未配置';
- /** 服务地址卡片的告警:上次地址连不通时由启动流程带 ?error=unreachable 过来 */
- const serverWarning = ref('');
- const serverUnreachable = ref(false);
- /**
- * 切到服务地址卡片(不换页面)。
- *
- * <p>绑错地址时业务页进不去、设置抽屉也打不开,本页是唯一的自救入口。
- */
- function goServerSetup() {
- serverUnreachable.value = false;
- serverWarning.value = '';
- viewMode.value = 'server';
- }
- /** 从服务地址卡片回到登录 / 授权卡片;未绑定或上次连不通时不给这个出口 */
- async function handleBackFromServer() {
- viewMode.value = '';
- await resolveEntryMode();
- }
- /**
- * 页面形态。
- *
- * <p>`server` = 还没绑定后端地址(或上次地址连不通)→ 展示服务地址卡片;
- * `license` = 设备未授权(或授权已过期)→ 展示离线授权卡片;
- * `login` = 设备已授权但未登录 → 展示登录卡片;
- * `''` = 尚未判定,此时右侧不渲染卡片,避免先闪一下错误的形态。
- */
- type ViewMode = 'server' | 'license' | 'login';
- const viewMode = ref<ViewMode | ''>('');
- const machineCode = ref('');
- const machineCodeLoading = ref(false);
- const offlineAuthorizationLoading = ref(false);
- /** 用户选择的授权文件(Web 化:直接上传文件内容,不再传服务端路径) */
- const licenseFile = ref<File | null>(null);
- const licenseFileInputRef = ref<HTMLInputElement | null>(null);
- const licenseFileName = computed(() => licenseFile.value?.name || '');
- const authorizationWarningMessage = ref('');
- const loginForm = reactive({ username: '', password: '' });
- const loginLoading = ref(false);
- /** 登录卡片上的授权摘要(授权单位 / 到期时间),来源与授权页一致 */
- const authorizationUnit = computed(() => String(userStore.getPageCacheByKey('authorizationUnit', '') || ''));
- const authorizationOverDateTime = computed(() =>
- String(userStore.getPageCacheByKey('licenseOverDateTime', '') || ''),
- );
- const hasAuthorizationSummary = computed(() => !!(authorizationUnit.value || authorizationOverDateTime.value));
- const capabilityList = [
- {
- title: '多源数据融合',
- desc: '整合资金流水、话单、基站轨迹等异构数据,提升数据归集效率。',
- icon: DatabaseOutlined,
- },
- {
- title: '关系图谱分析',
- desc: '围绕对象、团伙与行为链路开展多端关联研判,快速定位关键关系。',
- icon: ApartmentOutlined,
- },
- {
- title: '专题预警支撑',
- desc: '结合时序分析与规则配置,辅助线索核查、案件推进和复盘总结。',
- icon: NotificationOutlined,
- },
- ];
- /** 登录态的左侧说明。刻意不复述卡片上的内容(授权信息、账号来源提示都在卡片里)。 */
- const loginTips = [
- {
- title: '账号来源',
- desc: '账号由管理员统一创建,忘记密码请联系管理员重置。',
- icon: SafetyCertificateOutlined,
- },
- {
- title: '案件隔离',
- desc: '不同案件的数据源相互独立,切换案件会重新加载对应数据源。',
- icon: DatabaseOutlined,
- },
- {
- title: '会话保护',
- desc: '长时间无操作会自动锁屏,需重新验证身份后继续。',
- icon: LockOutlined,
- },
- ];
- /** 绑定地址时的左侧说明:三步走,让首次启动的人知道后面还会发生什么 */
- const serverSteps = [
- {
- title: '绑定服务地址',
- desc: '填写管理员提供的地址,测试连通性。',
- icon: LinkOutlined,
- },
- {
- title: '完成授权校验',
- desc: '校验当前设备授权是否有效。',
- icon: SafetyCertificateOutlined,
- },
- {
- title: '登录进入系统',
- desc: '使用管理员分配的账号登录。',
- icon: LoginOutlined,
- },
- ];
- const isLoginView = computed(() => viewMode.value === 'login');
- const isServerView = computed(() => viewMode.value === 'server');
- /** 左侧文案随形态切换:地址绑定是首次启动的第一屏,需要说明接下来还有两步 */
- const pageBadge = computed(() =>
- isServerView.value ? '系统接入' : isLoginView.value ? '已授权设备' : '系统授权入口',
- );
- const pageTitle = computed(() =>
- isServerView.value ? '连接研判后端' : isLoginView.value ? '欢迎回来' : '智能研判分析平台',
- );
- const pageSubtitle = computed(() => {
- if (isServerView.value) {
- return '后端服务独立部署,首次启动需要绑定服务地址。连接通过后进入设备授权校验与账号登录。';
- }
- if (isLoginView.value) {
- return '请使用管理员分配的账号登录,登录后即可进入案件工作台,开展线索梳理与关系研判。';
- }
- return '面向案件管理、对象关联和多源数据研判的专业系统,帮助团队更高效地完成线索梳理、关系挖掘与专题分析。';
- });
- const leftFeatures = computed(() =>
- isServerView.value ? serverSteps : isLoginView.value ? loginTips : capabilityList,
- );
- /** 未绑定、或上次地址连不通时,服务卡片不能后退,否则会回到必然失败的校验流程 */
- const showServerBack = computed(
- () => viewMode.value === 'server' && !isServerSetupMissing() && !serverUnreachable.value,
- );
- const authorizationSteps = [
- {
- title: '获取机器码',
- desc: '提取当前设备机器码,并提交给授权方生成对应的离线授权文件。',
- },
- {
- title: '选择授权文件',
- desc: '从本地导入授权文件,系统会自动进行授权校验。',
- },
- {
- title: '执行离线授权',
- desc: '授权成功后即可进入系统。',
- },
- ];
- function syncAuthorizationCache(source?: unknown) {
- const { authorizationLabel, overDateTime, authorizationUnit } = extractAuthorizationCache(source);
- userStore.setPageCache('authorizationLabel', authorizationLabel);
- userStore.setPageCache('licenseOverDateTime', overDateTime);
- userStore.setPageCache('authorizationUnit', authorizationUnit);
- return {
- authorizationLabel,
- overDateTime,
- authorizationUnit,
- };
- }
- function clearAuthorizationCache() {
- syncAuthorizationCache();
- }
- async function resolveAuthorizationCache(source?: unknown) {
- const cache = syncAuthorizationCache(source);
- if (cache.overDateTime) {
- return cache;
- }
- try {
- const res = await authorizationInfoApi();
- return syncAuthorizationCache(res);
- } catch {
- return cache;
- }
- }
- function showExpiredAuthorizationMessage(overDateTime?: unknown) {
- authorizationWarningMessage.value = getAuthorizationExpiredMessage(overDateTime);
- showMessage(authorizationWarningMessage.value, 'warning');
- }
- async function loadMachineCode() {
- machineCodeLoading.value = true;
- try {
- const data = await machineCodeApi();
- machineCode.value = data || '';
- } catch (error) {
- machineCode.value = '';
- } finally {
- machineCodeLoading.value = false;
- }
- }
- function handleCopyMachineCode() {
- if (!machineCode.value) return;
- clipboardRef.value = machineCode.value;
- if (isSuccessRef.value) {
- showMessage('机器码复制成功', 'success');
- }
- }
- async function handleGetMachineCode() {
- await loadMachineCode();
- if (machineCode.value) {
- showMessage('机器码获取成功', 'success');
- }
- }
- /** 统一入口:dropzone 点击 / 键盘、以及「选择授权文件」按钮都走这里 */
- function openLicenseFilePicker() {
- licenseFileInputRef.value?.click();
- }
- function handleLicenseFileChange(event: Event) {
- const input = event.target as HTMLInputElement;
- const file = input.files?.[0] || null;
- input.value = '';
- if (!file) return;
- if (!file.name.toLowerCase().endsWith('.xlts')) {
- showMessage('请选择 .xlts 结尾的授权文件');
- return;
- }
- licenseFile.value = file;
- }
- async function handleOfflineAuthorization() {
- if (!licenseFile.value) {
- showMessage('请先选择授权文件');
- return;
- }
- offlineAuthorizationLoading.value = true;
- try {
- const res = await offlineAuthorizationApi(licenseFile.value);
- authorizationWarningMessage.value = '';
- if (res?.code === 200) {
- showMessage('离线授权成功', 'success');
- // 授权成功后不再直接进业务页:先刷新授权摘要,再按登录态决定去哪
- await resolveAuthorizationCache();
- if (getToken()) {
- await initGlobalCaseConfig();
- await router.replace(getPostLoginTarget());
- } else {
- viewMode.value = 'login';
- }
- } else {
- showMessage(res?.message || '离线授权失败');
- }
- } catch (error: any) {
- showMessage(error?.message || '离线授权失败,请稍后重试');
- } finally {
- offlineAuthorizationLoading.value = false;
- }
- }
- /**
- * 判定当前设备的授权状态。
- *
- * <p>判定方式与合并前**完全一致**(`checkAuthApi()` + `isAuthorizationExpired()`),
- * 只是不再负责跳转:这里只回答「授权是否有效」,展示哪张卡片由 `resolveEntryMode()` 决定。
- */
- async function isDeviceAuthorized(): Promise<boolean> {
- try {
- const res = await checkAuthApi();
- if (res?.code === 200) {
- const cache = await resolveAuthorizationCache(res);
- if (isAuthorizationExpired(cache.overDateTime)) {
- showExpiredAuthorizationMessage(cache.overDateTime);
- return false;
- }
- return true;
- }
- clearAuthorizationCache();
- return false;
- } catch (error: any) {
- const status = error?.response?.status || error?.status;
- if (status !== 401) {
- showMessage(error?.message || '授权校验失败,请稍后重试!');
- }
- clearAuthorizationCache();
- return false;
- }
- }
- /**
- * 登录 / 已登录后的固定落点:案件管理页。
- *
- * <p>不再回跳 `redirect`:登录态过期后重新登录时,回跳会把用户直接带回上一个业务页
- * (例如 /data/index,继而进入已打开的案件)。按产品要求,每次登录都必须先落到
- * 案件管理页,由用户自己选择要打开的案件。
- */
- function getPostLoginTarget(): string {
- return PageEnum.BASE_CASE;
- }
- /**
- * 决定入口页展示哪张卡片。
- *
- * <p>· 未绑定地址 / 上次地址连不通:先展示服务地址卡片,其它校验都无从谈起;
- * <p>· 带 `forceAuth` / `skipAuthCheck`:授权已被明确判定失效,直接进授权态;
- * <p>· 已授权 + 有 token:直接进业务页;
- * <p>· 已授权 + 无 token:登录卡片;
- * <p>· 未授权:授权卡片。
- */
- async function resolveEntryMode() {
- if (isServerSetupMissing() || serverUnreachable.value) {
- viewMode.value = 'server';
- return;
- }
- if (route.query.forceAuth === '1' || route.query.skipAuthCheck === '1') {
- viewMode.value = 'license';
- return;
- }
- const authorized = await isDeviceAuthorized();
- if (!authorized) {
- viewMode.value = 'license';
- return;
- }
- if (getToken()) {
- await initGlobalCaseConfig();
- await router.replace(getPostLoginTarget());
- return;
- }
- viewMode.value = 'login';
- }
- /**
- * 账号正在使用:确认后才带 force 重新登录。
- *
- * <p>「正在使用」= 该账号有有效会话且最近半小时内活跃过(后端判定)。
- * 确认登录会踢掉旧会话,旧会话打开的案件由后端会话监听释放。
- */
- function confirmForceLogin(username: string) {
- Modal.confirm({
- title: '账号正在使用中',
- content: '该账号最近半小时内在其他设备上有操作。继续登录会使对方下线,是否继续?',
- okText: '继续登录',
- cancelText: '取消',
- // Ant Design 的弹框默认从顶部 100px 处展开;登录页是独立的全屏入口,
- // 跟随页面居中显示更稳(窗口矮的时候也不会被顶到边缘)
- centered: true,
- onOk: async () => {
- try {
- const outcome = await accountStore.login({
- username,
- password: loginForm.password,
- force: true,
- });
- if (!outcome.ok) {
- showMessage(outcome.message || '登录失败');
- return;
- }
- await router.replace(getPostLoginTarget());
- } catch {
- // HTTP 层错误(网络/密码校验失败)已由 defHttp 统一提示
- }
- },
- });
- }
- async function handleLoginSubmit() {
- // 防重入:重复登录会因 is-concurrent=false 把前一个 token 顶掉,导致刚拿到的凭据立即失效
- if (loginLoading.value) {
- return;
- }
- const username = loginForm.username.trim();
- if (!username || !loginForm.password) {
- return;
- }
- loginLoading.value = true;
- try {
- const outcome = await accountStore.login({ username, password: loginForm.password });
- if (!outcome.ok) {
- // 账号占用是正常分支:弹确认框,确认后带 force 重新登录
- if (outcome.code === LOGIN_ACCOUNT_IN_USE) {
- confirmForceLogin(username);
- return;
- }
- showMessage(outcome.message || '登录失败');
- return;
- }
- await router.replace(getPostLoginTarget());
- } catch {
- // 错误提示已由 defHttp 统一弹出,这里只负责不跳转
- } finally {
- loginLoading.value = false;
- }
- }
- onMounted(async () => {
- // 启动时健康检查失败会带这个参数过来:地址已保存但服务不可达,先让人改地址
- if (route.query.error === 'unreachable') {
- serverUnreachable.value = true;
- serverWarning.value = '上次保存的服务地址无法连接,请确认后端服务已启动,或重新填写地址。';
- }
- if (route.query.expired === '1') {
- authorizationWarningMessage.value = String(
- route.query.message || '当前授权已过期,请重新导入有效授权文件或联系管理员。',
- );
- showMessage(authorizationWarningMessage.value, 'warning');
- }
- await resolveEntryMode();
- });
- </script>
- <style lang="less">
- @prefix-cls: ~'jeesite-authorization-entry';
- .@{prefix-cls} {
- height: 100vh;
- width: 100%;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- background: #f4f7f9;
- font-family:
- -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
- .authorization-page {
- position: relative;
- display: flex;
- width: 100%;
- height: 100vh;
- overflow: hidden;
- }
- .authorization-content {
- flex: 1;
- display: flex;
- min-height: 0;
- }
- .left-pane {
- position: relative;
- z-index: 0;
- display: none;
- flex-direction: column;
- width: 40%;
- padding: 32px 40px 24px;
- color: #fff;
- background: #165dff;
- min-height: 0;
- overflow: hidden;
- &__content {
- position: relative;
- z-index: 1;
- display: flex;
- flex: 1;
- min-height: 0;
- flex-direction: column;
- justify-content: space-between;
- gap: clamp(12px, 2vh, 24px);
- width: 100%;
- max-width: 520px;
- margin: 0 auto;
- }
- &__header {
- flex-shrink: 0;
- margin-top: 4px;
- }
- &__badge {
- display: none;
- align-items: center;
- gap: 6px;
- padding: 6px 12px;
- margin-bottom: 24px;
- font-size: 13px;
- font-weight: 500;
- color: #fff;
- letter-spacing: 0.04em;
- background: rgba(255, 255, 255, 0.1);
- border: 1px solid rgba(255, 255, 255, 0.12);
- border-radius: 999px;
- box-shadow: none;
- }
- &__title {
- margin: 0 0 16px;
- font-size: 36px;
- font-weight: 700;
- line-height: 1.18;
- letter-spacing: -0.02em;
- color: #fff;
- text-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
- }
- &__subtitle {
- max-width: 430px;
- margin: 0;
- font-size: 15px;
- font-weight: 500;
- line-height: 1.8;
- color: rgba(219, 234, 254, 0.92);
- }
- &__visual {
- display: flex;
- flex: 1 1 auto;
- align-items: center;
- justify-content: center;
- min-height: 60px;
- max-height: 200px;
- padding: 4px 0;
- }
- &__features {
- display: flex;
- flex-shrink: 0;
- flex-direction: column;
- gap: 18px;
- padding-bottom: 0;
- }
- &__footer {
- flex-shrink: 0;
- padding: 12px 0 0;
- }
- &__footer-line {
- margin: 0;
- font-size: 12px;
- line-height: 1.8;
- color: rgba(255, 255, 255, 0.5);
- }
- }
- .device-illustration {
- position: relative;
- width: 100%;
- max-width: 340px;
- aspect-ratio: 1 / 1;
- &__screen-shell {
- position: absolute;
- top: 50%;
- left: 50%;
- display: flex;
- flex-direction: column;
- width: 280px;
- height: 180px;
- padding: 20px;
- background: rgba(255, 255, 255, 0.1);
- border: 2px solid rgba(255, 255, 255, 0.2);
- border-radius: 18px;
- box-shadow: 0 24px 54px rgba(7, 24, 66, 0.24);
- backdrop-filter: blur(14px);
- transform: translate(-50%, -50%);
- }
- &__screen-dots {
- display: flex;
- gap: 8px;
- margin-bottom: 16px;
- span {
- width: 10px;
- height: 10px;
- background: rgba(255, 255, 255, 0.3);
- border-radius: 999px;
- }
- }
- &__screen-body {
- display: flex;
- flex: 1;
- flex-direction: column;
- gap: 10px;
- padding: 14px;
- background: rgba(255, 255, 255, 0.05);
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 12px;
- }
- &__line {
- height: 10px;
- background: rgba(255, 255, 255, 0.2);
- border-radius: 999px;
- &--lg {
- width: 75%;
- }
- &--md {
- width: 50%;
- }
- }
- &__chart {
- display: flex;
- gap: 8px;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 54px;
- margin-top: auto;
- background: rgba(255, 255, 255, 0.1);
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 10px;
- span {
- width: 16px;
- height: 16px;
- background: rgba(96, 165, 250, 0.5);
- border-radius: 4px;
- }
- }
- &__stand {
- position: absolute;
- bottom: calc(50% - 126px);
- left: 50%;
- width: 96px;
- height: 24px;
- background: rgba(255, 255, 255, 0.1);
- backdrop-filter: blur(12px);
- transform: translateX(-50%);
- &::before {
- content: '';
- position: absolute;
- bottom: -10px;
- left: 50%;
- width: 144px;
- height: 8px;
- background: rgba(255, 255, 255, 0.2);
- border-radius: 999px;
- filter: blur(2px);
- transform: translateX(-50%);
- }
- }
- &__shadow {
- position: absolute;
- inset: auto 22px 42px;
- height: 110px;
- background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 72%);
- filter: blur(22px);
- }
- }
- .floating-card {
- position: absolute;
- z-index: 2;
- display: flex;
- gap: 12px;
- align-items: center;
- padding: 16px;
- color: #165dff;
- background: #fff;
- border-radius: 16px;
- box-shadow: 0 18px 36px rgba(10, 22, 70, 0.18);
- &--left {
- top: 25%;
- left: -40px;
- animation: float-bounce-left 4s infinite;
- }
- &--right {
- right: -48px;
- bottom: 32%;
- animation: float-bounce-right 5s infinite 0.5s;
- }
- &__icon {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 36px;
- height: 36px;
- font-size: 20px;
- color: #165dff;
- background: #eff6ff;
- border-radius: 12px;
- &--indigo {
- color: #4f46e5;
- background: #eef2ff;
- }
- }
- &__label {
- margin-bottom: 2px;
- font-size: 12px;
- font-weight: 500;
- color: #6b7280;
- }
- &__title {
- font-size: 14px;
- font-weight: 700;
- color: #111827;
- }
- }
- .feature-item {
- display: flex;
- gap: 16px;
- align-items: flex-start;
- &__icon {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- width: 48px;
- height: 48px;
- font-size: 24px;
- color: #fff;
- background: rgba(255, 255, 255, 0.1);
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 14px;
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
- }
- &__title {
- margin: 0 0 4px;
- font-size: 16px;
- font-weight: 600;
- letter-spacing: 0.02em;
- color: #fff;
- }
- &__desc {
- max-width: 320px;
- margin: 0;
- font-size: 14px;
- line-height: 1.7;
- color: rgba(219, 234, 254, 0.82);
- }
- }
- .right-pane {
- position: relative;
- z-index: 10;
- display: flex;
- flex: 1;
- align-items: center;
- justify-content: center;
- padding: 24px;
- background: transparent;
- box-sizing: border-box;
- min-height: 0;
- overflow: visible;
- &__curve {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 0;
- display: none;
- width: 120px;
- height: 100%;
- color: #f4f7f9;
- transform: translateX(-99%);
- pointer-events: none;
- }
- &__scroll {
- position: relative;
- z-index: 1;
- display: flex;
- flex: 1;
- align-items: center;
- justify-content: center;
- height: 100%;
- min-height: 0;
- overflow-y: auto;
- overflow-x: visible;
- scrollbar-width: none;
- &::-webkit-scrollbar {
- width: 0;
- height: 0;
- }
- }
- }
- .auth-card {
- position: relative;
- z-index: 10;
- width: 100%;
- max-width: 540px;
- padding: 16px;
- margin: auto 0;
- background: #fff;
- border: 1px solid #f3f4f6;
- border-radius: 18px;
- box-shadow: 0 8px 40px -12px rgba(0, 0, 0, 0.08);
- &__header {
- margin-bottom: 14px;
- }
- &__eyebrow {
- display: inline-block;
- padding: 1px 8px;
- margin-bottom: 6px;
- font-size: 11px;
- line-height: 18px;
- font-weight: 700;
- letter-spacing: 0.04em;
- color: #2563eb;
- background: #eff6ff;
- border: 1px solid #dbeafe;
- border-radius: 6px;
- }
- &__title {
- margin: 0 0 4px;
- font-size: 20px;
- font-weight: 700;
- letter-spacing: -0.02em;
- color: #111827;
- }
- &__warning {
- padding: 10px 12px;
- margin-bottom: 8px;
- font-size: 13px;
- font-weight: 700;
- line-height: 1.6;
- color: #b91c1c;
- background: #fef2f2;
- border: 1px solid #fecaca;
- border-radius: 10px;
- }
- &__steps {
- display: grid;
- grid-template-columns: 1fr;
- gap: 6px;
- margin-bottom: 10px;
- }
- &__section {
- margin-bottom: 8px;
- }
- &__section-head {
- display: flex;
- justify-content: space-between;
- gap: 8px;
- align-items: baseline;
- margin-bottom: 3px;
- }
- &__section-title {
- margin: 0;
- font-size: 16px;
- font-weight: 700;
- color: #111827;
- }
- &__section-tip {
- font-size: 12px;
- font-weight: 500;
- color: #9ca3af;
- }
- // 卡片底部的服务地址入口:绑错地址时唯一的自救通道
- &__server {
- display: flex;
- gap: 6px;
- align-items: center;
- padding-top: 12px;
- margin-top: 16px;
- font-size: 12px;
- line-height: 1.6;
- color: #9ca3af;
- border-top: 1px solid #f3f4f6;
- }
- &__server-label {
- flex: none;
- }
- &__server-value {
- flex: 1;
- min-width: 0;
- overflow: hidden;
- color: #6b7280;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- &__server-action {
- flex: none;
- height: auto;
- padding: 0 4px;
- font-size: 12px;
- }
- }
- // ---------- 服务地址卡片(未绑定 / 上次地址连不通) ----------
- .auth-card.auth-card--server {
- max-width: 560px;
- .auth-card__header {
- margin-bottom: 22px;
- }
- }
- .auth-card__server-foot {
- display: flex;
- gap: 8px;
- align-items: center;
- justify-content: space-between;
- padding-top: 14px;
- margin-top: 18px;
- border-top: 1px solid #f3f4f6;
- }
- .auth-card__server-tip {
- font-size: 12px;
- line-height: 1.6;
- color: #9ca3af;
- }
- .auth-card__server-back-btn {
- flex: none;
- height: auto;
- padding: 0 4px;
- font-size: 12px;
- }
- // ---------- 登录卡片(设备已授权、但未登录) ----------
- // 用 .auth-card.auth-card--login 提权,压住后面媒体查询里的 .auth-card 规则
- .auth-card.auth-card--login {
- max-width: 480px;
- .auth-card__header {
- margin-bottom: 18px;
- }
- }
- .license-summary {
- padding: 12px 14px;
- margin-bottom: 20px;
- background: #f8fafc;
- border: 1px solid #e5e7eb;
- border-radius: 12px;
- &__head {
- display: flex;
- gap: 6px;
- align-items: center;
- margin-bottom: 9px;
- font-size: 11px;
- font-weight: 700;
- letter-spacing: 0.04em;
- color: #6b7280;
- }
- &__list {
- display: grid;
- gap: 7px;
- margin: 0;
- }
- &__row {
- display: flex;
- gap: 12px;
- align-items: baseline;
- font-size: 12.5px;
- line-height: 1.5;
- dt {
- flex: none;
- width: 58px;
- color: #9ca3af;
- }
- dd {
- margin: 0;
- font-weight: 600;
- color: #374151;
- word-break: break-all;
- }
- }
- }
- .login-form {
- .ant-form-item {
- margin-bottom: 16px;
- }
- &__label {
- display: block;
- margin-bottom: 7px;
- font-size: 12.5px;
- font-weight: 500;
- color: #4b5563;
- cursor: pointer;
- }
- .ant-input,
- .ant-input-affix-wrapper {
- height: 42px;
- padding: 0 12px;
- font-size: 13.5px;
- color: #111827;
- background: #fff;
- border: 1px solid #d1d5db;
- border-radius: 9px;
- box-shadow: none;
- transition:
- border-color 0.18s ease-out,
- box-shadow 0.18s ease-out;
- &::placeholder {
- color: #9ca3af;
- }
- &:hover {
- border-color: #93c5fd;
- }
- &:focus,
- &:focus-within,
- &-focused {
- border-color: #165dff;
- box-shadow: 0 0 0 3px rgb(22 93 255 / 12%);
- }
- }
- // 外壳与内层 input 叠加会重复画边框,这里抹平
- .ant-input-affix-wrapper > .ant-input {
- height: auto;
- padding: 0;
- color: inherit;
- background: transparent;
- border: 0;
- border-radius: 0;
- box-shadow: none;
- &:hover,
- &:focus {
- background: transparent;
- border: 0;
- box-shadow: none;
- }
- }
- .ant-input-clear-icon,
- .ant-input-suffix .anticon {
- color: #9ca3af;
- &:hover {
- color: #6b7280;
- }
- }
- .ant-form-item-explain-error {
- padding-top: 3px;
- font-size: 12px;
- }
- &__submit {
- &.ant-btn {
- height: 44px;
- padding: 0 18px;
- margin-top: 4px;
- font-size: 14px;
- font-weight: 600;
- border-radius: 9px;
- box-shadow: none;
- }
- &.ant-btn.ant-btn-primary {
- color: #fff;
- background: #165dff;
- border-color: #165dff;
- &:hover:not([disabled]) {
- background: #0f56f0;
- border-color: #0f56f0;
- box-shadow: 0 10px 22px -10px rgb(22 93 255 / 60%);
- }
- }
- }
- &__tip {
- margin: 14px 0 0;
- font-size: 12px;
- line-height: 1.6;
- color: #9ca3af;
- text-align: center;
- }
- }
- .step-card {
- position: relative;
- padding: 8px;
- background: #f8fafc;
- border: 1px solid #f3f4f6;
- border-radius: 10px;
- transition:
- background-color 0.2s ease,
- border-color 0.2s ease,
- transform 0.2s ease;
- &:hover {
- background: rgba(239, 246, 255, 0.6);
- border-color: #bfdbfe;
- transform: translateY(-1px);
- .step-card__index {
- transform: scale(1.1);
- }
- }
- &__index {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 18px;
- height: 18px;
- margin-bottom: 4px;
- font-size: 9px;
- font-weight: 700;
- color: #fff;
- background: #2563eb;
- border-radius: 999px;
- box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
- transition: transform 0.2s ease;
- }
- &__title {
- margin: 0 0 2px;
- font-size: 13px;
- font-weight: 700;
- color: #111827;
- }
- &__desc {
- margin: 0;
- font-size: 12px;
- line-height: 1.45;
- color: #6b7280;
- }
- &__arrow {
- position: absolute;
- top: 18px;
- right: -10px;
- z-index: 10;
- display: none;
- font-size: 14px;
- color: #d1d5db;
- }
- }
- .machine-panel,
- .upload-panel {
- padding: 7px;
- background: #f8fafc;
- border: 1px solid #e5e7eb;
- border-radius: 10px;
- box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
- }
- .machine-panel {
- &__value {
- min-height: 40px;
- margin-bottom: 6px;
- padding: 7px 9px;
- font-family: Consolas, 'Courier New', monospace;
- font-size: 12px;
- line-height: 1.5;
- color: #4b5563;
- word-break: break-all;
- background: #fff;
- border: 1px solid #e5e7eb;
- border-radius: 8px;
- box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
- }
- &__actions {
- display: flex;
- justify-content: flex-end;
- gap: 4px;
- }
- }
- .upload-panel {
- // 原生 file 控件只用于触发选择,视觉上完全由下方 dropzone 承担。
- // 注意:选择器必须挂在 .upload-panel 下(曾经误挂在 .auth-card 里,
- // 编译成 .auth-card__file-input 永远匹配不到,导致原生控件裸露在页面上)。
- &__file-input {
- display: none;
- }
- &__dropzone {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 2px;
- min-height: 64px;
- padding: 8px;
- margin-bottom: 6px;
- text-align: center;
- cursor: pointer;
- background: #fff;
- border: 2px dashed #d1d5db;
- border-radius: 8px;
- transition:
- background-color 0.2s ease,
- border-color 0.2s ease,
- transform 0.2s ease;
- &:hover {
- background: rgba(239, 246, 255, 0.6);
- border-color: #93c5fd;
- .upload-panel__dropzone-icon {
- transform: scale(1.1);
- }
- .upload-panel__dropzone-text {
- color: #3b82f6;
- }
- }
- }
- &__dropzone-icon {
- font-size: 18px;
- color: #3b82f6;
- transition: transform 0.2s ease;
- }
- &__dropzone-text {
- font-size: 12px;
- font-weight: 500;
- line-height: 1.45;
- color: #9ca3af;
- word-break: break-all;
- transition: color 0.2s ease;
- }
- // 已选中文件:实线蓝框 + 文件名高亮,给出明确的选中反馈
- &__dropzone--has-file {
- background: #f8fbff;
- border-color: #93c5fd;
- border-style: solid;
- .upload-panel__dropzone-text {
- font-weight: 600;
- color: #2563eb;
- }
- }
- &__actions {
- display: flex;
- justify-content: flex-end;
- gap: 4px;
- }
- }
- .ui-btn {
- display: inline-flex;
- gap: 4px;
- align-items: center;
- justify-content: center;
- height: auto;
- padding: 4px 9px;
- font-size: 12px;
- font-weight: 500;
- border-radius: 8px;
- transition:
- background-color 0.2s ease,
- border-color 0.2s ease,
- color 0.2s ease,
- box-shadow 0.2s ease,
- transform 0.2s ease;
- &.ant-btn {
- box-shadow: none;
- }
- &.ant-btn > span {
- display: inline-flex;
- gap: 4px;
- align-items: center;
- }
- &:active {
- transform: scale(0.99);
- }
- &--ghost {
- color: #374151;
- background: #fff;
- border-color: #d1d5db;
- box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
- &:hover,
- &:focus {
- color: #374151;
- background: #f9fafb;
- border-color: #d1d5db;
- }
- }
- &--primary {
- color: #fff;
- background: #165dff;
- border-color: #165dff;
- box-shadow: 0 6px 18px rgba(22, 93, 255, 0.28);
- &:hover,
- &:focus,
- &.ant-btn-primary:hover,
- &.ant-btn-primary:focus {
- color: #fff;
- background: #0f56f0;
- border-color: #0f56f0;
- }
- &.ant-btn-primary,
- &.ant-btn-color-primary,
- &.ant-btn-variant-solid {
- color: #fff;
- background: #165dff;
- border-color: #165dff;
- }
- &.ant-btn-primary:disabled,
- &.ant-btn-primary[disabled],
- &.ant-btn-color-primary:disabled,
- &.ant-btn-color-primary[disabled],
- &.ant-btn-variant-solid:disabled,
- &.ant-btn-variant-solid[disabled] {
- color: rgba(255, 255, 255, 0.88);
- background: rgba(22, 93, 255, 0.55);
- border-color: rgba(22, 93, 255, 0.55);
- box-shadow: none;
- opacity: 1;
- }
- }
- }
- @keyframes float-bounce-left {
- 0%,
- 100% {
- transform: translate3d(0, 0, 0);
- }
- 50% {
- transform: translate3d(0, -12px, 0);
- }
- }
- @keyframes float-bounce-right {
- 0%,
- 100% {
- transform: translate3d(0, 0, 0);
- }
- 50% {
- transform: translate3d(0, -10px, 0);
- }
- }
- }
- @media screen and (min-width: 992px) {
- .@{prefix-cls} {
- .auth-card {
- padding: 40px;
- }
- }
- }
- @media screen and (min-width: 1280px) {
- .@{prefix-cls} {
- .left-pane {
- display: flex;
- }
- .right-pane {
- padding: 48px;
- &__curve {
- display: block;
- }
- }
- .auth-card {
- &__steps {
- grid-template-columns: repeat(3, minmax(0, 1fr));
- }
- }
- .step-card {
- &__arrow {
- display: block;
- }
- }
- }
- }
- @media screen and (min-width: 1536px) {
- .@{prefix-cls} {
- .left-pane {
- width: 45%;
- padding: 56px;
- &__title {
- font-size: 42px;
- }
- &__subtitle {
- font-size: 16px;
- }
- }
- .right-pane__curve {
- width: 160px;
- }
- .device-illustration {
- max-width: 340px;
- &__screen-shell {
- width: 280px;
- height: 180px;
- }
- }
- .floating-card {
- padding: 16px;
- }
- .feature-item {
- &__icon {
- width: 48px;
- height: 48px;
- font-size: 24px;
- }
- &__title {
- font-size: 16px;
- }
- &__desc {
- font-size: 14px;
- }
- }
- }
- }
- @media screen and (max-width: 1279px) {
- .@{prefix-cls} {
- .left-pane {
- display: none;
- }
- .right-pane {
- align-items: center;
- padding: 24px 20px;
- }
- .right-pane__scroll {
- align-items: center;
- }
- .auth-card {
- margin: auto 0;
- }
- }
- }
- @media screen and (max-width: 767px) {
- .@{prefix-cls} {
- .right-pane {
- padding: 16px;
- align-items: flex-start;
- }
- .right-pane__scroll {
- align-items: flex-start;
- }
- .auth-card {
- padding: 22px 18px;
- margin: 0;
- &__header {
- margin-bottom: 24px;
- }
- &__section-head {
- flex-direction: column;
- align-items: flex-start;
- }
- }
- .machine-panel__actions,
- .upload-panel__actions {
- flex-wrap: wrap;
- }
- .machine-panel__actions > *,
- .upload-panel__actions > * {
- flex: 1 1 calc(50% - 5px);
- }
- }
- }
- @media screen and (max-width: 1366px) and (min-width: 1280px) and (max-height: 768px) {
- .@{prefix-cls} {
- .left-pane {
- width: 37%;
- padding: 20px 24px 16px;
- &__content {
- max-width: 420px;
- gap: 14px;
- }
- &__header {
- margin-top: 2px;
- }
- &__badge {
- margin-bottom: 14px;
- padding: 5px 10px;
- font-size: 12px;
- }
- &__title {
- margin-bottom: 10px;
- font-size: 28px;
- line-height: 1.14;
- }
- &__subtitle {
- max-width: 360px;
- font-size: 13px;
- line-height: 1.6;
- }
- &__visual {
- min-height: 40px;
- padding: 2px 0;
- }
- &__features {
- gap: 10px;
- padding-bottom: 0;
- }
- }
- .device-illustration {
- max-width: 236px;
- &__screen-shell {
- width: 208px;
- height: 136px;
- padding: 14px;
- border-radius: 16px;
- }
- &__screen-dots {
- gap: 6px;
- margin-bottom: 12px;
- span {
- width: 8px;
- height: 8px;
- }
- }
- &__screen-body {
- gap: 8px;
- padding: 10px;
- }
- &__line {
- height: 8px;
- }
- &__chart {
- height: 40px;
- span {
- width: 13px;
- height: 13px;
- }
- }
- &__stand {
- bottom: calc(50% - 94px);
- width: 78px;
- height: 18px;
- &::before {
- bottom: -8px;
- width: 112px;
- height: 6px;
- }
- }
- &__shadow {
- inset: auto 18px 32px;
- height: 72px;
- }
- }
- .floating-card {
- gap: 10px;
- padding: 10px 12px;
- border-radius: 14px;
- &--left {
- top: 23%;
- left: -12px;
- }
- &--right {
- right: -16px;
- bottom: 27%;
- }
- &__icon {
- width: 30px;
- height: 30px;
- font-size: 16px;
- border-radius: 10px;
- }
- &__label {
- font-size: 10px;
- }
- &__title {
- font-size: 13px;
- }
- }
- .feature-item {
- gap: 10px;
- &__icon {
- width: 36px;
- height: 36px;
- font-size: 18px;
- border-radius: 12px;
- }
- &__title {
- margin-bottom: 2px;
- font-size: 14px;
- }
- &__desc {
- max-width: 280px;
- font-size: 12px;
- line-height: 1.45;
- }
- }
- .right-pane {
- align-items: center;
- padding: 14px 18px;
- }
- .right-pane__scroll {
- align-items: center;
- }
- .auth-card {
- max-width: 522px;
- padding: 20px 20px 18px;
- border-radius: 18px;
- &__header {
- margin-bottom: 18px;
- }
- &__eyebrow {
- margin-bottom: 10px;
- font-size: 11px;
- }
- &__title {
- margin-bottom: 8px;
- font-size: 18px;
- }
- &__steps {
- gap: 8px;
- margin-bottom: 18px;
- }
- &__section {
- margin-bottom: 14px;
- }
- &__section-head {
- margin-bottom: 6px;
- }
- &__section-title {
- font-size: 13px;
- }
- &__section-tip {
- font-size: 11px;
- }
- &__footer {
- padding-top: 14px;
- margin-top: 18px;
- }
- }
- .step-card {
- padding: 12px 10px;
- border-radius: 12px;
- &__index {
- width: 22px;
- height: 22px;
- margin-bottom: 8px;
- font-size: 10px;
- }
- &__title {
- margin-bottom: 5px;
- font-size: 12px;
- }
- &__desc {
- font-size: 11px;
- line-height: 1.5;
- }
- &__arrow {
- top: 23px;
- right: -7px;
- font-size: 14px;
- }
- }
- .machine-panel,
- .upload-panel {
- padding: 10px;
- border-radius: 12px;
- }
- .machine-panel {
- &__value {
- min-height: 54px;
- margin-bottom: 10px;
- padding: 10px 12px;
- font-size: 11px;
- line-height: 1.6;
- border-radius: 10px;
- }
- &__actions {
- gap: 8px;
- }
- }
- .upload-panel {
- &__dropzone {
- min-height: 84px;
- padding: 12px;
- margin-bottom: 10px;
- }
- &__dropzone-icon {
- font-size: 22px;
- }
- &__dropzone-text {
- font-size: 12px;
- line-height: 1.5;
- }
- &__actions {
- gap: 8px;
- }
- }
- .ui-btn {
- padding: 7px 14px;
- font-size: 12px;
- border-radius: 9px;
- }
- }
- }
- @media screen and (max-height: 860px) and (min-width: 1280px) {
- .@{prefix-cls} {
- .left-pane {
- padding: 24px 32px 16px;
- &__content {
- gap: 18px;
- }
- &__title {
- margin-bottom: 10px;
- font-size: 30px;
- }
- &__subtitle {
- font-size: 14px;
- line-height: 1.6;
- }
- &__visual {
- min-height: 80px;
- padding: 4px 0;
- }
- &__features {
- gap: 14px;
- }
- }
- .device-illustration {
- max-width: 290px;
- &__screen-shell {
- width: 244px;
- height: 160px;
- padding: 16px;
- }
- &__screen-body {
- padding: 12px;
- gap: 8px;
- }
- &__chart {
- height: 48px;
- }
- }
- .floating-card {
- padding: 12px 14px;
- &--left {
- left: -22px;
- }
- &--right {
- right: -28px;
- }
- }
- .feature-item {
- gap: 12px;
- &__icon {
- width: 42px;
- height: 42px;
- font-size: 20px;
- }
- &__title {
- font-size: 15px;
- }
- &__desc {
- font-size: 13px;
- line-height: 1.6;
- }
- }
- .right-pane {
- align-items: flex-start;
- padding-top: 18px;
- padding-bottom: 18px;
- }
- .right-pane__scroll {
- align-items: flex-start;
- }
- .auth-card {
- padding: 26px 26px 22px;
- }
- .auth-card__steps {
- margin-bottom: 28px;
- }
- .step-card {
- padding: 14px;
- }
- }
- }
- // 窄窗口下左侧栏只有 ~470px,两张固定宽度的浮动卡片会压在设备图中间,
- // 把设备图里的图表盖住。这里直接收起装饰卡片,保留设备示意本身。
- @media screen and (max-width: 1439px) {
- .@{prefix-cls} .floating-card {
- display: none;
- }
- }
- </style>
|