In some special scenarios, frontend resources and backend services are not deployed on the same machine, and different domain names are used. At this time, there will be cross domain problems when the frontend perform the backend API services

CabloyJS has built-in very convenient cors support. The specific configuration is as follows:

Frontend Configuration

Just modify the parameter api.baseURL in the frontend configuration


export default {
  api: {
    baseURL: '',

Backend Configuration

Just modify the parameter cors.whiteList of the module a-base


  // module config
  config.modules = {
    'a-base': {
      cors: {
        whiteList: '',

cors.whiteList: Can be multiple domain names separated by commas