com.alibaba.csp.sentinel.dashboard.controller.v2.FlowControllerV2中
@Autowired // @Qualifier("flowRuleDefaultProvider") @Qualifier("flowRuleNacosProvider") private DynamicRuleProvider<List<FlowRuleEntity>> ruleProvider; @Autowired // @Qualifier("flowRuleDefaultPublisher") @Qualifier("flowRuleNacosPublisher") private DynamicRulePublisher<List<FlowRuleEntity>> rulePublisher;
打开 /Sentinel-1.6.2/sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/sidebar/sidebar.html文件,修改代码:
<!--<li ui-sref-active="active">--> <!--<a ui-sref="dashboard.flow({app: entry.app})">--> <!--<i></i>  流控规则 V1</a>--> <!--</li>--> --- 改为 <li ui-sref-active="active"> <a ui-sref="dashboard.flow({app: entry.app})"> <i></i>  NACOS 流控规则 V1</a> </li>Dashboard中要修改的代码已经好了。
重新启动 Sentinel-dashboard mvn clean package -DskipTests
测试效果
Sentinel 添加流控规则:
![[Spring-Cloud-Alibaba] Sentinel 规则持久化](/uploads/allimg/210427/145024E41_0.png)
Nacos 查看同步的配置:
![[Spring-Cloud-Alibaba] Sentinel 规则持久化](http://i.loli.net/2019/07/22/5d35a0a28a48076670.png)

