Merge pull request '结束上课' (#298) from lyc-dev into main

This commit is contained in:
lyc 2024-10-09 09:38:43 +08:00
commit 8a17273605
1 changed files with 2 additions and 3 deletions

View File

@ -80,9 +80,7 @@ import { updateUserInfo } from '@/api/system/user'
import logoIco from '@/assets/images/logo.png' import logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index' import { listEvaluation } from '@/api/classManage/index'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import { useToolState } from '@/store/modules/tool'
const toolState = useToolState();
let homeTitle = ref(import.meta.env.VITE_APP_TITLE) let homeTitle = ref(import.meta.env.VITE_APP_TITLE)
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const userStore = useUserStore() const userStore = useUserStore()
@ -153,7 +151,8 @@ function handleCommand(command) {
function logout() { function logout() {
const hasClass = sessionStore.has('activeClass.id') const hasClass = sessionStore.has('activeClass.id')
if (hasClass || toolState.isToolWin) return ElMessage.warning('当前正在上课,请先结束上课') const hasTool = sessionStore.get('isToolWin')
if (hasClass || hasTool) return ElMessage.warning('当前正在上课,请先结束上课')
ElMessageBox.confirm('确认退出系统吗?', '提示', { ElMessageBox.confirm('确认退出系统吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',