Files
skills/mis-agent-spec/references/nacos.md
T
2026-08-15 16:21:12 +08:00

48 lines
967 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Intro
你可以通过本文档获取访问Nacos配置。
## 变量
- base_url、username、password:从pom.xml里的profile获取。
- dataId、namespace:使用profile的名称,例如:dev/qas。
- groupName:固定值"DEFAULT_GROUP"。
## 配置文件说明
- mis-agent.yml:当前模块也就是**mis-agent**应用的配置文件
- datasource.ymlMySQL数据源配置。
## 如何获取accessToken
请求示例:
```bash
curl -X POST 'http://{base_url}/nacos/v1/auth/login' -d 'username={username}&password={password}'
```
输出示例:
```json
{"accessToken":"xxx"}
```
## 如何获取配置项
请求示例:
```bash
curl -X GET "http://{base_url}/nacos/v3/console/cs/config?dataId={dataId}&groupName={groupName}&namespaceId={namespace}" -H "Authorization: Bearer xxx"
```
输出示例:
```json
{
"code": 0,
"message": "success",
"data": {"content": "..."}
}
```
> `data.content`就是**yml**格式的配置内容。