feat: 新增xq0031_xq0032 ERP报表导出插件,完成功能与基建更新
1. 新增xq0031_xq0032插件:包含前后端源码、打包脚本、配置文件与插件元数据 2. 新增内网文件服务器组件:exe、启停脚本、打包脚本与配置 3. 新增敏感凭证RSA加密下发能力与存储结构 4. 新增大文件源管理表与相关API 5. 优化登录流程与会话管理,新增Chrome自动化安装工具链 6. 清理废弃插件与示例代码 7. 更新版本号至1.1.3,完善安装包与.gitignore配置
This commit is contained in:
@@ -6,10 +6,35 @@
|
||||
</div>
|
||||
<LoginPage v-else-if="!store.current" :app-name="store.appName" @ok="onLogin" />
|
||||
<div class="__app" v-else>
|
||||
<!-- 壳子更新提示:控制面有新版本且已自动下载,点击重启升级 -->
|
||||
<div v-if="shellUpdate.downloaded" class="update-bar">
|
||||
<span class="upd-txt">发现新版本 <b>v{{ shellUpdate.new }}</b><em v-if="shellUpdate.notes">{{ shellUpdate.notes }}</em></span>
|
||||
<el-button size="small" type="primary" round :loading="updating" @click="doShellUpdate">重启更新</el-button>
|
||||
<!-- 壳子更新提示:下载进度 / 已就绪重启更新 / 发现新版本可下载 -->
|
||||
<div v-if="updBarVisible" class="update-bar">
|
||||
<template v-if="updDl.status === 'downloading'">
|
||||
<span class="upd-txt">正在下载新版本 <b>v{{ updDl.version }}</b></span>
|
||||
<div class="upd-mid">
|
||||
<el-progress :percentage="updDl.pct" :show-text="false" :stroke-width="6" class="upd-progress" />
|
||||
<span class="upd-pct">{{ updDl.total ? updDl.pct + '%' : fmtBytes(updDl.received) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="shellUpdate.downloaded">
|
||||
<span class="upd-txt">发现新版本 <b>v{{ shellUpdate.new }}</b><em v-if="shellUpdate.notes">{{ shellUpdate.notes }}</em></span>
|
||||
<el-button size="small" type="primary" round :loading="updating" @click="doShellUpdate">重启更新</el-button>
|
||||
</template>
|
||||
<template v-else-if="updDl.status === 'failed'">
|
||||
<span class="upd-txt">新版本下载失败<em>{{ updDl.error }}</em></span>
|
||||
<el-button size="small" type="primary" round :loading="downloading" @click="onShellDownload">重试</el-button>
|
||||
</template>
|
||||
<template v-else-if="shellUpdate.available">
|
||||
<span class="upd-txt">发现新版本 <b>v{{ shellUpdate.latest }}</b><em v-if="shellUpdate.notes">{{ shellUpdate.notes }}</em></span>
|
||||
<div class="upd-actions">
|
||||
<el-button size="small" type="primary" round :loading="downloading" @click="onShellDownload">立即下载</el-button>
|
||||
<el-button size="small" round @click="shellDismissed = true">暂不</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<!-- 授权已过期:离线超 7 天须联网刷新票据后才能继续使用 -->
|
||||
<div v-if="store.authExpired" class="auth-expired-bar">
|
||||
<span class="ae-txt">授权已过期(最长离线 7 天),需联网刷新授权后才能继续使用</span>
|
||||
<el-button size="small" type="primary" round :loading="syncingPlugins" @click="onPluginSync">立即刷新</el-button>
|
||||
</div>
|
||||
<!-- 顶部:品牌 + 平台登录态 + 当前账号/登出 + 进度 -->
|
||||
<header class="topbar panel">
|
||||
@@ -46,6 +71,25 @@
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<!-- 浏览器(Chrome)状态图标:已安装显示版本(绿),未安装高亮可点击进入下载/安装 -->
|
||||
<div class="band chrome-band" v-if="chromeVis">
|
||||
<el-tooltip
|
||||
:content="chromeTip"
|
||||
placement="bottom"
|
||||
>
|
||||
<el-button
|
||||
class="chip chrome-chip"
|
||||
:class="{ ok: chromeInstalled, warn: !chromeInstalled && chromeCloud, loading: chromeBusy }"
|
||||
round
|
||||
:loading="chromeBusy"
|
||||
@click="onChromeClick"
|
||||
>
|
||||
<i class="chrome-icon" :class="{ blink: !chromeInstalled }"></i>
|
||||
<span>{{ chromeLabel }}</span>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="run-state">
|
||||
@@ -67,18 +111,7 @@
|
||||
<span class="acct-avatar-fb">{{ (store.nickname || store.current).slice(0, 1).toUpperCase() }}</span>
|
||||
</el-avatar>
|
||||
<span class="acct-name">{{ store.nickname || store.current }}</span>
|
||||
<el-tag v-if="store.isAdmin" size="small" type="primary" effect="light" round>管理员</el-tag>
|
||||
</button>
|
||||
<el-button
|
||||
v-if="store.isAdmin"
|
||||
v-show="store.controlplane"
|
||||
class="chip admin-chip"
|
||||
title="打开中心机控制面进行插件/账号/授权管理"
|
||||
round
|
||||
@click="openConsole"
|
||||
>
|
||||
<el-icon class="geo"><Setting /></el-icon>管理控制台
|
||||
</el-button>
|
||||
<el-button class="chip" round @click="logout">登出</el-button>
|
||||
</div>
|
||||
</header>
|
||||
@@ -88,7 +121,13 @@
|
||||
<aside class="panel side">
|
||||
<div class="side-head">
|
||||
<span class="sec-title">场景</span>
|
||||
<span class="count">{{ store.plugins.length }}</span>
|
||||
<div class="side-head-r">
|
||||
<span class="count">{{ store.plugins.length }}</span>
|
||||
<el-tooltip content="插件同步" placement="top">
|
||||
<el-button class="sync-btn" text :icon="Refresh" :loading="syncingPlugins"
|
||||
:disabled="store.running" @click="onPluginSync" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="scene-list">
|
||||
<li
|
||||
@@ -105,7 +144,15 @@
|
||||
</li>
|
||||
</ul>
|
||||
<div v-if="!store.plugins.length" class="scene-empty">当前账号暂无可用场景<br><span>请联系管理员进行授权</span></div>
|
||||
<div class="side-foot">场景以插件方式接入</div>
|
||||
<div class="side-foot">
|
||||
<div class="foot-ver">
|
||||
<span class="ver-num">壳子 {{ shellUpdate.current ? 'v' + shellUpdate.current : '未打包' }}</span>
|
||||
<el-link type="primary" :underline="false" class="check-link"
|
||||
:disabled="shellChecking" @click="onShellCheck">
|
||||
{{ shellChecking ? '检查中…' : '检查更新' }}</el-link>
|
||||
</div>
|
||||
<div>场景以插件方式接入</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="main">
|
||||
@@ -120,19 +167,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Refresh } from '@element-plus/icons-vue'
|
||||
import PluginPage from './components/PluginPage.vue'
|
||||
import LogPanel from './components/LogPanel.vue'
|
||||
import LoginPage from './components/LoginPage.vue'
|
||||
import ProfilePanel from './components/ProfilePanel.vue'
|
||||
import { store, handleEvent, clearLogs, log, loadAvatar, clearAvatarCache, accountAvatar } from './store'
|
||||
import { connectWS, fetchMeta, loginPlatform, adminLogout, adminMe, adminPassword, syncPlugins, getShellStatus, applyShellUpdate } from './api'
|
||||
|
||||
function openConsole() {
|
||||
if (!store.controlplane) return
|
||||
window.open(store.controlplane, '_blank', 'noopener')
|
||||
}
|
||||
import { connectWS, fetchMeta, loginPlatform, adminLogout, adminMe, adminPassword, syncPlugins, getShellStatus, applyShellUpdate, checkShellUpdate, downloadShellUpdate, getChromeStatus, checkChrome, downloadChrome, installChrome } from './api'
|
||||
|
||||
const PALETTE = ['#3b6cff', '#7c5cff', '#12a4d8', '#22b07a', '#e88a3a', '#e5484d']
|
||||
|
||||
@@ -164,9 +207,9 @@ function openWS() {
|
||||
onMounted(async () => {
|
||||
const meta = await fetchMeta()
|
||||
store.appName = meta.appName
|
||||
store.controlplane = meta.controlplane || ''
|
||||
store.platforms = meta.platforms
|
||||
store.plugins = meta.plugins || []
|
||||
store.authExpired = !!meta.authExpired
|
||||
store.selectedId = store.plugins[0]?.id || ''
|
||||
clearLogs()
|
||||
openWS()
|
||||
@@ -174,19 +217,158 @@ onMounted(async () => {
|
||||
booting.value = false // 会话判定完成(登录/未登录/后端不可达均已定),再渲染首屏
|
||||
loadAvatar()
|
||||
loadShellStatus()
|
||||
loadChromeStatus()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (shellPollTimer) { clearTimeout(shellPollTimer); shellPollTimer = null }
|
||||
if (chromePollTimer) { clearTimeout(chromePollTimer); chromePollTimer = null }
|
||||
})
|
||||
|
||||
// ===== 浏览器(Chrome)检测/下载/安装 =====
|
||||
const chrome = ref({})
|
||||
let chromePollTimer = null
|
||||
const chromeBusy = ref(false) // 正在轮询/下载/安装(按钮 loading)
|
||||
|
||||
const chromeInstalled = computed(() => !!chrome.value.installed)
|
||||
const chromeVisible = computed(() => {
|
||||
// 下载中/已下载待安装/未安装但中心机有登记 → 显示;已装则不显示(已可用不占用空间)
|
||||
return chrome.value.installed || chrome.value.downloaded || chrome.value.cloud_available
|
||||
})
|
||||
// 与模板 v-if 共用(template 里用的是字符串写法,这里保持简单)
|
||||
const chromeVis = computed(() =>
|
||||
!chrome.value.installed || chrome.value.downloaded || chrome.value.dl?.status === 'downloading')
|
||||
|
||||
const chromeLabel = computed(() => {
|
||||
const c = chrome.value
|
||||
if (c.installing) return '安装中…'
|
||||
if (!c.installed) {
|
||||
if (c.dl?.status === 'downloading') return c.dl?.pct + '%'
|
||||
if (c.downloaded) return '点击安装'
|
||||
if (c.cloud_available) return '装浏览器'
|
||||
return '浏览器'
|
||||
}
|
||||
return c.version ? 'Chrome ' + c.version : 'Chrome'
|
||||
})
|
||||
|
||||
const chromeTip = computed(() => {
|
||||
const c = chrome.value
|
||||
if (c.installed) return `本机已安装 Chrome ${c.version},点击重新检测`
|
||||
if (c.installing) return '正在安装 Chrome,请稍候…'
|
||||
if (c.downloaded) return 'Chrome 安装包已下载,点击安装'
|
||||
if (c.dl?.status === 'downloading') return '正在下载 Chrome 安装包 ' + c.dl?.pct + '%'
|
||||
if (!c.cloud_available) return '中心机暂未登记浏览器安装包,点击重新检测'
|
||||
return '本机未安装 Chrome,点击下载安装'
|
||||
})
|
||||
|
||||
async function loadChromeStatus() {
|
||||
try { chrome.value = await getChromeStatus() } catch (_) {}
|
||||
// 未安装或操作中才轮询;已安装无需常驻
|
||||
if (!chrome.value.installed || chrome.value.installing || chrome.value.dl?.status === 'downloading') {
|
||||
startChromePoll()
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshChromeStatus() {
|
||||
try {
|
||||
const s = await getChromeStatus()
|
||||
chrome.value = s
|
||||
if (chrome.value.installed && chrome.value.dl?.status !== 'downloading' && !chrome.value.installing) {
|
||||
if (chromePollTimer) { clearTimeout(chromePollTimer); chromePollTimer = null }
|
||||
return // 已装好,停止轮询
|
||||
}
|
||||
} catch (_) {}
|
||||
chromePollTimer = setTimeout(refreshChromeStatus, 1500)
|
||||
}
|
||||
function startChromePoll() {
|
||||
if (chromePollTimer) return
|
||||
refreshChromeStatus()
|
||||
}
|
||||
|
||||
async function onChromeClick() {
|
||||
if (chromeBusy.value) return
|
||||
const c = chrome.value
|
||||
// 安装中:仅刷新状态
|
||||
if (c.installing) { return }
|
||||
// 已下载:直接安装
|
||||
if (c.downloaded) {
|
||||
chromeBusy.value = true
|
||||
try { await installChrome(); chrome.value.installing = true; startChromePoll() }
|
||||
catch (e) { ElMessage.error('安装失败:' + (e.message || e)) }
|
||||
chromeBusy.value = false
|
||||
return
|
||||
}
|
||||
// 未装且中心机有登记:下载
|
||||
if (!c.installed && c.cloud_available) {
|
||||
chromeBusy.value = true
|
||||
try { await downloadChrome(); loadChromeStatus() }
|
||||
catch (e) { ElMessage.error('开始下载失败:' + (e.message || e)) }
|
||||
chromeBusy.value = false
|
||||
return
|
||||
}
|
||||
// 其余:重新检测
|
||||
chromeBusy.value = true
|
||||
try { await checkChrome(); loadChromeStatus() }
|
||||
catch (e) { ElMessage.error('检测失败:' + (e.message || e)) }
|
||||
chromeBusy.value = false
|
||||
}
|
||||
|
||||
const profileOpen = ref(false)
|
||||
const busyLogin = ref('')
|
||||
const booting = ref(true) // 鉴权判定中:未确定会话前先显示加载骨架,避免「闪一下登录页再进首页」
|
||||
const syncing = ref(false) // 首次启动/启动时:按账号权限自下载/更新插件(等待下载界面)
|
||||
|
||||
// ===== 壳子自动更新:控制面有新版本且已自动下载 → 提示用户点击重启升级 =====
|
||||
// ===== 壳子自动更新:检查 → 用户确认下载(带进度)→ 重启更新 =====
|
||||
const shellUpdate = ref({})
|
||||
const updating = ref(false)
|
||||
const downloading = ref(false)
|
||||
const shellChecking = ref(false) // 手动检查请求进行中(秒级)
|
||||
const shellDismissed = ref(false) // 用户点了"暂不",本会话内隐藏"立即下载"提示
|
||||
let shellPollTimer = null // 状态轮询(setTimeout 递归,下载中 1.2s / 常态 15s)
|
||||
let lastDlStatus = '' // 上一轮下载状态,用于下载完成/失败时的一次性提示
|
||||
|
||||
const updDl = computed(() => shellUpdate.value.dl || {})
|
||||
const updBarVisible = computed(() =>
|
||||
shellUpdate.value.downloaded ||
|
||||
updDl.value.status === 'downloading' ||
|
||||
updDl.value.status === 'failed' ||
|
||||
(shellUpdate.value.available && !shellDismissed.value)
|
||||
)
|
||||
|
||||
function fmtBytes(n) {
|
||||
if (!n) return '0 B'
|
||||
const u = ['B', 'KB', 'MB', 'GB']
|
||||
let i = 0
|
||||
while (n >= 1024 && i < u.length - 1) { n /= 1024; i++ }
|
||||
return (n >= 100 || i === 0 ? n.toFixed(0) : n.toFixed(1)) + ' ' + u[i]
|
||||
}
|
||||
|
||||
async function loadShellStatus() {
|
||||
try { shellUpdate.value = await getShellStatus() } catch (_) {}
|
||||
startShellPoll()
|
||||
}
|
||||
|
||||
// 常驻状态轮询:驱动下载进度条与 available/downloaded 提示;下载完成/失败各提示一次
|
||||
async function refreshShellStatus() {
|
||||
try {
|
||||
const s = await getShellStatus()
|
||||
shellUpdate.value = s
|
||||
const st = s.dl?.status || ''
|
||||
if (lastDlStatus === 'downloading' && st === 'downloaded') {
|
||||
ElMessage.success(`新版本 v${s.new} 已下载完成,点击顶部「重启更新」完成升级`)
|
||||
log('INFO', `壳子新版本 v${s.new} 已就绪,可重启更新`)
|
||||
} else if (lastDlStatus === 'downloading' && st === 'failed') {
|
||||
ElMessage.warning('新版本下载失败:' + (s.dl?.error || ''))
|
||||
}
|
||||
lastDlStatus = st
|
||||
} catch (_) {}
|
||||
shellPollTimer = setTimeout(refreshShellStatus, updDl.value.status === 'downloading' ? 1200 : 15000)
|
||||
}
|
||||
function startShellPoll() {
|
||||
if (shellPollTimer) return
|
||||
refreshShellStatus()
|
||||
}
|
||||
|
||||
async function doShellUpdate() {
|
||||
updating.value = true
|
||||
try {
|
||||
@@ -197,6 +379,100 @@ async function doShellUpdate() {
|
||||
}
|
||||
}
|
||||
|
||||
async function onShellDownload() {
|
||||
if (downloading.value) return
|
||||
downloading.value = true
|
||||
shellDismissed.value = false
|
||||
try {
|
||||
await downloadShellUpdate() // 后端后台流式下载,进度经轮询展示
|
||||
} catch (e) {
|
||||
ElMessage.error('开始下载失败:' + (e.message || e))
|
||||
}
|
||||
downloading.value = false
|
||||
}
|
||||
|
||||
// 手动"检查更新":触发秒级版本比对 → 轮询检查结束后按结果提示
|
||||
async function onShellCheck() {
|
||||
if (shellChecking.value) return
|
||||
try { await checkShellUpdate() } catch (e) {
|
||||
ElMessage.error('检查更新失败:' + (e.message || e))
|
||||
return
|
||||
}
|
||||
shellChecking.value = true
|
||||
const timer = setInterval(async () => {
|
||||
try {
|
||||
const s = await getShellStatus()
|
||||
shellUpdate.value = s
|
||||
if (s.checking) return
|
||||
clearInterval(timer)
|
||||
shellChecking.value = false
|
||||
handleCheckResult(s)
|
||||
} catch (_) {}
|
||||
}, 800)
|
||||
// 兜底:30s 仍未结束则停止轮询,避免无限等待
|
||||
setTimeout(() => {
|
||||
if (shellChecking.value) {
|
||||
clearInterval(timer)
|
||||
shellChecking.value = false
|
||||
}
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
function handleCheckResult(s) {
|
||||
if (!s.current) {
|
||||
ElMessage.info('当前为源码开发模式,不参与壳子自更新')
|
||||
return
|
||||
}
|
||||
if (s.downloaded) {
|
||||
ElMessage.info(`新版本 v${s.new} 已就绪,点击顶部「重启更新」完成升级`)
|
||||
return
|
||||
}
|
||||
if (updDl.value.status === 'downloading') return // 正在下载,进度条展示中
|
||||
if (s.error) {
|
||||
ElMessage.warning('检查更新失败:' + s.error)
|
||||
log('WARN', `检查壳子更新失败:${s.error}`)
|
||||
return
|
||||
}
|
||||
if (s.available) {
|
||||
ElMessageBox.confirm(
|
||||
`发现新版本 v${s.latest},是否立即下载?${s.notes ? '\n\n更新说明:' + s.notes : ''}`,
|
||||
'发现新版本',
|
||||
{ confirmButtonText: '立即下载', cancelButtonText: '稍后再说', type: 'info' }
|
||||
).then(() => onShellDownload()).catch(() => {})
|
||||
} else {
|
||||
ElMessage.info(`已是最新版本 v${s.current}`)
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 插件同步:按当前账号权限重新同步(新装/更新/清理已删除),完成后刷新清单 =====
|
||||
// 登录成功与手动刷新共用;同步失败也补拉清单,保证离线时沿用本地已装插件
|
||||
const syncingPlugins = ref(false)
|
||||
async function onPluginSync() {
|
||||
if (syncingPlugins.value || store.running) return
|
||||
syncingPlugins.value = true
|
||||
try {
|
||||
const r = await syncPlugins()
|
||||
const parts = []
|
||||
if (r.downloaded?.length) parts.push(`新装 ${r.downloaded.length} 个`)
|
||||
if (r.updated?.length) parts.push(`更新 ${r.updated.length} 个`)
|
||||
if (r.removed?.length) parts.push(`清理 ${r.removed.length} 个`)
|
||||
if (r.failed?.length) parts.push(`失败 ${r.failed.length} 个`)
|
||||
if (parts.length) {
|
||||
ElMessage.success('插件同步完成:' + parts.join(','))
|
||||
const detail = [...(r.downloaded || []), ...(r.updated || []), ...(r.removed || [])].join('、')
|
||||
if (detail) log('INFO', `插件同步完成:${parts.join(',')}(${detail})`)
|
||||
} else {
|
||||
ElMessage.info('插件已是最新')
|
||||
}
|
||||
if (r.failed?.length) log('ERROR', `插件同步失败:${r.failed.join('、')}`)
|
||||
} catch (e) {
|
||||
ElMessage.error('插件同步失败:' + (e.message || e))
|
||||
} finally {
|
||||
await refreshMeta()
|
||||
syncingPlugins.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 平台登录等轻量操作反馈:统一走 element-plus 全局消息
|
||||
function showToast(msg, type = 'info') {
|
||||
ElMessage({ message: msg, type, duration: 2200 })
|
||||
@@ -208,12 +484,11 @@ async function checkSession() {
|
||||
try {
|
||||
const me = await adminMe()
|
||||
if (!me.account) {
|
||||
store.current = ''; store.isAdmin = false; store.dept = ''; store.nickname = ''; store.avatar = ''
|
||||
store.current = ''; store.dept = ''; store.nickname = ''; store.avatar = ''
|
||||
try { localStorage.removeItem('cp_account') } catch (_) {}
|
||||
return
|
||||
}
|
||||
store.current = me.account
|
||||
store.isAdmin = !!me.is_admin
|
||||
store.dept = me.dept || ''
|
||||
store.nickname = me.nickname || ''
|
||||
store.avatar = me.avatar || ''
|
||||
@@ -230,24 +505,28 @@ async function checkSession() {
|
||||
async function refreshMeta() {
|
||||
try {
|
||||
const meta = await fetchMeta()
|
||||
store.controlplane = meta.controlplane || ''
|
||||
store.platforms = meta.platforms
|
||||
store.plugins = meta.plugins || []
|
||||
if (!store.selectedId) store.selectedId = store.plugins[0]?.id || ''
|
||||
store.authExpired = !!meta.authExpired
|
||||
// 选中场景不存在(被同步清理/授权收回)时回落到第一个可用场景
|
||||
if (!store.plugins.find((p) => p.id === store.selectedId)) {
|
||||
store.selectedId = store.plugins[0]?.id || ''
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
async function onLogin(ok) {
|
||||
store.current = ok.account
|
||||
store.isAdmin = !!ok.is_admin
|
||||
store.dept = ok.dept || ''
|
||||
store.nickname = ok.nickname || ''
|
||||
store.avatar = ok.avatar || ''
|
||||
try { localStorage.setItem('cp_account', ok.account) } catch (_) {}
|
||||
// 登录后:刷新平台权限与插件清单,并用带会话的连接重建 WS
|
||||
await refreshMeta()
|
||||
// 登录成功后立即按该账号权限同步插件(新装机首次登录即下载授权插件),再刷新平台/清单
|
||||
await onPluginSync()
|
||||
openWS()
|
||||
loadAvatar()
|
||||
loadShellStatus() // 挂载时未登录拉不到更新状态,登录后补拉(版本显示/更新提示)
|
||||
loadChromeStatus() // 浏览器状态同此
|
||||
// 首次登录/钉钉自动建号的默认密码:提示立即改密
|
||||
if (ok.must_change_pwd) { promptChangePwd(ok.account) }
|
||||
}
|
||||
@@ -270,10 +549,10 @@ async function promptChangePwd(account) {
|
||||
async function logout() {
|
||||
try { await adminLogout() } catch (_) {}
|
||||
store.current = ''
|
||||
store.isAdmin = false
|
||||
store.nickname = ''
|
||||
store.avatar = ''
|
||||
store.avatarUrl = ''
|
||||
store.authExpired = false
|
||||
try { localStorage.removeItem('cp_account') } catch (_) {}
|
||||
}
|
||||
|
||||
@@ -342,6 +621,10 @@ async function login(id) {
|
||||
}
|
||||
.update-bar b { color: var(--primary); }
|
||||
.update-bar em { font-style: normal; color: var(--text-faint); margin-left: 6px; }
|
||||
.update-bar .upd-mid { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 340px; }
|
||||
.update-bar .upd-progress { flex: 1; }
|
||||
.update-bar .upd-pct { font-size: 12px; color: var(--text-faint); min-width: 46px; text-align: right; }
|
||||
.update-bar .upd-actions { display: flex; align-items: center; gap: 8px; }
|
||||
.brand { display: flex; align-items: center; gap: 11px; }
|
||||
.logo {
|
||||
width: 36px; height: 36px; border-radius: 10px;
|
||||
@@ -364,9 +647,32 @@ async function login(id) {
|
||||
.chip.online { border-color: transparent; background: var(--ok-weak); color: #1a8f63; }
|
||||
.chip.online .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,176,122,.18); }
|
||||
.chip.locked { border-style: dashed; opacity: .5; }
|
||||
.admin-chip { border-color: rgba(59,108,255,.45); color: var(--primary); background: var(--primary-weak-2); margin-left: 4px; }
|
||||
.admin-chip:hover { border-color: var(--primary); }
|
||||
.admin-chip .geo { margin-right: 4px; }
|
||||
|
||||
/* 浏览器(Chrome)状态图标 */
|
||||
.chrome-band { margin-left: 2px; }
|
||||
.chrome-chip { border-color: transparent; background: var(--surface-2); color: var(--text-sub); }
|
||||
.chrome-chip.ok { background: var(--ok-weak); color: #1a8f63; }
|
||||
.chrome-chip.warn { background: #FFF4E5; color: #9A5B14; border-color: rgba(224,122,40,.4); }
|
||||
.chrome-icon {
|
||||
width: 14px; height: 14px; border-radius: 50%;
|
||||
margin-right: 6px; display: inline-block; flex-shrink: 0;
|
||||
background: radial-gradient(circle at 30% 30%, #e6f2ff, #4a8cf7 55%, #2b6be0);
|
||||
box-shadow: 0 0 0 3px rgba(74, 140, 247, .18);
|
||||
}
|
||||
.chrome-chip.warn .chrome-icon { background: radial-gradient(circle at 30% 30%, #fff6e6, #f7a23a 55%, #e07324); box-shadow: 0 0 0 3px rgba(247,162,58,.2); }
|
||||
.chrome-chip.loading .chrome-icon { opacity: .4; }
|
||||
.chrome-icon.blink { animation: chromeblink 1s infinite ease-in-out; }
|
||||
@keyframes chromeblink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
|
||||
|
||||
.auth-expired-bar {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
||||
padding: 8px 14px; margin-bottom: 12px; flex-shrink: 0;
|
||||
background: #FFF4E5;
|
||||
border: 1px solid rgba(224, 122, 40, .45);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 13px; color: #9A5B14;
|
||||
}
|
||||
.auth-expired-bar .ae-txt { flex: 1; }
|
||||
|
||||
.spacer { flex: 1; }
|
||||
.run-state { display: flex; align-items: center; gap: 10px; }
|
||||
@@ -389,6 +695,9 @@ async function login(id) {
|
||||
|
||||
.side { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; padding: 14px 12px; }
|
||||
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
|
||||
.side-head-r { display: flex; align-items: center; gap: 2px; }
|
||||
.sync-btn { padding: 5px 6px; font-size: 14px; color: var(--text-faint); }
|
||||
.sync-btn:hover { color: var(--primary); }
|
||||
.count { font-size: 11px; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
|
||||
.scene-list { list-style: none; margin: 0; padding: 0; flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
|
||||
.scene-list li {
|
||||
@@ -415,7 +724,10 @@ async function login(id) {
|
||||
font-size: 12.5px; color: var(--text-sub); line-height: 1.9; padding: 20px 12px;
|
||||
}
|
||||
.scene-empty span { font-size: 11px; color: var(--text-faint); }
|
||||
.side-foot { font-size: 10px; color: var(--text-faint); text-align: center; padding-top: 10px; border-top: 1px dashed var(--border); margin-top: 8px; }
|
||||
.side-foot { font-size: 10px; color: var(--text-faint); text-align: center; padding-top: 10px; border-top: 1px dashed var(--border); margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
|
||||
.foot-ver { display: flex; align-items: center; justify-content: center; gap: 8px; }
|
||||
.ver-num { font-variant-numeric: tabular-nums; }
|
||||
.check-link { font-size: 10px; vertical-align: baseline; }
|
||||
|
||||
.main { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
|
||||
.page-scroll { flex: 1; min-height: 0; padding: 20px 24px; overflow: auto; }
|
||||
|
||||
@@ -23,10 +23,32 @@ export async function getShellStatus() {
|
||||
return j('/api/shell/update-status')
|
||||
}
|
||||
|
||||
export async function checkShellUpdate() {
|
||||
return j('/api/shell/check', { method: 'POST' })
|
||||
}
|
||||
|
||||
export async function downloadShellUpdate() {
|
||||
return j('/api/shell/download', { method: 'POST' })
|
||||
}
|
||||
|
||||
export async function applyShellUpdate() {
|
||||
return j('/api/shell/apply', { method: 'POST' })
|
||||
}
|
||||
|
||||
// ===== 浏览器(Chrome)安装 =====
|
||||
export async function getChromeStatus() {
|
||||
return j('/api/chrome/status')
|
||||
}
|
||||
export async function checkChrome() {
|
||||
return j('/api/chrome/check', { method: 'POST' })
|
||||
}
|
||||
export async function downloadChrome() {
|
||||
return j('/api/chrome/download', { method: 'POST' })
|
||||
}
|
||||
export async function installChrome() {
|
||||
return j('/api/chrome/install', { method: 'POST' })
|
||||
}
|
||||
|
||||
export async function loginPlatform(id) {
|
||||
return j(`/api/platforms/${id}/login`, { method: 'POST' })
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ChatDotRound } from '@element-plus/icons-vue'
|
||||
import { adminLogin, adminPassword, authDingtalk } from '../api'
|
||||
import { adminLogin, authDingtalk } from '../api'
|
||||
|
||||
defineProps({ appName: { type: String, default: '' } })
|
||||
const emit = defineEmits(['ok'])
|
||||
@@ -83,7 +83,6 @@ async function doLogin() {
|
||||
ElMessage.success('登录成功')
|
||||
emit('ok', {
|
||||
account: account.value.trim(),
|
||||
is_admin: !!r.is_admin,
|
||||
dept: r.dept || '',
|
||||
must_change_pwd: !!r.must_change_pwd,
|
||||
nickname: r.nickname || '',
|
||||
@@ -112,25 +111,6 @@ async function openDing() {
|
||||
}
|
||||
dingBusy.value = false
|
||||
}
|
||||
|
||||
async function promptChangePwd(acc, r) {
|
||||
try {
|
||||
const { value: np } = await ElMessageBox.prompt(
|
||||
'当前为系统默认密码,请立即设置新密码(至少 6 位)',
|
||||
'首次登录 · 修改密码',
|
||||
{
|
||||
inputType: 'password', inputPattern: /^.{6,}$/, inputErrorMessage: '密码至少 6 位',
|
||||
confirmButtonText: '设置新密码', cancelButtonText: '稍后再说'
|
||||
})
|
||||
try {
|
||||
await adminPassword({ account: acc, old_password: '', new_password: np })
|
||||
ElMessage.success('密码已更新')
|
||||
} catch (e2) {
|
||||
ElMessage.warning('改密失败:' + (e2.message || e2))
|
||||
}
|
||||
} catch (_) { /* 用户取消 */ }
|
||||
emit('ok', { account: acc, is_admin: !!r.is_admin, dept: '', created: !!r.created, nickname: r.nickname || '' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -27,42 +27,62 @@
|
||||
</template>
|
||||
</el-alert>
|
||||
|
||||
<!-- 参数 -->
|
||||
<div class="sec-head">
|
||||
<span class="sec-title">参数配置</span>
|
||||
<el-button v-if="Object.keys(form).length" size="small" text :disabled="store.running" :icon="RefreshLeft"
|
||||
@click="resetForm">恢复默认</el-button>
|
||||
<!-- 专属界面插件:插件 UI 直接内嵌在页面主体(同源共享会话 cookie,不再弹窗/外跳),日志保持在其下方可见 -->
|
||||
<div v-if="plugin.ui" class="ui-inline">
|
||||
<div class="ui-tip">账号密码、仓库编码、日期选项等个性化配置在界面内填写并自动保存在本机,下次打开自动回填;执行日志实时显示在下方日志区。</div>
|
||||
<iframe :key="plugin.id" :src="uiSrc" class="pui-frame" title="插件界面"></iframe>
|
||||
</div>
|
||||
<el-form label-width="auto" class="form-card">
|
||||
<div class="fields">
|
||||
<el-form-item v-for="f in plugin.fields" :key="f.key" :label="f.label">
|
||||
<template v-if="f.type === 'int'">
|
||||
<el-input-number v-model="form[f.key]" :controls="false" placeholder="0" :disabled="store.running" />
|
||||
</template>
|
||||
<el-input v-else-if="f.type === 'text'" v-model="form[f.key]" :placeholder="String(f.default ?? '')"
|
||||
:disabled="store.running">
|
||||
<template v-if="f.help" #suffix>
|
||||
<el-tooltip :content="f.help" placement="bottom"><el-icon class="help-ic">
|
||||
<QuestionFilled />
|
||||
</el-icon></el-tooltip>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-select v-else v-model="form[f.key]" :disabled="store.running">
|
||||
<el-option v-for="opt in f.options" :key="opt" :value="opt" :label="opt" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<span v-if="store.running" class="run-ind">
|
||||
<el-progress :percentage="store.progress" :show-text="false" color="#3b6cff" />
|
||||
</span>
|
||||
<el-button type="primary" size="large" :loading="store.running" @click="run">
|
||||
{{ store.running ? '执行中 ' + store.progress + '%' : '一键执行' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<p class="hint">执行日志与进度实时显示在下方日志区,结果完成后自动汇总于此。</p>
|
||||
<!-- 参数 -->
|
||||
<template v-else>
|
||||
<div class="sec-head">
|
||||
<span class="sec-title">参数配置</span>
|
||||
<el-button v-if="Object.keys(form).length" size="small" text :disabled="store.running" :icon="RefreshLeft"
|
||||
@click="resetForm">恢复默认</el-button>
|
||||
</div>
|
||||
<el-form label-width="auto" class="form-card">
|
||||
<div class="fields">
|
||||
<el-form-item v-for="f in plugin.fields" :key="f.key" :label="f.label">
|
||||
<template v-if="f.type === 'int'">
|
||||
<el-input-number v-model="form[f.key]" :controls="false" placeholder="0" :disabled="store.running" />
|
||||
</template>
|
||||
<el-input v-else-if="f.type === 'password'" v-model="form[f.key]" type="password" show-password
|
||||
:placeholder="String(f.default ?? '')" :disabled="store.running">
|
||||
<template v-if="f.help || f.description" #suffix>
|
||||
<el-tooltip :content="f.help || f.description" placement="bottom"><el-icon class="help-ic">
|
||||
<QuestionFilled />
|
||||
</el-icon></el-tooltip>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-input v-else-if="f.type === 'text'" v-model="form[f.key]" :placeholder="String(f.default ?? '')"
|
||||
:disabled="store.running">
|
||||
<template v-if="f.help || f.description" #suffix>
|
||||
<el-tooltip :content="f.help || f.description" placement="bottom"><el-icon class="help-ic">
|
||||
<QuestionFilled />
|
||||
</el-icon></el-tooltip>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-select v-else-if="f.type === 'multiselect'" v-model="form[f.key]" multiple filterable allow-create
|
||||
default-first-option placeholder="选择或输入后回车" :disabled="store.running">
|
||||
<el-option v-for="opt in (f.options || [])" :key="opt" :value="opt" :label="opt" />
|
||||
</el-select>
|
||||
<el-select v-else v-model="form[f.key]" :disabled="store.running">
|
||||
<el-option v-for="opt in f.options" :key="opt" :value="opt" :label="opt" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<span v-if="store.running" class="run-ind">
|
||||
<el-progress :percentage="store.progress" :show-text="false" color="#3b6cff" />
|
||||
</span>
|
||||
<el-button type="primary" size="large" :loading="store.running" @click="run">
|
||||
{{ store.running ? '执行中 ' + store.progress + '%' : '一键执行' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<p v-if="!plugin.ui" class="hint">执行日志与进度实时显示在下方日志区,结果完成后自动汇总于此。</p>
|
||||
</div>
|
||||
|
||||
<el-empty v-else-if="!store.plugins.length" description="当前账号暂无可用场景" />
|
||||
@@ -112,6 +132,10 @@ function resetForm() {
|
||||
form.value = buildFormDefaults(plugin.value)
|
||||
}
|
||||
|
||||
// 专属界面插件:插件 UI 直接内嵌在页面主体(同源自动携带会话 cookie,不再弹窗/外跳)。
|
||||
// 不能用 window.open 外跳:壳子是 PyWebView 窗口,系统浏览器里没有会话 cookie,会 401。
|
||||
const uiSrc = computed(() => (plugin.value?.ui ? `/pui/${plugin.value.id}/` : ''))
|
||||
|
||||
async function run() {
|
||||
if (!plugin.value || store.running) return
|
||||
if (plugin.value.platform && !(store.platforms.find((p) => p.id === plugin.value.platform)?.online)) {
|
||||
@@ -240,6 +264,33 @@ function closeBanner() {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.ui-inline {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.ui-tip {
|
||||
font-size: 12px;
|
||||
color: var(--text-sub);
|
||||
background: var(--surface-2, #f7f8fa);
|
||||
border: 1px dashed var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
.pui-frame {
|
||||
display: block;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
min-height: 420px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: #f6f7fb;
|
||||
}
|
||||
|
||||
.fields {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
|
||||
@@ -3,24 +3,28 @@
|
||||
v-model="visible"
|
||||
title="个人中心"
|
||||
direction="rtl"
|
||||
size="350px"
|
||||
size="360px"
|
||||
:with-header="true"
|
||||
@close="emit('close')"
|
||||
>
|
||||
<!-- 个人信息 -->
|
||||
<!-- 个人信息:头像 + 昵称(大字)/ 工号(小字),更换头像收进小图标 -->
|
||||
<section class="pcard">
|
||||
<div class="cover"></div>
|
||||
<div class="pcard-main">
|
||||
<el-avatar :size="60" :src="accountAvatar()" @error="onAvatarError" class="avatar">
|
||||
<span>{{ displayName.slice(0, 1).toUpperCase() }}</span>
|
||||
</el-avatar>
|
||||
<div class="avatar-wrap">
|
||||
<el-avatar :size="64" :src="accountAvatar()" @error="onAvatarError" class="avatar">
|
||||
<span>{{ displayName.slice(0, 1) }}</span>
|
||||
</el-avatar>
|
||||
<button class="avatar-pick" title="更换头像" @click="pickAvatar">
|
||||
<el-icon :size="11"><Camera /></el-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="pcard-id">
|
||||
<div class="name-line">
|
||||
<strong>{{ displayName }}</strong>
|
||||
<em v-if="store.isAdmin" class="admin">管理员</em>
|
||||
</div>
|
||||
<span class="acct mono">{{ store.current }}</span>
|
||||
<span class="dept">{{ store.dept || '未设置部门' }}</span>
|
||||
<span class="avatar-act" @click="pickAvatar">更换头像</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pcard-rows">
|
||||
@@ -39,7 +43,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 平台登录态 -->
|
||||
<!-- 折叠面板:平台登录态 / 我的插件 / 修改密码 -->
|
||||
<el-collapse v-model="activeNames">
|
||||
<el-collapse-item name="platforms">
|
||||
<template #title>
|
||||
@@ -59,7 +63,6 @@
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
|
||||
<!-- 我的插件 -->
|
||||
<el-collapse-item name="plugins">
|
||||
<template #title>
|
||||
<div class="panel-title">
|
||||
@@ -67,7 +70,7 @@
|
||||
<span>我的插件 ({{ store.plugins.length }})</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-empty v-if="!store.plugins.length" description="当前账号暂无可用插件" />
|
||||
<p v-if="!store.plugins.length" class="empty-tip">当前账号暂无可用插件</p>
|
||||
<div v-else class="ilist">
|
||||
<div v-for="(p, i) in store.plugins" :key="p.id" class="irow">
|
||||
<span class="ridx mono">{{ String(i + 1).padStart(2, '0') }}</span>
|
||||
@@ -77,34 +80,37 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
<!-- 修改密码 -->
|
||||
<el-card class="pwd-card" shadow="never" title="修改密码">
|
||||
<el-form label-position="top" :model="form" :rules="rules" ref="formRef">
|
||||
<el-form-item label="旧密码" prop="oldPwd">
|
||||
<el-input v-model="form.oldPwd" type="password" show-password placeholder="请输入旧密码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="newPwd">
|
||||
<el-input v-model="form.newPwd" type="password" show-password placeholder="至少 6 位,不与原密码相同" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认新密码" prop="newPwd2">
|
||||
<el-input v-model="form.newPwd2" type="password" show-password placeholder="再次输入新密码" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="pwdBusy" @click="changePwd" style="width: 100%">
|
||||
<el-collapse-item name="password">
|
||||
<template #title>
|
||||
<div class="panel-title">
|
||||
<el-icon><Lock /></el-icon>
|
||||
<span>修改密码</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form label-position="top" :model="form" :rules="rules" ref="formRef" class="pwd-form">
|
||||
<el-form-item label="旧密码" prop="oldPwd">
|
||||
<el-input v-model="form.oldPwd" type="password" show-password placeholder="请输入旧密码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="newPwd">
|
||||
<el-input v-model="form.newPwd" type="password" show-password placeholder="至少 6 位,不与原密码相同" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认新密码" prop="newPwd2">
|
||||
<el-input v-model="form.newPwd2" type="password" show-password placeholder="再次输入新密码" />
|
||||
</el-form-item>
|
||||
<el-button type="primary" :loading="pwdBusy" @click="changePwd" class="pwd-submit">
|
||||
{{ pwdBusy ? '提交中…' : '保存新密码' }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Connection, Box } from '@element-plus/icons-vue'
|
||||
import { Connection, Box, Lock, Camera } from '@element-plus/icons-vue'
|
||||
import { store, log, clearAvatarCache, accountAvatar } from '../store'
|
||||
import { loginPlatform, logoutPlatform, adminPassword, adminAvatarUpload } from '../api'
|
||||
|
||||
@@ -112,7 +118,7 @@ const emit = defineEmits(['close'])
|
||||
// 由父组件 v-if 控制挂载,挂载即展开;关闭经 @close 通知父组件卸载
|
||||
const visible = ref(true)
|
||||
|
||||
// 展示名:优先真实姓名(钉钉登录带入),无姓名时回退账号(工号)
|
||||
// 展示名:优先昵称(真实姓名),无昵称时回退账号(工号)
|
||||
const displayName = computed(() => store.nickname || store.current)
|
||||
|
||||
// 头像:复用全局 store 的在线头像(带 localStorage 缓存);加载失败时清除缓存并回退首字符色块
|
||||
@@ -143,7 +149,7 @@ function pickAvatar() {
|
||||
fileInput.click()
|
||||
}
|
||||
|
||||
const activeNames = ref(['platforms', 'plugins'])
|
||||
const activeNames = ref(['platforms', 'plugins']) // 修改密码默认折叠,点击展开
|
||||
const busy = ref('')
|
||||
|
||||
async function relogin(id) {
|
||||
@@ -235,55 +241,50 @@ async function changePwd() {
|
||||
|
||||
/* ================= 个人信息卡 ================= */
|
||||
.pcard {
|
||||
margin-bottom: 18px;
|
||||
background: #ffffff;
|
||||
margin-bottom: 14px;
|
||||
background: #fff;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 10px 28px -18px rgba(23, 24, 26, .35);
|
||||
}
|
||||
.cover {
|
||||
height: 66px;
|
||||
background:
|
||||
radial-gradient(360px 200px at 90% -30%, rgba(208, 74, 36, .5), transparent 60%),
|
||||
radial-gradient(300px 180px at -10% 120%, rgba(120, 128, 140, .4), transparent 60%),
|
||||
#1a1c1f;
|
||||
position: relative;
|
||||
height: 58px;
|
||||
background: linear-gradient(135deg, #dfe7ff 0%, #eef2ff 55%, #f6f8ff 100%);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.pcard-main {
|
||||
display: flex; align-items: center; gap: 14px;
|
||||
padding: 0 18px 16px;
|
||||
padding: 0 18px 14px;
|
||||
margin-top: -30px;
|
||||
position: relative;
|
||||
}
|
||||
.avatar-wrap { position: relative; flex: none; }
|
||||
.avatar {
|
||||
border: 3px solid #fff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 6px 16px -6px rgba(23, 24, 26, .45);
|
||||
background: #17181a;
|
||||
color: #f6f4ec;
|
||||
box-shadow: 0 4px 14px -4px rgba(59, 108, 255, .35);
|
||||
background: var(--primary-grad);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
flex: none;
|
||||
}
|
||||
.avatar-pick {
|
||||
position: absolute; right: -2px; bottom: -2px;
|
||||
width: 20px; height: 20px; border-radius: 50%;
|
||||
display: grid; place-items: center;
|
||||
border: 2px solid #fff;
|
||||
background: var(--primary); color: #fff;
|
||||
cursor: pointer; padding: 0;
|
||||
transition: transform .12s;
|
||||
}
|
||||
.avatar-pick:hover { transform: scale(1.12); }
|
||||
.pcard-id { min-width: 0; }
|
||||
.name-line { display: flex; align-items: center; gap: 8px; }
|
||||
.name-line strong { font-size: 16px; letter-spacing: .01em; color: #17181a; }
|
||||
.admin {
|
||||
font-style: normal; font-size: 10.5px; font-weight: 600;
|
||||
color: #d04a24;
|
||||
border: 1px solid rgba(208, 74, 36, .35);
|
||||
background: rgba(208, 74, 36, .07);
|
||||
border-radius: 4px;
|
||||
padding: 1px 6px;
|
||||
letter-spacing: .04em;
|
||||
.name-line strong {
|
||||
font-size: 17px; font-weight: 700; letter-spacing: .01em; color: var(--text);
|
||||
white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px;
|
||||
}
|
||||
.dept { font-size: 12px; color: var(--text-faint); }
|
||||
.avatar-act {
|
||||
display: inline-block; margin-top: 5px;
|
||||
font-size: 11px; color: #d04a24; cursor: pointer;
|
||||
border-bottom: 1px dashed rgba(208, 74, 36, .4);
|
||||
}
|
||||
.avatar-act:hover { color: #b23c1b; }
|
||||
.acct { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-faint); }
|
||||
.dept { display: block; margin-top: 2px; font-size: 12px; color: var(--text-sub); }
|
||||
|
||||
.pcard-rows { border-top: 1px solid var(--border); }
|
||||
.crow {
|
||||
@@ -294,11 +295,21 @@ async function changePwd() {
|
||||
}
|
||||
.crow:last-child { border-bottom: none; }
|
||||
.crow span:first-child { color: var(--text-sub); }
|
||||
.crow .mono { color: #17181a; font-size: 13px; font-weight: 600; }
|
||||
.crow .mono { color: var(--text); font-size: 13px; font-weight: 600; }
|
||||
|
||||
/* ================= 折叠面板 ================= */
|
||||
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); }
|
||||
.panel-title :deep(.el-icon) { color: #d04a24; }
|
||||
.panel-title :deep(.el-icon) { color: var(--primary); }
|
||||
:deep(.el-collapse) { border: none; }
|
||||
:deep(.el-collapse-item__header) {
|
||||
height: 42px; background: #f6f8fd;
|
||||
border: 1px solid var(--border); border-radius: 9px;
|
||||
padding: 0 14px; margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
}
|
||||
:deep(.el-collapse-item__header.is-active) { border-color: rgba(59, 108, 255, .45); }
|
||||
:deep(.el-collapse-item__wrap) { border-bottom: none; }
|
||||
:deep(.el-collapse-item__content) { padding: 4px 6px 8px; }
|
||||
|
||||
/* ---------- 平台登录态:编号 + 发丝线 ---------- */
|
||||
.prow {
|
||||
@@ -327,17 +338,16 @@ async function changePwd() {
|
||||
.irow:last-child { border-bottom: none; }
|
||||
.iname { flex: 1; color: var(--text); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.iver { font-size: 11px; color: var(--text-faint); }
|
||||
.i-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #d04a24; }
|
||||
.i-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
|
||||
.empty-tip {
|
||||
margin: 2px 0 8px; padding: 14px 0;
|
||||
text-align: center; font-size: 12.5px; color: var(--text-faint);
|
||||
border: 1px dashed var(--border-strong); border-radius: 9px;
|
||||
background: #fafbfe;
|
||||
}
|
||||
|
||||
/* ---------- 修改密码 ---------- */
|
||||
.pwd-card { margin-top: 16px; border-radius: 14px; border-color: var(--border); }
|
||||
.pwd-card :deep(.el-card__header) {
|
||||
font-size: 13px; font-weight: 600;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 12px 16px;
|
||||
}
|
||||
.pwd-card :deep(.el-card__body) { padding: 16px; }
|
||||
.pwd-card :deep(.el-form-item__label) { color: var(--text-sub); font-weight: 500; }
|
||||
.pwd-card :deep(.el-button--primary) { width: 100%; border-color: transparent; background: #17181a; }
|
||||
.pwd-card :deep(.el-button--primary:hover) { background: #26282c; }
|
||||
.pwd-form { padding-top: 2px; }
|
||||
.pwd-form :deep(.el-form-item__label) { color: var(--text-sub); font-weight: 500; }
|
||||
.pwd-submit { width: 100%; border-color: transparent; }
|
||||
</style>
|
||||
@@ -2,7 +2,6 @@ import { reactive } from 'vue'
|
||||
|
||||
export const store = reactive({
|
||||
appName: '',
|
||||
controlplane: '', // 控制面地址(管理员跳转用),来自 /api/meta
|
||||
platforms: [],
|
||||
plugins: [],
|
||||
selectedId: '',
|
||||
@@ -14,14 +13,14 @@ export const store = reactive({
|
||||
lastResult: null, // {ok, error}
|
||||
lastSummary: '', // 完成时后端返回的摘要
|
||||
wsOn: false,
|
||||
// 控制面管理视图(统一后端数据库 API)
|
||||
isAdmin: false,
|
||||
// 个人身份信息(中心机 accounts,登录/会话校验回填)
|
||||
dept: '',
|
||||
nickname: '', // 真实姓名(中心机 accounts.nickname,钉钉登录时自动带入)
|
||||
avatar: '', // 账号头像文件名(中心机 accounts.avatar,用户上传)
|
||||
avatarUrl: '', // 在线头像(localStorage 缓存,避免每次刷新都请求)
|
||||
current: (() => { try { return localStorage.getItem('cp_account') || '' } catch (_) { return '' } })(),
|
||||
view: 'plugin', // 'plugin' | 'admin'
|
||||
view: 'plugin', // 当前主视图(插件页)
|
||||
authExpired: false, // 授权票据已过期(最长离线 7 天),须联网刷新才能继续使用
|
||||
})
|
||||
|
||||
// ===== 在线头像:优先读缓存,无缓存时请求接口并落盘;图片加载失败时清除缓存重新拉取 =====
|
||||
|
||||
Reference in New Issue
Block a user