-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solve this problem: micro-zoe/micro-app#1055
- Loading branch information
Showing
6 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
const url = ref() | ||
const replaceUrl = () => { | ||
let actualUrl = window.location.href | ||
actualUrl = actualUrl.replace('/app1', '/child') | ||
url.value = actualUrl | ||
} | ||
replaceUrl() | ||
console.log('加载子应用:'+url.value) | ||
</script> | ||
|
||
|
||
<template> | ||
<div> | ||
主应用区域 | ||
<micro-app | ||
name='appname-vite' | ||
url='http://172.30.111.50:8080/child/' | ||
:url='url' | ||
inline | ||
disablesandbox | ||
></micro-app> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
console.log('加载主应用') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
#user nobody; | ||
worker_processes 1; | ||
|
||
#error_log logs/error.log; | ||
#error_log logs/error.log notice; | ||
#error_log logs/error.log info; | ||
|
||
#pid logs/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
server { | ||
listen 8080; | ||
server_name 172.30.111.50; | ||
|
||
location / { | ||
proxy_pass http://127.0.0.1:3000; | ||
} | ||
|
||
location ~* ^/child/(.*)$ { | ||
proxy_pass http://127.0.0.1:4007/$1; | ||
} | ||
} | ||
|
||
server { | ||
listen 3000; | ||
server_name localhost; | ||
|
||
root C:\\...\\main_apps\\vite-vue3\\main-vite; | ||
index index.html; | ||
try_files $uri $uri/ /index.html =404; | ||
|
||
} | ||
|
||
server { | ||
listen 4007; | ||
server_name localhost; | ||
|
||
root C:\\...\\child_apps\\vite-vue3\\vite; | ||
index index.html; | ||
try_files $uri $uri/ /index.html =404; | ||
} | ||
|
||
|
||
} |