Skip to content

Commit 5572601

Browse files
committed
Update according to comments
1 parent 26b9692 commit 5572601

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

en_US/dashboard/introduction.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ This feature is particularly useful for seamless redirection and integration sce
5656

5757
1. Call the `/login` API to obtain the login token and related information.
5858

59-
2. Manually add the username used during login (not included in the `/login` response).
59+
```
60+
curl -X POST "http://127.0.0.1:18083/api/v5/login" \
61+
-H 'accept: application/json' \
62+
-H 'Content-Type: application/json' \
63+
-d '{"username": "admin","password": "public"}'
64+
{"license":{"edition":"ee"},"role":"administrator","token":"xxx.yyy.zzz","version":"5.6.1"}
65+
```
6066

61-
3. Combine the data into a JSON structure:
67+
2. Combine the data into a JSON structure. Manually add the username used during login (not included in the `/login` response).
6268

6369
```json
6470
{
@@ -67,14 +73,21 @@ This feature is particularly useful for seamless redirection and integration sce
6773
},
6874
"role": "administrator",
6975
"token": "xxx.jwt.token",
70-
"version": "5.5.0-g0fef19f8",
76+
"version": "5.6.1-g0fef19f8",
7177
"username": "admin"
7278
}
7379
```
7480

75-
4. Convert the JSON string to Base64.
81+
3. Convert the JSON string to Base64.
82+
83+
```
84+
curl -s -X POST "http://127.0.0.1:18083/api/v5/login" \
85+
-H 'accept: application/json' \
86+
-H 'Content-Type: application/json' \
87+
-d '{"username": "admin","password": "public"}' | jq '.username = "admin"' | base64
88+
```
7689

77-
5. Embed the encoded string in the `login_meta` query parameter of the Dashboard URL.
90+
4. Embed the encoded string in the `login_meta` query parameter of the Dashboard URL.
7891

7992
#### Example URL
8093

zh_CN/dashboard/introduction.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ EMQX Dashboard 是一个 Web 应用程序,默认监听 `18083` 端口。下载
5858

5959
1. 调用 `/login` 接口,获取登录返回的 token 及相关信息。
6060

61-
2. 手动添加登录时使用的用户名(该字段不包含在接口返回中)。
61+
```
62+
curl -X POST "http://127.0.0.1:18083/api/v5/login" \
63+
-H 'accept: application/json' \
64+
-H 'Content-Type: application/json' \
65+
-d '{"username": "admin","password": "public"}'
66+
{"license":{"edition":"ee"},"role":"administrator","token":"xxx.yyy.zzz","version":"5.6.1"}
67+
```
6268

63-
3. 将数据整理成如下 JSON 结构
69+
2. 将数据整理成如下 JSON 结构,手动添加登录时使用的用户名(该字段不包含在接口返回中)。
6470

6571
```json
6672
{
@@ -74,9 +80,16 @@ EMQX Dashboard 是一个 Web 应用程序,默认监听 `18083` 端口。下载
7480
}
7581
```
7682

77-
4. 将 JSON 字符串进行 Base64 编码。
83+
3. 将 JSON 字符串进行 Base64 编码。
84+
85+
```
86+
curl -s -X POST "http://127.0.0.1:18083/api/v5/login" \
87+
-H 'accept: application/json' \
88+
-H 'Content-Type: application/json' \
89+
-d '{"username": "admin","password": "public"}' | jq '.username = "admin"' | base64
90+
```
7891

79-
5. 将编码后的字符串通过 `login_meta` 参数附加到 Dashboard 的访问 URL 中。
92+
4. 将编码后的字符串通过 `login_meta` 参数附加到 Dashboard 的访问 URL 中。
8093

8194
#### 示例 URL
8295

0 commit comments

Comments
 (0)