microapp 通过链接区分主子应用步骤

0 阅读1分钟

1. micro

{ name: "statistic", url: `http://192.168.110.100:81/project/statistic/` }

2. vue.config.js

主应用

image.png

子应用

image.png

3. nginx配置

主应用

  location / {
        root  /home/env/html/saas/base;
	add_header access-control-allow-origin *;
        try_files $uri $uri/ /index.html;
        index  index.html index.htm;
    }

子应用

 location /project/system {
        alias /home/env/html/saas/portal/; 
	add_header access-control-allow-origin *;
        index index.html index.htm;
        try_files $uri $uri/ /system/index.html;
    }