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