weizhouapache edited a comment on pull request #898:
URL: 
https://github.com/apache/cloudstack-primate/pull/898#issuecomment-762338936


   @wido the above config does not work with latest commit by @utchoang 
   even if I change the config.json to the following
   ```
     "servers": [
       {
         "name": "mgt01",
         "apiHost": "/mgt01",
         "apiBase": "/client/api"
       },
       {
         "name": "mgt02",
         "apiHost": "/mgt02",
         "apiBase": "/client/api"
       },
       {
         "name": "mgt03",
         "apiHost": "/mgt03",
         "apiBase": "/client/api"
       }
     ],
   ```
   this is fixed by
   ```
   diff --git a/src/permission.js b/src/permission.js
   index d865b43e..201e9b0c 100644
   --- a/src/permission.js
   +++ b/src/permission.js
   @@ -42,7 +42,11 @@ router.beforeEach((to, from, next) => {
   
      const servers = Vue.prototype.$config.servers
      const serverStorage = Vue.ls.get(SERVER_MANAGER)
   -  const serverFilter = servers.filter(ser => ser.apiHost + ser.apiBase === 
serverStorage.apiHost + serverStorage.apiBase)
   +  var apiFullPath = null
   +  if (serverStorage) {
   +    apiFullPath = serverStorage.apiHost + serverStorage.apiBase
   +  }
   +  const serverFilter = servers.filter(ser => ser.apiHost + ser.apiBase === 
apiFullPath)
      const server = serverFilter[0] || servers[0]
   
      Vue.axios.defaults.baseURL = server.apiHost + server.apiBase
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to