chore: 版本升级至1.1.8,新增钉钉账号通知等功能
1. 版本号更新:shell.version与install.iss同步升级到1.1.8 2. 新增钉钉账号创建通知:新用户收账号密码,管理员收权限提醒 3. 优化钉钉扫码登录逻辑:自动补全账号信息并同步昵称 4. 修复首次改密校验逻辑,统一初始密码验证规则 5. 新增AGENTS文档写入操作沙箱规避规范 6. 优化雇主险调度脚本,新增四级部门自动填充逻辑 7. 重构前端更新弹窗,将下载进度从顶部条改为独立弹窗 8. 新增EHR考勤异常检查脚本,优化打卡判定逻辑
This commit is contained in:
@@ -6,16 +6,9 @@
|
||||
</div>
|
||||
<LoginPage v-else-if="!store.current" :app-name="store.appName" @ok="onLogin" />
|
||||
<div class="__app" v-else>
|
||||
<!-- 壳子更新提示:下载进度 / 已就绪重启更新 / 发现新版本可下载 -->
|
||||
<!-- 壳子更新提示:已就绪重启更新 / 下载失败重试 / 发现新版本可下载(下载进度改用弹窗) -->
|
||||
<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">
|
||||
<template v-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>
|
||||
@@ -164,6 +157,29 @@
|
||||
</div>
|
||||
</div>
|
||||
<ProfilePanel v-if="profileOpen" @close="profileOpen = false" />
|
||||
<!-- 壳子更新下载进度弹窗:点击「立即下载」后弹出,可最小化到后台继续下载 -->
|
||||
<el-dialog v-model="updDlg" :title="`下载更新 v${updDl.version || ''}`" width="420px"
|
||||
:close-on-click-modal="false" align-center class="upd-dl-dialog">
|
||||
<template v-if="updDl.status === 'downloading'">
|
||||
<div class="dl-dlg-body">
|
||||
<el-progress :percentage="updDl.pct || 0" :stroke-width="10" />
|
||||
<span class="dl-dlg-bytes">{{ fmtBytes(updDl.received) }}{{ updDl.total ? ' / ' + fmtBytes(updDl.total) : '' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="updDl.status === 'failed'">
|
||||
<div class="dl-dlg-body">
|
||||
<span class="dl-dlg-err">下载失败:{{ updDl.error || '未知错误' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="dl-dlg-body"><span>已下载完成</span></div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button v-if="updDl.status === 'failed'" size="small" type="primary" round
|
||||
:loading="downloading" @click="onShellDownload">重试</el-button>
|
||||
<el-button size="small" round @click="updDlg = false">后台下载</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -328,10 +344,10 @@ let shellPollTimer = null // 状态轮询(setTimeout 递归,下
|
||||
let lastDlStatus = '' // 上一轮下载状态,用于下载完成/失败时的一次性提示
|
||||
|
||||
const updDl = computed(() => shellUpdate.value.dl || {})
|
||||
const updDlg = ref(false) // 下载进度弹窗(点击「立即下载」后弹出)
|
||||
const updBarVisible = computed(() =>
|
||||
shellUpdate.value.downloaded ||
|
||||
updDl.value.status === 'downloading' ||
|
||||
updDl.value.status === 'failed' ||
|
||||
(updDl.value.status === 'failed' && !updDlg.value) ||
|
||||
(shellUpdate.value.available && !shellDismissed.value)
|
||||
)
|
||||
|
||||
@@ -355,6 +371,7 @@ async function refreshShellStatus() {
|
||||
shellUpdate.value = s
|
||||
const st = s.dl?.status || ''
|
||||
if (lastDlStatus === 'downloading' && st === 'downloaded') {
|
||||
updDlg.value = false // 弹窗开着时自动收起,顶部提示条转为「重启更新」
|
||||
ElMessage.success(`新版本 v${s.new} 已下载完成,点击顶部「重启更新」完成升级`)
|
||||
log('INFO', `壳子新版本 v${s.new} 已就绪,可重启更新`)
|
||||
} else if (lastDlStatus === 'downloading' && st === 'failed') {
|
||||
@@ -383,6 +400,7 @@ async function onShellDownload() {
|
||||
if (downloading.value) return
|
||||
downloading.value = true
|
||||
shellDismissed.value = false
|
||||
updDlg.value = true // 点击下载即弹出进度弹窗,不再用页头条展示进度
|
||||
// 点击即进入"下载中"反馈(不等轮询):内网直连下载很快,若靠 15s 轮询拉状态,
|
||||
// 进度条可能还没显示就已经下载完,用户会以为点了没反应
|
||||
const v = shellUpdate.value.latest || ''
|
||||
@@ -542,13 +560,23 @@ async function onLogin(ok) {
|
||||
|
||||
async function promptChangePwd(account) {
|
||||
try {
|
||||
// 旧密码 = 钉钉通知下发的初始密码,必须输入校验(与个人中心改密一致)
|
||||
let op = ''
|
||||
try {
|
||||
const { value } = await ElMessageBox.prompt(
|
||||
'当前账号正使用默认密码,请输入钉钉通知中的初始密码',
|
||||
'首次登录 · 身份验证',
|
||||
{ inputType: 'password', inputPlaceholder: '请输入初始密码',
|
||||
confirmButtonText: '下一步', cancelButtonText: '稍后再说' })
|
||||
op = value
|
||||
} catch (_) { return /* 用户取消 */ }
|
||||
const { value: np } = await ElMessageBox.prompt(
|
||||
'当前账号正使用默认密码,请立即设置新密码(至少 6 位),避免他人误登录',
|
||||
'首次登录 · 修改密码',
|
||||
'请设置新密码(至少 6 位),避免他人误登录',
|
||||
'首次登录 · 设置新密码',
|
||||
{ inputType: 'password', inputPattern: /^.{6,}$/, inputErrorMessage: '密码至少 6 位',
|
||||
confirmButtonText: '设置新密码', cancelButtonText: '稍后再说' })
|
||||
try {
|
||||
await adminPassword({ account, old_password: '', new_password: np })
|
||||
await adminPassword({ account, old_password: op, new_password: np })
|
||||
ElMessage.success('密码已更新')
|
||||
} catch (e) {
|
||||
ElMessage.warning('改密失败:' + (e.message || e))
|
||||
@@ -630,10 +658,12 @@ 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; }
|
||||
|
||||
/* 壳子更新下载进度弹窗 */
|
||||
.dl-dlg-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
|
||||
.dl-dlg-bytes { font-size: 12px; color: var(--text-faint); text-align: right; }
|
||||
.dl-dlg-err { color: var(--danger, #e5484d); font-size: 13px; line-height: 1.6; }
|
||||
.brand { display: flex; align-items: center; gap: 11px; }
|
||||
.logo {
|
||||
width: 36px; height: 36px; border-radius: 10px;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
; 升级不覆盖机器已有 .env;不含 37du-host-console.exe(调试版)、plugins/(登录后自下载)
|
||||
|
||||
#define MyAppName "37du 自动化工作台"
|
||||
#define MyAppVersion "1.1.7"
|
||||
#define MyAppVersion "1.1.8"
|
||||
#define MyAppExeName "37du-host.exe"
|
||||
|
||||
[Setup]
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.7
|
||||
1.1.8
|
||||
Reference in New Issue
Block a user