马宇豪
2023-10-20 3943ca967f32343d35f9d384669fc7db29863d1d
修复问题
已修改9个文件
已删除2个文件
118 ■■■■ 文件已修改
.env 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
postcss.config.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bigScreen/components/screen.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bigScreen/fullScreen/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bigScreen/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/loginPage/component/accountLogin.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/loginPage/loginPage.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env
文件已删除
.env.development
@@ -1,5 +1,6 @@
# 本地环境
ENV = 'development'
#VITE_API_URL = 'http://192.168.0.47:17080'
VITE_API_URL = 'http://192.168.0.47:17080'
#线上正式环境接口地址
VITE_API_URL = 'http://121.239.169.30:17081/api'
.env.production
@@ -2,4 +2,4 @@
ENV = 'production'
# 线上环境打包接口地址
VITE_API_URL = 'http://121.239.169.27:7000'
VITE_API_URL = '/api'
postcss.config.js
文件已删除
src/router/index.ts
@@ -75,7 +75,8 @@
        NProgress.done();
    } else {
        if (!token) {
            next(`/login?redirect=${to.path}&params=${JSON.stringify(to.query ? to.query : to.params)}`);
            // next(`/login?redirect=${to.path}&params=${JSON.stringify(to.query ? to.query : to.params)}`);
            next(`/login`);
            Session.clear();
            NProgress.done();
            // next()
src/views/bigScreen/components/screen.vue
@@ -564,16 +564,34 @@
        const getGasTLSocket = ()=>{
          initWebSocket('/ws/gas/flux/','气体通量',120)
        }
        const getPath=async()=> {
          try {
            var htt = window.location.protocol;// 获取协议
            var host = window.location.host;// 获取地址和端口号
            return htt+"//"+host;
          } catch (error) {
            console.error('Error fetching config:', error);
            return ''; // 返回一个默认值或者空字符串
          }
        }
        const initWebSocket =async (requireUrl: string,type: string,beat: number)=>{
            if (typeof WebSocket === 'undefined') {
              alert('您的浏览器不支持socket');
            } else {
              // 实例化socket
              if(import.meta.env.MODE == 'development'){
              let uid = userInfos.value.uid
              let url = import.meta.env.VITE_API_URL + requireUrl + `${uid}`
              url = url.replace('https', 'ws').replace('http', 'ws')
              state.socket = new WebSocket(url)
              }else{
                const apiUrl = await getPath();
                let uid = userInfos.value.uid
                let url = apiUrl + import.meta.env.VITE_API_URL + requireUrl + `${uid}`
                url = url.replace('https', 'ws').replace('http', 'ws')
                state.socket = new WebSocket(url)
              }
              // 监听socket连接
              state.socket.onopen = () => {
                console.log('socket连接成功')
@@ -1125,7 +1143,6 @@
          letter-spacing: 4px;
          font-size: 16px;
          font-weight: bolder;
          line-height: 38px;
          color: #11feee;
        }
        .long-tit{
src/views/bigScreen/fullScreen/index.vue
@@ -25,7 +25,19 @@
        // 页面加载时
        onMounted(() => {
          const baseSize = 38;
          /* 设置 rem 函数 */
          function setRem() {
            const scale = document.documentElement.clientWidth / 1920; /* 当前页面宽度缩放比例,可根据自己需要修改 */
            document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + "px";/* 设置页面根节点字体大小 */
            console.log('切换尺寸>>',document.documentElement.style.fontSize)
          }
          setRem();/* 初始化 rem */
          window.onresize = () => {
            setRem();/* 改变窗口大小时重新设置 rem */
            console.log('执行切换')
          }
        });
      const clickFullscreen =() => {
src/views/bigScreen/index.vue
@@ -26,7 +26,19 @@
        // 页面加载时
        onMounted(() => {
          const baseSize = 38;
          /* 设置 rem 函数 */
          function setRem() {
            const scale = document.documentElement.clientWidth / 1920; /* 当前页面宽度缩放比例,可根据自己需要修改 */
            document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + "px";/* 设置页面根节点字体大小 */
            console.log('切换尺寸>>',document.documentElement.style.fontSize)
          }
          setRem();/* 初始化 rem */
          window.onresize = () => {
            setRem();/* 改变窗口大小时重新设置 rem */
            console.log('执行切换')
          }
        });
      const clickFullscreen =() => {
src/views/loginPage/component/accountLogin.vue
@@ -139,7 +139,7 @@
        const hasUserCodeOrPassword =()=> {
            if (localStorage.getItem('userCode') && localStorage.getItem('userPassword')) {
                state.ruleForm.name = localStorage.getItem('userCode') as string
                state.ruleForm.password = Base64.decode(localStorage.getItem('userPassword'))//解密
                state.ruleForm.pwd = Base64.decode(localStorage.getItem('userPassword'))//解密
                state.saveCode = true
            }
        }
src/views/loginPage/loginPage.vue
@@ -14,7 +14,9 @@
                </div>
            </div>
        </div>
        <div class="rights">技术支持:苏州国科鸿宇智能科技有限公司<br/><span>GTXH Intelligent Security Management System V1.0.1</span></div>
        <div class="rights">技术支持:苏州国科鸿宇智能科技有限公司<br/>
<!--          <span>GTXH Intelligent Security Management System V1.0.1</span>-->
        </div>
    </div>
</template>
@@ -53,11 +55,13 @@
            function setRem() {
              const scale = document.documentElement.clientWidth / 1920; /* 当前页面宽度缩放比例,可根据自己需要修改 */
              document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + "px";/* 设置页面根节点字体大小 */
              console.log('切换尺寸>>',document.documentElement.style.fontSize)
            }
            setRem();/* 初始化 rem */
            window.onresize = () => {
              setRem();/* 改变窗口大小时重新设置 rem */
              console.log('执行切换')
            }
        });
        return {
vite.config.ts
@@ -60,12 +60,12 @@
                    postCssPxToRem({
                        rootValue: 37.5, // 1rem的大小(控制1rem的大小  点位:px)
                        propList: ["*"], // 需要转换的属性,这里选择全部都进行转换
                        exclude: (e:any) => { // 不包含
                            if (/src(\\|\/)views(\\|\/)bigScreen(\\|\/)components(\\|\/)screen/.test(e)||/src(\\|\/)views(\\|\/)loginPage(\\|\/)loginPage/.test(e)||/src(\\|\/)views(\\|\/)loginPage(\\|\/)component(\\|\/)accountLogin/.test(e)) { // 指定生效页面(正则)
                                return false;
                            }
                            return true;
                        }
                        // exclude: (e:any) => { // 不包含
                        //     if (/src(\\|\/)views(\\|\/)bigScreen(\\|\/)index/.test(e)||/src(\\|\/)views(\\|\/)bigScreen(\\|\/)fullScreen(\\|\/)index/.test(e)||/src(\\|\/)views(\\|\/)bigScreen(\\|\/)components(\\|\/)screen/.test(e)||/src(\\|\/)views(\\|\/)loginPage(\\|\/)loginPage/.test(e)||/src(\\|\/)views(\\|\/)loginPage(\\|\/)component(\\|\/)accountLogin/.test(e)) { // 指定生效页面(正则)
                        //         return false;
                        //     }
                        //     return true;
                        // }
                    }),
                ],
            },