{"remainingRequest":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\main-navbar.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\src\\views\\main-navbar.vue","mtime":1760165958034},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\HTC\\program\\善行少年\\security-enterprise-admin\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["\r\nimport { messages } from '@/i18n'\r\nimport screenfull from 'screenfull'\r\nimport UpdatePassword from './main-navbar-update-password'\r\nimport { clearLoginInfo } from '@/utils'\r\nvar socket = null\r\nexport default {\r\n inject: ['refresh'],\r\n data () {\r\n return {\r\n i18nMessages: messages,\r\n updatePasswordVisible: false,\r\n messageTip: false\r\n }\r\n },\r\n components: {\r\n UpdatePassword\r\n },\r\n created () {\r\n var vue = this\r\n socket = new WebSocket(`${window.SITE_CONFIG['socketURL']}`)\r\n socket.onopen = function () {}\r\n socket.onerror = function () {\r\n vue.$notify.error({\r\n title: vue.$t('notice.disconnect'),\r\n message: vue.$t('notice.disconnectMessage')\r\n })\r\n }\r\n socket.onmessage = function (evt) {\r\n const result = JSON.parse(evt.data)\r\n\r\n // 如果是有新文本通知,则提示有新通知\r\n if (result.type === 0) {\r\n vue.messageTip = true\r\n vue.$notify({\r\n title: vue.$t('notice.new'),\r\n message: result.msg,\r\n type: 'info',\r\n duration: 5000\r\n })\r\n }\r\n }\r\n\r\n // 未读通知数\r\n this.getUnReadCount()\r\n },\r\n methods: {\r\n myNoticeRouter () {\r\n this.$router.replace('notice-notice-user')\r\n },\r\n getUnReadCount () {\r\n this.$http.get(`/sys/notice/mynotice/unread`).then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n if (res.data > 0) {\r\n this.messageTip = true\r\n }\r\n }).catch(() => {})\r\n },\r\n // 全屏\r\n fullscreenHandle () {\r\n if (!screenfull.enabled) {\r\n return this.$message({\r\n message: this.$t('fullscreen.prompt'),\r\n type: 'warning',\r\n duration: 500\r\n })\r\n }\r\n screenfull.toggle()\r\n },\r\n // 修改密码\r\n updatePasswordHandle () {\r\n this.updatePasswordVisible = true\r\n this.$nextTick(() => {\r\n this.$refs.updatePassword.init()\r\n })\r\n },\r\n // 退出\r\n logoutHandle () {\r\n this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), {\r\n confirmButtonText: this.$t('confirm'),\r\n cancelButtonText: this.$t('cancel'),\r\n type: 'warning'\r\n }).then(() => {\r\n this.$http.post('/logout').then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n clearLoginInfo()\r\n this.$router.push({ name: 'login' })\r\n }).catch(() => {})\r\n }).catch(() => {})\r\n }\r\n }\r\n}\r\n",{"version":3,"sources":["main-navbar.vue"],"names":[],"mappings":";AA8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"main-navbar.vue","sourceRoot":"src/views","sourcesContent":["\r\n \r\n\r\n\r\n"]}]}