This commit is contained in:
zyl
2025-11-06 16:03:29 +08:00
9 changed files with 494 additions and 8 deletions

View File

@ -0,0 +1,60 @@
// electron.vite.config.ts
import { resolve } from "path";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import path from "path";
var electron_vite_config_default = defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
renderer: {
resolve: {
alias: {
"@renderer": resolve("src/renderer/src"),
"@": resolve("src/renderer/src")
}
},
plugins: [
vue(),
AutoImport({
imports: ["vue"],
dts: "src/auto-imports.d.ts",
// 自动生成类型声明文件
resolvers: [ElementPlusResolver()]
}),
Components({
resolvers: [ElementPlusResolver()]
}),
// SVG图标插件配置
// 配置SVG图标插件
createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
symbolId: "icon-[name]",
// 自动清除 SVG 中的 fill 和 stroke 属性
svgoOptions: {
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
}
})
]
/*server: {
port: 8848,
proxy: {
'/api': {
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}*/
}
});
export {
electron_vite_config_default as default
};

View File

@ -1 +1 @@
41b/ujShRZRf9Aa433FD3uyIZuxWSSqXWXlc2dyQfJ75ED0HNbadcdsPF5CaMuJ624E+iLBfS14muki3Kp1qv3N0KPVdc0TjJDyrO+AVfwE2pkhuoGoZ8sNGSUSrom2NhRIwJNl4SNhqGkxKvDJhRhWfxw6LHS3T/4NDVmw/KlXwLryTr1ScTPGegLiv1C+r0BN58Qcbdy/IN4J0/xuadZTA9+UoajQ1PHwDUdI7SfpTyz/mXYghVpbQcW8OYTHqLypkZtybW+yeNEhnp/jeYw== 41b/ujShRZRf9Aa433FD3uyIZuxWSSqXWXlc2dyQfJ75ED0HNbadcdsPF5CaMuJ624E+iLBfS14muki3Kp1qv3N0KPVdc0TjJDyrO+AVfwFghRHbXEWYEGb3GpmVU0MwclqNNggKfnTvj0gDIpFBNl/nxMZKwYXbYk8nqd3yUDfwLryTr1ScTPGegLiv1C+r1SDxtenx4d2fxqS6FkGbV5TA9+UoajQ1PHwDUdI7SfpxjvK4tQscOcu0R0wLgUa3LypkZtybW+yeNEhnp/jeYw==

View File

@ -36,6 +36,7 @@
--color-base1: 0, 255, 255; --color-base1: 0, 255, 255;
--color-base2: 0, 255, 255; --color-base2: 0, 255, 255;
--color-border1: rgb(0, 200, 255); --color-border1: rgb(0, 200, 255);
--color-border2: rgb(204, 204,204);
--color-text2: 173, 241, 255; --color-text2: 173, 241, 255;
--color-text-shadow: rgba(20, 118, 255, 1); --color-text-shadow: rgba(20, 118, 255, 1);
--color-box-shadow: rgba(37, 196, 196, 1); --color-box-shadow: rgba(37, 196, 196, 1);

Binary file not shown.

View File

@ -9,9 +9,9 @@
:on-error="handleError" :on-error="handleError"
class="simple-upload" class="simple-upload"
> >
<el-button color="#005c5c" :loading="isUploading"> <el-button class="clickBut" color="#005c5c" :loading="isUploading">
<UploadFilled class="mr-2" /> <UploadFilled class="mr-2" />
{{ t("auths.upload") }} {{ t('auths.upload') }}
</el-button> </el-button>
</el-upload> </el-upload>
</template> </template>
@ -87,4 +87,7 @@ const handleError = (error: Error) => {
.simple-upload { .simple-upload {
display: inline-block; display: inline-block;
} }
::v-deep .clickBut:hover {
color: rgba(0, 255, 255, 1) !important;
}
</style> </style>

View File

@ -2,8 +2,18 @@ import {createRouter, createWebHashHistory} from 'vue-router'
import homeIndex from '@/views/home/index.vue' import homeIndex from '@/views/home/index.vue'
const routes = [ const routes = [
// {
// path: '/',
// component: () => import('@/views/login/index.vue'),
// hidden: true
// },
{ {
path: '/', path: '/',
component: () => import('@/views/author/index.vue'),
hidden: true
},
{
path: '/login',
component: () => import('@/views/login/index.vue'), component: () => import('@/views/login/index.vue'),
hidden: true hidden: true
}, },

View File

@ -0,0 +1,407 @@
<template>
<video
key="second-video"
autoplay
loop
muted
src="../../assets/video/author_video.mp4"
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"
></video>
<Dialog ref="baseDialog" class="graffiti" title="系统授权" :closeCallback="closeCallBack">
<template #content>
<div class="auth_info custom_scroll_bar content_h">
<div class="auth_info_box">
<div>
<span class="fankuai"></span>
{{ t('auths.authCode') }}
</div>
<div
class="auth_info_text"
@click="copy(authInfo.license_code)"
style="cursor: pointer"
title="点击可复制"
>
{{ authInfo.license_code || '' }}
<svg-icon name="copy" :size="20" style="margin-left: 30px"></svg-icon>
</div>
</div>
<div class="auth_info_box">
<div>
<span class="fankuai"></span>
{{ t('auths.authTime') }}
</div>
<div class="auth_info_text" v-if="authInfo.status != null">
<template v-if="authInfo.generateTime != ''">
{{ authInfo.generateTime || '2023-01-01' }}-
</template>
{{ authInfo.expireTime || '2023-01-01' }}
</div>
<div v-else class="auth_info_text">暂无</div>
</div>
<div class="auth_info_box">
<div>
<span class="fankuai"></span>
{{ t('auths.authType') }}
</div>
<div
v-if="authInfo.status != null"
class="auth_info_text"
style="font-size: 16px"
:style="{ color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)' }"
>
{{ authInfo.status ? t('auths.authTempExpire') : t('auths.authexpire') }}
</div>
<!-- <div v-else class="auth_info_text">{{ authInfo.message || '无' }}</div> -->
<div v-else class="auth_info_text" style="font-size: 16px; color: rgba(241, 108, 85, 1)">
{{ t('auths.noAuthexpire') }}
</div>
</div>
<!-- <uploadFiles accept=".lic" :maxSize="1"></uploadFiles> -->
</div>
</template>
<template #footer>
<uploadFiles accept=".lic" :maxSize="1"></uploadFiles>
<button @click="close">退出系统</button>
</template>
</Dialog>
</template>
<script setup>
import Dialog from '@/components/dialog/baseDialog.vue'
import { useRouter } from 'vue-router'
import { ref, reactive, toRefs, onBeforeMount, onMounted, watchEffect, computed } from 'vue'
import { AuthApi } from '@/api/setting/auth'
import { useI18n } from 'vue-i18n'
import uploadFiles from '@/components/upload/uploadFiles.vue'
import useClipboard from 'vue-clipboard3'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
$sendElectronChanel,
$recvElectronChanel,
$changeComponentShow
} from '@/utils/communication'
const { ipcRenderer } = require('electron')
const router = useRouter()
const getAuthInfo = async () => {
try {
const res = await AuthApi.showAuth()
if (typeof res.data === 'object') {
getStatus(res.data.expireTime)
}
} catch (error) {
// 统一处理错误
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用?', '提示', {
confirmButtonText: '去授权',
cancelButtonText: '退出系统',
type: 'warning',
closeOnClickModal: false
})
.then(async () => {
try {
baseDialog.value?.open()
} catch (error) {
console.error('打开授权对话框失败:', error)
}
})
.catch(() => {
// 用户点击取消,不执行任何操作
ipcRenderer.send('quit-app')
})
}
}
let showPop = ref(false)
const baseDialog = ref(null)
const getStatus = (date) => {
const timestamp = new Date(date).getTime()
const currentTimestamp = Date.now()
if (timestamp > currentTimestamp) {
router.push({ path: '/login' })
} else {
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用?', '提示', {
confirmButtonText: '去授权',
cancelButtonText: '退出系统',
type: 'warning',
closeOnClickModal: false
})
.then(async () => {
try {
baseDialog.value?.open()
} catch (error) {
console.error('打开授权对话框失败:', error)
}
})
.catch(() => {
// 用户点击取消,不执行任何操作
ipcRenderer.send('quit-app')
})
}
}
getAuthInfo()
//授权页面
const closeCallBack = (e) => {
baseDialog.value?.close()
}
const close = (e) => {
ElMessageBox.confirm('确定要退出系统吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
ipcRenderer.send('quit-app')
})
.catch(() => {
// 用户点击取消,不执行任何操作
})
}
const eventBus = inject('bus')
const { t } = useI18n()
const authInfo = ref({
license_code: '',
//授权信息
generateTime: '', //开始时间
expireTime: '', //结束时间
authDays: null, //授权时间
status: null
})
//上传授权文件成功
eventBus.on('upload', (data) => {
if (data) {
getAuthInfo2()
setTimeout(() => {
ElMessage({
message: '载入成功将在2s后自动重启',
type: 'success'
})
}, 1000)
setTimeout(() => {
$sendElectronChanel('restart')
}, 3000)
}
})
const { toClipboard } = useClipboard()
const getAuthInfo2 = async () => {
const res = await AuthApi.showAuth()
if (typeof res.data === 'object') {
authInfo.value.generateTime = res.data.generateTime
authInfo.value.expireTime = res.data.expireTime
getStatus2()
}
}
const getStatus2 = () => {
const timestamp = new Date(authInfo.value.expireTime).getTime()
const currentTimestamp = Date.now()
if (timestamp > currentTimestamp) {
authInfo.value.status = true
} else {
authInfo.value.status = false
}
window.checkAuthIsValid = authInfo.value.status
}
const getAuthCode = async () => {
const res = await AuthApi.authInfo()
authInfo.value.license_code = res.data
}
getAuthInfo2()
getAuthCode()
//复制
const copy = async (text) => {
try {
await toClipboard(text)
ElMessage.success('复制成功')
} catch (e) {
ElMessage.error('复制失败')
}
}
</script>
<style scoped lang="scss">
:root {
--color-sdk-text-shadow: rgba(20, 118, 255, 1);
}
.auth_info {
width: 100%;
display: flex;
flex-direction: column;
height: 100%;
overflow-y: auto;
color: rgba(var(--color-text2), 0.8);
.auth_info_text {
color: #fff;
font-size: 14px;
font-weight: 700;
margin: 7px 0 15px 15px;
display: flex;
align-items: center;
}
.auth_info_box {
margin-bottom: 15px;
border-bottom: 1px solid rgba(204, 204, 204, 0.2);
}
.el-button--primary {
color: #fff !important;
font-size: 16px;
background: rgba(var(--color-base1), 0.2) !important;
font-weight: bolder;
border-color: transparent;
border-radius: 4px;
}
}
.fankuai {
width: 10px;
height: 10px;
// 旋转角度
transform: rotate(45deg);
border: 2px solid rgba(var(--color-base1), 1);
display: inline-block;
margin-right: 5px;
margin-left: 5px;
}
.YJ-custom-base-dialog {
position: absolute;
color: #ffffff;
font-size: 14px;
z-index: 99;
background: linear-gradient(0deg, #00ffff33 0%, #00ffff00 100%), rgba(0, 0, 0, 0.6);
border: 1.5px solid;
border-image: linear-gradient(to bottom, rgba(var(--color-base1), 1) 6.25%, rgb(0, 200, 255) 100%)
1;
text-align: left;
font-family: 'sy-boldface';
}
.YJ-custom-base-dialog * {
box-sizing: border-box;
}
.YJ-custom-base-dialog:after {
display: block;
position: absolute;
content: '';
left: -1.5px;
top: -6px;
width: 70.5px;
height: 6px;
opacity: 1;
background: rgba(var(--color-base1), 1);
clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 6px, 0 6px);
}
.YJ-custom-base-dialog svg {
fill: #ffffff;
width: 12px;
height: 12px;
margin-right: 5px;
}
.YJ-custom-base-dialog .custom-divider {
width: 100%;
display: block;
border-top: 1px solid rgba(204, 204, 204, 0.2);
}
.YJ-custom-base-dialog .text-number {
font-family: 'D-Din-Bold';
margin-left: 5px;
}
::v-deep .title-box {
line-height: 46px;
padding: 5px 16px 5px 16px !important;
position: relative;
}
::v-deep .title-box > .close-box {
display: none;
}
::v-deep .title-box > .title {
font-family: 'Ali-mother-counts-bold';
font-size: 18px;
font-weight: 400;
letter-spacing: 0px;
line-height: 0px;
color: rgba(255, 255, 255, 1);
text-align: left;
text-shadow: 0px 0px 9px rgba(20, 118, 255, 1);
-webkit-pointer-events: none;
-moz-pointer-events: none;
-ms-pointer-events: none;
-o-pointer-events: none;
pointer-events: none;
}
::v-deep .foot {
position: relative;
padding: 20px 24px;
display: flex;
justify-content: center;
}
::v-deep .foot > button {
margin-left: 10px;
border-radius: 4px;
background: rgba(var(--color-base1), 0.2);
border: 1px solid rgba(var(--color-base1), 0.5);
font-size: 14px;
font-weight: 400;
color: rgba(255, 255, 255, 1);
padding: 5px 20px;
cursor: pointer;
}
::v-deep .foot > button:hover {
border: 1px solid rgba(var(--color-base1), 1);
color: rgba(var(--color-base1), 1);
}
::v-deep .foot > .show > .label {
margin: 0px 10px;
}
::v-deep .el-message-box {
--el-messagebox-title-color: #fff !important;
--el-messagebox-content-color: #fff !important;
background:
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
rgba(0, 0, 0, 0.6) !important;
}
</style>
<style lang="scss">
.el-message-box {
--el-messagebox-title-color: #fff !important;
--el-messagebox-content-color: #fff !important;
background:
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
rgba(0, 0, 0, 0.6) !important;
.el-message-box__btns {
.el-button {
--el-button-text-color: #fff;
--el-button-bg-color: rgba(var(--color-base1), 0.2) !important;
--el-button-hover-bg-color: rgba(var(--color-base1), 0.2) !important;
--el-button-border-color: rgba(var(--color-base1), 0.5) !important;
--el-button-hover-border-color: rgba(var(--color-base1), 1) !important;
--el-button-hover-text-color: rgba(var(--color-base1), 1) !important;
}
.el-button--primary {
--el-button-bg-color: rgba(var(--color-base1), 0.2) !important;
--el-button-hover-bg-color: rgba(var(--color-base1), 0.2) !important;
}
.el-button:focus-visible {
outline: none !important;
}
}
}
</style>

View File

@ -208,6 +208,7 @@
size="small" size="small"
:placeholder="t('btn.selectPlaceholder')" :placeholder="t('btn.selectPlaceholder')"
:no-data-text="t('btn.selectNoText')" :no-data-text="t('btn.selectNoText')"
popper-class="custom-dropdown"
> >
<el-option <el-option
v-for="(item, index) in poiOptions" v-for="(item, index) in poiOptions"
@ -782,5 +783,9 @@ defineExpose({
.el-select-dropdown__wrap { .el-select-dropdown__wrap {
max-height: 260px !important; max-height: 260px !important;
width: 380px !important;
}
.custom-dropdown {
margin-top: 75px;
} }
</style> </style>