修改常量
This commit is contained in:
@@ -16,13 +16,13 @@ VITE_PWA=false
|
||||
|
||||
# 开发环境接口地址
|
||||
VITE_API_URL=/api
|
||||
VITE_COMPANY_WEBSITE=http://www.shining-electric.com/
|
||||
|
||||
# 开发环境跨域代理,支持配置多个
|
||||
|
||||
VITE_PROXY=[["/api","http://127.0.0.1:18092/"]]
|
||||
#VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
|
||||
#VITE_PROXY=[["/api","http://192.168.2.125:18092/"]]
|
||||
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
||||
VITE_IS_SHOW_RAW_DATA=true
|
||||
# 开启激活验证
|
||||
VITE_ACTIVATE_OPEN=false
|
||||
@@ -24,6 +24,7 @@ VITE_PWA=true
|
||||
# 线上环境接口地址
|
||||
#VITE_API_URL="/api" # 打包时用
|
||||
VITE_API_URL="http://127.0.0.1:18092/"
|
||||
VITE_COMPANY_WEBSITE=http://www.shining-electric.com/
|
||||
VITE_IS_SHOW_RAW_DATA=true
|
||||
# 开启激活验证
|
||||
VITE_ACTIVATE_OPEN=false
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<p style="margin: 0">
|
||||
<a href="http://www.shining-electric.com/" target="_blank">2024 © 南京灿能电力自动化股份有限公司</a>
|
||||
<a :href="companyWebsite" target="_blank" rel="noopener noreferrer">2024 © 南京灿能电力自动化股份有限公司</a>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import { useAuthStore } from '@/stores/modules/auth'
|
||||
@@ -42,6 +43,8 @@ const title = computed(() => {
|
||||
})
|
||||
const activateInfo = authStore.activateInfo
|
||||
const isActivateOpen = import.meta.env.VITE_ACTIVATE_OPEN
|
||||
const companyWebsite = import.meta.env.VITE_COMPANY_WEBSITE
|
||||
|
||||
const modeList = [
|
||||
{
|
||||
name: '模拟式模块',
|
||||
@@ -62,13 +65,14 @@ const modeList = [
|
||||
activated: isActivateOpen === 'true' ? activateInfo.contrast.permanently === 1 : true
|
||||
}
|
||||
]
|
||||
|
||||
const handelOpen = async (item: string, key: string) => {
|
||||
if (isActivateOpen === 'true' && activateInfo[key].permanently !== 1) {
|
||||
ElMessage.warning(`${item}模块未激活`)
|
||||
return
|
||||
}
|
||||
await authStore.setShowMenu()
|
||||
modeStore.setCurrentMode(item) // 将模式code存入 store
|
||||
modeStore.setCurrentMode(item) // 将模式 code 存入 store
|
||||
// 强制刷新页面
|
||||
await tabsStore.closeMultipleTab()
|
||||
await initDynamicRouter()
|
||||
@@ -80,11 +84,12 @@ const handelOpen = async (item: string, key: string) => {
|
||||
// 如果已在目标页面,手动触发组件更新
|
||||
window.location.reload() // 或者采用其他方式刷新数据
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use './index.scss';
|
||||
|
||||
.footer {
|
||||
position: relative;
|
||||
background-color: var(--el-color-primary);
|
||||
@@ -101,30 +106,37 @@ const handelOpen = async (item: string, key: string) => {
|
||||
height: 100%;
|
||||
width: auto;
|
||||
font-size: 14px;
|
||||
|
||||
.change_mode_down {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.change_mode_up {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.change_mode:hover {
|
||||
.change_mode_down {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.change_mode_up {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.el-dropdown {
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
p {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: right;
|
||||
line-height: 40px;
|
||||
|
||||
a {
|
||||
color: #fff;
|
||||
margin-right: 25px; // 增加右边距
|
||||
|
||||
3
frontend/src/types/env.d.ts
vendored
3
frontend/src/types/env.d.ts
vendored
@@ -27,7 +27,10 @@ declare interface ViteEnv {
|
||||
VITE_PWA: boolean;
|
||||
VITE_PUBLIC_PATH: string;
|
||||
VITE_API_URL: string;
|
||||
VITE_COMPANY_WEBSITE: string;
|
||||
VITE_PROXY: [string, string][];
|
||||
VITE_IS_SHOW_RAW_DATA:boolean;
|
||||
VITE_ACTIVATE_OPEN:boolean;
|
||||
}
|
||||
|
||||
interface ImportMetaEnv extends ViteEnv {
|
||||
|
||||
@@ -192,8 +192,7 @@ export default class SocketService {
|
||||
* WebSocket连接配置
|
||||
*/
|
||||
private config: SocketConfig = {
|
||||
// url: 'ws://127.0.0.1:7778/hello',
|
||||
url: 'ws://127.0.0.1:7778/hello',
|
||||
url: `ws://127.0.0.1:7778/hello`,
|
||||
heartbeatInterval: 9000, // 9秒心跳间隔
|
||||
reconnectDelay: 5000, // 5秒重连延迟
|
||||
maxReconnectAttempts: 5, // 最多重连5次
|
||||
|
||||
Reference in New Issue
Block a user