Browse Source

feat: change base site use

zhangyuhan 3 years ago
parent
commit
9825ee1a4b
2 changed files with 5 additions and 3 deletions
  1. 4 2
      packages/components/Navbar/index.vue
  2. 1 1
      packages/micro-frame/index.js

+ 4 - 2
packages/components/Navbar/index.vue

@@ -113,6 +113,8 @@
 import NavbarItem from './components/item'
 import { mapActions, mapGetters, mapState } from 'vuex'
 import EmptyTip from '../Empty'
+import { completeURLPrefix } from '../../micro-frame'
+
 export default {
   name: 'header-navbar',
   components: {
@@ -196,7 +198,7 @@ export default {
           this.$router.push({
             name: 'page',
             query: {
-              link: process.env.VUE_APP_BASE_SITE + '/swordfish/frontPage/messageCenter/sess/index'
+              link: completeURLPrefix('/swordfish/frontPage/messageCenter/sess/index')
             }
           })
           break
@@ -208,7 +210,7 @@ export default {
       }
     },
     goSiteHome () {
-      location.href = this.home
+      location.href = completeURLPrefix(this.home)
     },
     closeMessagePopver () {
       this.$refs.navMessage.doClose()

+ 1 - 1
packages/micro-frame/index.js

@@ -14,7 +14,7 @@ export function getNowRoute () {
  * @param prefix
  * @returns {string|*}
  */
-function completeURLPrefix (link, prefix = process.env.VUE_APP_BASE_SITE) {
+export function completeURLPrefix (link, prefix = process.env.VUE_APP_BASE_SITE) {
   const hasPrefix = /^http(s)?:\/\//.test(link)
   const hasSign = /^\//.test(link)
   if (!hasPrefix) {