guoshilong
2023-03-18 2073874099d0f28946c11310d17428cd725f7496
添加判断防止报错
4 files modified
78 ■■■■■ changed files
src/api/modules/modules.js 10 ●●●●● patch | view | raw | blame | history
src/views/funcView.vue 12 ●●●● patch | view | raw | blame | history
src/views/socket-demo.vue 9 ●●●●● patch | view | raw | blame | history
yarn.lock 47 ●●●●● patch | view | raw | blame | history
src/api/modules/modules.js
@@ -12,6 +12,16 @@
  })
}
export const getAll = (params) => {
  return request({
    url: '/api/modules/modules/all',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/modules/modules/detail',
src/views/funcView.vue
@@ -87,6 +87,7 @@
import PlusIcon from 'vue-material-design-icons/PlusCircle'
import MinusIcon from 'vue-material-design-icons/MinusCircle'
import io from "socket.io-client";
import {getDetail} from "@/api/modules/modules";
export default {
  name: "funcView",
@@ -159,21 +160,25 @@
        if (data.type == 2) {
          let fileArray = data.fileUrl
          this.flipConfig.pages = []
          if (fileArray.length>0 && fileArray){
          fileArray.forEach(e => {
            this.flipConfig.pages.push(e.value)
          })
          }
        } else if (data.type == 3) {
          if (data.fileUrl&&data.fileUrl.length>0){
          url = data.fileUrl[0].value
          this.path = 'http://192.168.0.200:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
          }
        } else if (data.type == 1) {
          if (data.fileUrl&&data.fileUrl.length>0){
          url = data.fileUrl[0].value
          this.path = 'http://192.168.0.200:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url))
          }
        }
      } else if (data.property == 3) {
      }
    },
    connect(form, done) {
@@ -210,16 +215,19 @@
      });
      this.socketIoClient.on("menuChange", (res) => {
        console.log(res)
        this.handleSelect(res)
      });
      //上一页
      this.socketIoClient.on("previousPage", (res) => {
        console.log(res)
        this.left()
      });
      //下一页
      this.socketIoClient.on("nextPage", (res) => {
        console.log(res)
        this.right()
      });
src/views/socket-demo.vue
@@ -5,6 +5,15 @@
    <button @click="disconnect">断开连接</button>
    <button @click="sendMessage">msg</button>
    <button @click="sendMessage2">msg2</button>
    <embed
        src="public/swf/党建工作.swf"
        wmode="opaque"
        width="1140"
        height="320"
        align="middle"
        type="application/x-shockwave-flash"
    >
  </div>
</template>
yarn.lock
@@ -1128,6 +1128,16 @@
  resolved "https://registry.npmmirror.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df"
  integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==
"@smallwei/avue@^2.10.10":
  version "2.10.10"
  resolved "https://registry.yarnpkg.com/@smallwei/avue/-/avue-2.10.10.tgz#0bd1abfde9da7ce9bd39213ed731f050d6b9f06e"
  integrity sha512-CpYQmN62Q8RSWxTcyPz0ETAeCjepOam9plUA2lHzUKOn4S+BSUyl1EtBH14XI4xFWpHXlP4k/d1rtGFzUQoC6g==
  dependencies:
    countup.js "^1.9.3"
    dayjs "^1.10.4"
    nprogress "^0.2.0"
    vue-cropper "^0.5.8"
"@socket.io/component-emitter@~3.1.0":
  version "3.1.0"
  resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553"
@@ -2523,6 +2533,11 @@
    path-type "^4.0.0"
    yaml "^1.10.0"
countup.js@^1.9.3:
  version "1.9.3"
  resolved "https://registry.yarnpkg.com/countup.js/-/countup.js-1.9.3.tgz#ce3e50cd7160441e478f07da31895edcc0f1c9dd"
  integrity sha512-UHf2P/mFKaESqdPq+UdBJm/1y8lYdlcDd0nTZHNC8cxWoJwZr1Eldm1PpWui446vDl5Pd8PtRYkr3q6K4+Qa5A==
cross-spawn@^5.0.1:
  version "5.1.0"
  resolved "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
@@ -2672,6 +2687,11 @@
  version "3.1.1"
  resolved "https://registry.npmmirror.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9"
  integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==
dayjs@^1.10.4:
  version "1.11.7"
  resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2"
  integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
de-indent@^1.0.2:
  version "1.0.2"
@@ -3378,6 +3398,13 @@
  version "3.2.7"
  resolved "https://registry.npmmirror.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
  integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
flipbook-vue@^1.0.0-beta.4:
  version "1.0.0-beta.4"
  resolved "https://registry.yarnpkg.com/flipbook-vue/-/flipbook-vue-1.0.0-beta.4.tgz#e272fe4af0216f691e028585902c72acf3895c7b"
  integrity sha512-4FycLNWkxEpHUCk08s1g9q1G/r1S/r3GI7LCalwMtr4G7Y7IDgKbA9AF7AjDPFudny+Rqndw74SHKVnksSebCA==
  dependencies:
    rematrix "^0.7.2"
follow-redirects@^1.0.0, follow-redirects@^1.15.0:
  version "1.15.2"
@@ -4466,6 +4493,11 @@
  dependencies:
    path-key "^3.0.0"
nprogress@^0.2.0:
  version "0.2.0"
  resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"
  integrity sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==
nth-check@^2.0.1:
  version "2.1.1"
  resolved "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d"
@@ -5211,6 +5243,11 @@
  version "0.2.7"
  resolved "https://registry.npmmirror.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
  integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==
rematrix@^0.7.2:
  version "0.7.2"
  resolved "https://registry.yarnpkg.com/rematrix/-/rematrix-0.7.2.tgz#09b59118a6b46fc054ff64b6992e4865f5569077"
  integrity sha512-NYLmE17dX15eUPhngLMTKlRYwATxEhcRdn9LKtk/iOXHxDKglCZnD2MrMLKwLlB5FX8u9kF/9yMhlQJpeDcuPw==
renderkid@^3.0.0:
  version "3.0.0"
@@ -6014,6 +6051,11 @@
  resolved "https://registry.yarnpkg.com/vue-axios/-/vue-axios-3.5.2.tgz#28637524cca550a9e97197e85a41930ec63604d5"
  integrity sha512-GP+dct7UlAWkl1qoP3ppw0z6jcSua5/IrMpjB5O8bh089iIiJ+hdxPYH2NPEpajlYgkW5EVMP95ttXWdas1O0g==
vue-cropper@^0.5.8:
  version "0.5.10"
  resolved "https://registry.yarnpkg.com/vue-cropper/-/vue-cropper-0.5.10.tgz#dc0d6fc39a74618df00e2d5c912a327dcc906247"
  integrity sha512-v76nyDwMI4jvNppPlgWWpm8fQ3qVtoGZ758yLfoBRF762nJ68sjQ6z4m5Xc4d6VUbjDORm7NEduYKagxhO1MtQ==
vue-eslint-parser@^8.0.1:
  version "8.3.0"
  resolved "https://registry.npmmirror.com/vue-eslint-parser/-/vue-eslint-parser-8.3.0.tgz#5d31129a1b3dd89c0069ca0a1c88f970c360bd0d"
@@ -6041,6 +6083,11 @@
    hash-sum "^2.0.0"
    loader-utils "^2.0.0"
vue-material-design-icons@^5.2.0:
  version "5.2.0"
  resolved "https://registry.yarnpkg.com/vue-material-design-icons/-/vue-material-design-icons-5.2.0.tgz#4e0cf50a68cb6900e8bd2550acbb44fad99bbd8e"
  integrity sha512-fcdcJHQ9fQw2CAytuLAzWSELcxH138sCdMItVhvmO7Lu9afIgojB/UCWv7XHt/lURsnq/n6O+muM4AQgw8yfig==
vue-router@^3.0.1:
  version "3.6.5"
  resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.6.5.tgz#95847d52b9a7e3f1361cb605c8e6441f202afad8"