修改 nacos-federation 插件,实现 接口请求基地址从 配置中心获取,并注入到环境变量中

This commit is contained in:
编码猿
2025-09-23 03:26:10 +08:00
parent cbc2c25cf4
commit 84c4e8bdc7
22 changed files with 363 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
import {defineComponent} from 'vue'
import { defineComponent } from 'vue'
export default defineComponent({
setup() {

View File

@@ -1,6 +1,5 @@
import { RouteRecordRaw } from 'vue-router';
export const productRouter: Array<RouteRecordRaw> = [
{
path: '/Products',

View File

@@ -1,7 +1,7 @@
import {product} from '@domains/product/di/productModule';
import {ProductType} from '@domains/product/domain/type/ProductType';
import {defineComponent, onMounted, reactive} from 'vue'
import {useRoute} from 'vue-router'
import { product } from '@domains/product/di/productModule';
import { ProductType } from '@domains/product/domain/type/ProductType';
import { defineComponent, onMounted, reactive } from 'vue'
import { useRoute } from 'vue-router'
interface storeType {
item: ProductType
@@ -36,13 +36,13 @@ export default defineComponent({
return () => (
<div class="ProductDetail">
<h1> - </h1>
<hr />
<p>id{state.id}</p>
{state.item.name}
<hr/>
<p>id{ state.id }</p>
{ state.item.name }
<ul>
{
Object.entries(state.item).map(([key, value]) =>
<li>{key}: {value}</li>
Object.entries(state.item).map(([ key, value ]) =>
<li>{ key }: { value }</li>
)
}
</ul>

View File

@@ -1,7 +1,7 @@
import {defineComponent, onMounted, reactive} from 'vue'
import {useRouter} from 'vue-router';
import {product} from '@domains/product/di/productModule';
import {ProductType} from '@domains/product/domain/type/ProductType';
import { defineComponent, onMounted, reactive } from 'vue'
import { useRouter } from 'vue-router';
import { product } from '@domains/product/di/productModule';
import { ProductType } from '@domains/product/domain/type/ProductType';
interface storeType {
list: Array<ProductType>
@@ -30,18 +30,18 @@ export default defineComponent({
return () => (
<div class="ProductList">
<h1> - 3</h1>
<hr />
<hr/>
<h2>Deno </h2>
<ul>
{
state.list.map(item =>
<li key={item.id} onClick={() => {
<li key={ item.id } onClick={ () => {
router.push({
name: 'ProductDetail',
query: { id: item.id }
});
}}>
{item.id} | {item.name} | ¥{item.price}
} }>
{ item.id } | { item.name } | ¥{ item.price }
</li>
)
}