chore: 部分小更改
This commit is contained in:
@@ -6,8 +6,8 @@ import { useRouter } from 'vue-router';
|
||||
import * as shell from '@tauri-apps/plugin-shell';
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
async function contant(){
|
||||
await invoke("open_url",{url:"https://space.bilibili.com/1728953419"})
|
||||
async function contant() {
|
||||
await invoke("open_url", { url: "https://space.bilibili.com/1728953419" })
|
||||
}
|
||||
|
||||
//屏蔽右键菜单
|
||||
@@ -29,11 +29,15 @@ document.oncontextmenu = function (event: any) {
|
||||
}
|
||||
|
||||
/* 启动后端 */
|
||||
message.loading("DeEarthX.Core启动中,此过程中请勿执行任何操作......").then(()=>{
|
||||
shell.Command.create("core").spawn().then(()=>{
|
||||
message.success("DeEarthX.Core 启动成功")
|
||||
message.loading("DeEarthX.Core启动中,此过程中请勿执行任何操作......").then(() => {
|
||||
shell.Command.create("core").spawn().then(() => {
|
||||
fetch("http://localhost:37019/", { method: "GET" }).catch((e) => {
|
||||
router.push('/error')
|
||||
}).then(() => {
|
||||
message.success("DeEarthX.Core 启动成功")
|
||||
})
|
||||
console.log(`DeEarthX V3 Core`)
|
||||
}).catch((e)=>{
|
||||
}).catch((e) => {
|
||||
console.log(e)
|
||||
message.error("DeEarthX.Core 启动失败,请检查37019是否被占用!")
|
||||
})
|
||||
@@ -106,18 +110,21 @@ const theme = ref({
|
||||
|
||||
|
||||
<style>
|
||||
/* 禁止选择文本的样式 */
|
||||
h1,li,p,span {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select:none;
|
||||
}
|
||||
|
||||
/* 禁止拖拽图片 */
|
||||
img {
|
||||
-webkit-user-drag: none;
|
||||
-moz-user-drag: none;
|
||||
-ms-user-drag: none;
|
||||
}
|
||||
/* 禁止选择文本的样式 */
|
||||
h1,
|
||||
li,
|
||||
p,
|
||||
span {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* 禁止拖拽图片 */
|
||||
img {
|
||||
-webkit-user-drag: none;
|
||||
-moz-user-drag: none;
|
||||
-ms-user-drag: none;
|
||||
}
|
||||
</style>
|
||||
24
front/src/component/Error.vue
Normal file
24
front/src/component/Error.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<div class="tw:h-full tw:w-full tw:flex tw:flex-col tw:justify-center tw:items-center">
|
||||
<div class="tw:w-32 tw:h-32 tw:mb-25">
|
||||
<svg class="w-32 h-32 mb-4" viewBox="0 0 120 120">
|
||||
<circle cx="60" cy="60" r="50" fill="#ef4444" />
|
||||
<path d="M40,40 L80,80 M80,40 L40,80" stroke="white" stroke-width="10" stroke-linecap="round" />
|
||||
</svg>
|
||||
<p class="tw:text-2xl tw:font-bold tw:text-center tw:mb-20 tw:text-red-500">Error</p>
|
||||
<p class="tw:text-sm tw:text-center tw:text-gray-500">
|
||||
{{ errorMessage }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const route = useRoute();
|
||||
const errorReason = route.query.e as string;
|
||||
const errorMessage = errorReason ? `错误原因:${errorReason}` : 'DeEarthX.Core 启动失败!';
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped></style>
|
||||
@@ -3,6 +3,7 @@ import { createRouter, createWebHistory } from "vue-router";
|
||||
import Main from "../component/Main.vue";
|
||||
import Setting from "../component/Setting.vue";
|
||||
import About from "../component/About.vue";
|
||||
import Error from "../component/Error.vue";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
@@ -17,6 +18,9 @@ const router = createRouter({
|
||||
},{
|
||||
path: "/about",
|
||||
component: About
|
||||
},{
|
||||
path: "/error",
|
||||
component: Error
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user