修改一些打包的问题

This commit is contained in:
lyc 2024-07-18 15:14:11 +08:00
parent b9c9269452
commit effe6c3272
7 changed files with 25 additions and 10 deletions

15
.env.production Normal file
View File

@ -0,0 +1,15 @@
# 页面标题
VITE_APP_TITLE = AIx数字平台
# 生产环境配置
VITE_APP_ENV = 'production'
# AIx融合数字管理系统/生产环境
VITE_APP_BASE_API = 'http://192.168.2.52:7863'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip
VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktxt/'
VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/'

View File

@ -1,5 +1,5 @@
appId: com.electron.app appId: com.electron.app
productName: electron-app productName: AIx
directories: directories:
buildResources: build buildResources: build
files: files:
@ -11,7 +11,7 @@ files:
asarUnpack: asarUnpack:
- resources/** - resources/**
win: win:
executableName: electron-app executableName: AIx
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true

View File

@ -54,7 +54,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, toRaw, onMounted, nextTick, watch, defineProps, defineEmits } from 'vue' import { ref, reactive, toRaw, onMounted, nextTick, watch } from 'vue'
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {

View File

@ -33,7 +33,7 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted, watch, defineProps, defineEmits } from 'vue' import { ref, onMounted, watch } from 'vue'
import { listEvaluation } from '@/api/subject' import { listEvaluation } from '@/api/subject'
import { updateUserInfo } from '@/api/system/user' import { updateUserInfo } from '@/api/system/user'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'

View File

@ -45,7 +45,7 @@
</template> </template>
<script setup> <script setup>
import { ref, defineProps, defineEmits, watch } from 'vue' import { ref, watch } from 'vue'
import FileImage from '@/components/file-image/index.vue' import FileImage from '@/components/file-image/index.vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { resourceType } from '@/utils/resourceDict' import { resourceType } from '@/utils/resourceDict'

View File

@ -24,7 +24,7 @@
<div class="avatar-container"> <div class="avatar-container">
<el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click"> <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="userStore.user.avatar" class="user-avatar" style="float: left;" /> <img :src="userImg" class="user-avatar" style="float: left;" />
<div style="margin-top: 18px; font-size: 0.8em;"> {{ userStore.user.nickName }}</div> <div style="margin-top: 18px; font-size: 0.8em;"> {{ userStore.user.nickName }}</div>
</div> </div>
<template #dropdown> <template #dropdown>
@ -54,7 +54,7 @@ const { ipcRenderer } = window.electron || {}
const isMaxSize = ref(false) const isMaxSize = ref(false)
const router = useRouter() const router = useRouter()
const currentRoute = ref('') const currentRoute = ref('')
const userImg = new URL(userStore.user.avatar, import.meta.url)
const menus = ref([ const menus = ref([
{ {

View File

@ -3,13 +3,13 @@ import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token' const TokenKey = 'Admin-Token'
export function getToken() { export function getToken() {
return Cookies.get(TokenKey) return localStorage.getItem(TokenKey)
} }
export function setToken(token) { export function setToken(token) {
return Cookies.set(TokenKey, token) return localStorage.setItem(TokenKey, token)
} }
export function removeToken() { export function removeToken() {
return Cookies.remove(TokenKey) return localStorage.removeItem(TokenKey)
} }