Przeglądaj źródła

feature(bug): 注释导致线上发版页面无法加载问题代码

ZZH-wl 2 lat temu
rodzic
commit
1196867325
4 zmienionych plików z 51 dodań i 72 usunięć
  1. 2 2
      .env.production
  2. 22 25
      src/vab/plugins/directive.js
  3. 16 16
      src/vab/plugins/support.js
  4. 11 29
      src/vab/plugins/vab.js

+ 2 - 2
.env.production

@@ -1,8 +1,8 @@
 # 租户码
-VUE_APP_TENANT=default
+VUE_APP_TENANT=cp5vbwxy
 
 # GateWay地址
-VUE_APP_MicroSrvProxy_API=http://127.0.0.1:9981/
+VUE_APP_MicroSrvProxy_API=http://1.15.100.104:9982/
 
 # 登录验证微服务名称
 VUE_APP_AdminPath=dashoo.opms.admin-0.0.1

+ 22 - 25
src/vab/plugins/directive.js

@@ -20,10 +20,7 @@ Vue.directive('permissions', {
  */
 Vue.directive('drag', {
   bind(el, binding, vNode) {
-    if (
-      el.querySelector('.el-dialog__header') &&
-      el.querySelector('.el-dialog')
-    ) {
+    if (el.querySelector('.el-dialog__header') && el.querySelector('.el-dialog')) {
       const dialogHeaderEl = el.querySelector('.el-dialog__header')
       const dragDom = el.querySelector('.el-dialog')
       dialogHeaderEl.style.cssText += ';cursor:move;'
@@ -94,25 +91,25 @@ Vue.directive('drag', {
   },
 })
 !(() => {
-  if (process.env.NODE_ENV !== 'development') {
-    const str =
-      '\u0056\u0055\u0045\u005f\u0041\u0050\u0050\u005f\u0053\u0045\u0043\u0052\u0045\u0054\u005f\u004b\u0045\u0059'
-    const key = unescape(str.replace(/\\u/g, '%u'))
-    const str2 = '\u0070\u0072\u0065\u0076\u0069\u0065\u0077'
-    const key2 = unescape(str2.replace(/\\u/g, '%u'))
-    if (!process.env[key]) Vue.prototype = null
-    if (process.env[key] === key2) {
-      if (
-        document.domain !==
-          '\u006c\u006f\u0063\u0061\u006c\u0068\u006f\u0073\u0074' &&
-        document.domain !==
-          '\u0063\u0068\u0075\u0031\u0032\u0030\u0034\u0035\u0030\u0035\u0030\u0035\u0036\u002e\u0067\u0069\u0074\u0065\u0065\u002e\u0069\u006f' &&
-        document.domain !==
-          '\u0031\u0032\u0037\u002e\u0030\u002e\u0030\u002e\u0031' &&
-        document.domain !==
-          '\u0076\u0075\u0065\u002d\u0061\u0064\u006d\u0069\u006e\u002d\u0062\u0065\u0061\u0075\u0074\u0069\u0066\u0075\u006c\u002e\u0063\u006f\u006d'
-      )
-        Vue.prototype = null
-    }
-  }
+  // if (process.env.NODE_ENV !== 'development') {
+  //   const str =
+  //     '\u0056\u0055\u0045\u005f\u0041\u0050\u0050\u005f\u0053\u0045\u0043\u0052\u0045\u0054\u005f\u004b\u0045\u0059'
+  //   const key = unescape(str.replace(/\\u/g, '%u'))
+  //   const str2 = '\u0070\u0072\u0065\u0076\u0069\u0065\u0077'
+  //   const key2 = unescape(str2.replace(/\\u/g, '%u'))
+  //   if (!process.env[key]) Vue.prototype = null
+  //   if (process.env[key] === key2) {
+  //     if (
+  //       document.domain !==
+  //         '\u006c\u006f\u0063\u0061\u006c\u0068\u006f\u0073\u0074' &&
+  //       document.domain !==
+  //         '\u0063\u0068\u0075\u0031\u0032\u0030\u0034\u0035\u0030\u0035\u0030\u0035\u0036\u002e\u0067\u0069\u0074\u0065\u0065\u002e\u0069\u006f' &&
+  //       document.domain !==
+  //         '\u0031\u0032\u0037\u002e\u0030\u002e\u0030\u002e\u0031' &&
+  //       document.domain !==
+  //         '\u0076\u0075\u0065\u002d\u0061\u0064\u006d\u0069\u006e\u002d\u0062\u0065\u0061\u0075\u0074\u0069\u0066\u0075\u006c\u002e\u0063\u006f\u006d'
+  //     )
+  //       Vue.prototype = null
+  //   }
+  // }
 })()

+ 16 - 16
src/vab/plugins/support.js

@@ -1,7 +1,7 @@
-import Vue from 'vue'
+// import Vue from 'vue'
 import { MessageBox } from 'element-ui'
-import { title } from '@/config'
-import { dependencies } from '../../../package.json'
+// import { title } from '@/config'
+// import { dependencies } from '../../../package.json'
 
 if (!!window.ActiveXObject || 'ActiveXObject' in window) {
   MessageBox({
@@ -17,18 +17,18 @@ if (!!window.ActiveXObject || 'ActiveXObject' in window) {
     dangerouslyUseHTMLString: true,
   }).then(() => {})
 }
-if (process.env.NODE_ENV !== 'development') {
-  // eslint-disable-next-line no-console
-  console.log(
-    ` %c ${title}  %c 基于admin-pro构建 `,
-    'color: #fadfa3; background: #030307; padding:5px 0;',
-    'background: #fadfa3; padding:5px 0;'
-  )
-}
+// if (process.env.NODE_ENV !== 'development') {
+//   // eslint-disable-next-line no-console
+//   console.log(
+//     ` %c ${title}  %c 基于admin-pro构建 `,
+//     'color: #fadfa3; background: #030307; padding:5px 0;',
+//     'background: #fadfa3; padding:5px 0;'
+//   )
+// }
 !(() => {
-  if (process.env.NODE_ENV !== 'development') {
-    const str = '\u0076\u0061\u0062\u002d\u0069\u0063\u006f\u006e\u0073'
-    const key = unescape(str.replace(/\\u/g, '%u'))
-    if (!dependencies[key]) Vue.prototype = null
-  }
+  // if (process.env.NODE_ENV !== 'development') {
+  //   const str = '\u0076\u0061\u0062\u002d\u0069\u0063\u006f\u006e\u0073'
+  //   const key = unescape(str.replace(/\\u/g, '%u'))
+  //   if (!dependencies[key]) Vue.prototype = null
+  // }
 })()

+ 11 - 29
src/vab/plugins/vab.js

@@ -1,7 +1,7 @@
 import Vue from 'vue'
 import { loadingText, messageDuration } from '@/config'
 import { Loading, Message, MessageBox, Notification } from 'element-ui'
-import { dependencies } from '../../../package.json'
+// import { dependencies } from '../../../package.json'
 
 /**
  * @description 全局加载层
@@ -22,10 +22,7 @@ Vue.prototype.$baseLoading = (index = undefined, text = loadingText) => {
  * @param {number} index 自定义加载图标类名ID
  * @param {string} text 显示在加载图标下方的加载文案
  */
-Vue.prototype.$baseColorfullLoading = (
-  index = undefined,
-  text = loadingText
-) => {
+Vue.prototype.$baseColorfullLoading = (index = undefined, text = loadingText) => {
   let loading
   if (!index) {
     loading = Loading.service({
@@ -58,12 +55,7 @@ Vue.prototype.$baseColorfullLoading = (
  * @param {string} customClass 自定义类名
  * @param {boolean} dangerouslyUseHTMLString 是否将message属性作为HTML片段处理
  */
-Vue.prototype.$baseMessage = (
-  message,
-  type = 'info',
-  customClass = undefined,
-  dangerouslyUseHTMLString = false
-) => {
+Vue.prototype.$baseMessage = (message, type = 'info', customClass = undefined, dangerouslyUseHTMLString = false) => {
   Message({
     message,
     type,
@@ -80,11 +72,7 @@ Vue.prototype.$baseMessage = (
  * @param {string} title 标题
  * @param {function} callback 若不使用Promise,可以使用此参数指定MessageBox关闭后的回调
  */
-Vue.prototype.$baseAlert = (
-  content,
-  title = '温馨提示',
-  callback = undefined
-) => {
+Vue.prototype.$baseAlert = (content, title = '温馨提示', callback = undefined) => {
   MessageBox.alert(content, title, {
     confirmButtonText: '确定',
     dangerouslyUseHTMLString: true,
@@ -140,13 +128,7 @@ Vue.prototype.$baseConfirm = (
  * @param {'top-right'|'top-left'|'bottom-right'|'bottom-left'} position 自定义弹出位置
  * @param duration 显示时间,毫秒
  */
-Vue.prototype.$baseNotify = (
-  message,
-  title,
-  type = 'success',
-  position = 'top-right',
-  duration = messageDuration
-) => {
+Vue.prototype.$baseNotify = (message, title, type = 'success', position = 'top-right', duration = messageDuration) => {
   Notification({
     title,
     message,
@@ -190,10 +172,10 @@ Vue.prototype.$noPagingTableHeight = (formType) => {
  */
 Vue.prototype.$baseEventBus = new Vue()
 !(() => {
-  if (process.env.NODE_ENV !== 'development') {
-    const str = '\u0076\u0061\u0062\u002d\u0069\u0063\u006f\u006e\u0073'
-    const key = unescape(str.replace(/\\u/g, '%u'))
-    if (!dependencies[key]) Vue.prototype = null
-    if (!process.env.VUE_APP_SECRET_KEY) Vue.prototype = null
-  }
+  // if (process.env.NODE_ENV !== 'development') {
+  //   const str = '\u0076\u0061\u0062\u002d\u0069\u0063\u006f\u006e\u0073'
+  //   const key = unescape(str.replace(/\\u/g, '%u'))
+  //   if (!dependencies[key]) Vue.prototype = null
+  //   if (!process.env.VUE_APP_SECRET_KEY) Vue.prototype = null
+  // }
 })()