Поправил package и отображение картинок в продакшене

This commit is contained in:
Ilia Miheev
2026-06-06 08:44:45 +03:00
parent f43c22d636
commit 26a207d61e
6 changed files with 27 additions and 10 deletions
+9 -4
View File
@@ -1,10 +1,15 @@
{
"name": "SkyVue",
"name": "skyvue",
"productName": "SkyVue",
"version": "1.0.0",
"description": "My Electron application description",
"description": "Визуальное планирование полёта дрона и генерация Python-кода для Clover/ROS",
"main": ".vite/build/main.js",
"private": true,
"homepage": "https://github.com/IliaMiheev/probody",
"repository": {
"type": "git",
"url": "https://github.com/IliaMiheev/probody.git"
},
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
@@ -12,8 +17,8 @@
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": "Student",
"keywords": ["drone", "clover", "ros", "electron", "flight-planning"],
"author": "Clovers (https://github.com/IliaMiheev/probody)",
"license": "MIT",
"devDependencies": {
"@electron-forge/cli": "^7.11.1",
+3 -2
View File
@@ -1,7 +1,8 @@
<script setup>
import { computed } from 'vue'
import { publicPath } from '@/shared/publicPath'
const APP_LOGO = '/images/drone.png'
const APP_LOGO = 'images/drone.png'
const props = defineProps({
title: {
@@ -24,7 +25,7 @@ const props = defineProps({
defineEmits(['click'])
const imageSrc = computed(() => props.image || APP_LOGO)
const imageSrc = computed(() => publicPath(props.image || APP_LOGO))
</script>
<template>
+8
View File
@@ -0,0 +1,8 @@
export function publicPath(relativePath) {
if (!relativePath) {
return relativePath
}
const path = relativePath.replace(/^\.\//, '').replace(/^\//, '')
return `${import.meta.env.BASE_URL}${path}`
}
+3 -2
View File
@@ -17,6 +17,7 @@ import Back from "@/components/UI/svg/Back.vue";
import { NTooltip } from 'naive-ui'
import { useFlightCode } from '@/composables/useFlightCode'
import { usePlannerState } from '@/composables/usePlannerState'
import { publicPath } from '@/shared/publicPath'
const router = useRouter()
@@ -256,7 +257,7 @@ function deletePointMap(item) {
function createIcon(src) {
return h('img', {
src: src,
src: publicPath(src),
style: {
width: '20px',
height: '20px',
@@ -328,7 +329,7 @@ function onContextMenu(e, item) {
<div class="wraper">
<div class="grid">
<div class="square" v-for="(item, index) in numbers" :data-key="index" :key="index" @click="setNumber(item)"
@contextmenu.prevent="onContextMenu($event, item)" :style="{ backgroundImage: `url(${item.BgImg})` }">
@contextmenu.prevent="onContextMenu($event, item)" :style="{ backgroundImage: `url(${publicPath(item.BgImg)})` }">
{{ numbers[index].variable.join(", ") }}
</div>
</div>
+3 -2
View File
@@ -4,8 +4,9 @@ import { useRoute, useRouter } from 'vue-router'
import { resolveTopic } from '@/composables/useTopicResolver'
import MyDropMenu from "@/components/MyDropMenu.vue";
import CustomButton from '@/components/UI/CustomButton.vue'
import { publicPath } from '@/shared/publicPath'
const APP_LOGO = '/images/drone.png'
const APP_LOGO = 'images/drone.png'
const route = useRoute()
const router = useRouter()
@@ -13,7 +14,7 @@ const topic = ref(null)
const dropMenu = ref(null);
provide('dropMenu', dropMenu);
const topicImage = computed(() => topic.value?.image || APP_LOGO)
const topicImage = computed(() => publicPath(topic.value?.image || APP_LOGO))
async function loadTopic() {
topic.value = await resolveTopic(route.params.source, route.params.id)
+1
View File
@@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config
export default defineConfig({
base: './',
plugins: [vue()],
resolve: {
alias: {