Skip to content

Commit

Permalink
updata server_plugin.md and server_plugin.zh_cn.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Fypy1019 committed Oct 23, 2024
1 parent 6999cce commit 77a3580
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
15 changes: 7 additions & 8 deletions docs/server_plugin.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
---
layout: page
title: Server Plugins
nav_order: 7
nav_order: 11
permalink: /server_plugin/
---

# OpenNHP Plugin Development Guide
{: .fs-9 }

# OpenNHP Plugin Development Guide
[中文版](/docs/zh-cn/server_plugin.zh-cn.md){: .label .fs-4 }

---

## Table of Contents

Expand Down Expand Up @@ -114,7 +117,7 @@ Before developing OpenNHP plugins, ensure the following environment is properly

1. **Development Language**: Go language is used for development.
2. **Development Tools**: IDEs like IntelliJ IDEA or VS Code are recommended.
3. **NHP SDK**: Download and integrate the latest version of the OpenNHP code from GitHub into your development environment. Download URL: [https://github.com/OpenNHP/opennhp](https://github.com/OpenNHP/opennhp).
3. **OpenNHP source code**: Download and integrate the latest version of the OpenNHP code from GitHub into your development environment. Download URL: [https://github.com/OpenNHP/opennhp](https://github.com/OpenNHP/opennhp).

### 3.2 Project Initialization

Expand Down Expand Up @@ -162,7 +165,7 @@ In the plugin function design phase, the following core points need to be clarif

For example, the main functionality to be implemented by the "example" plugin is as follows:

1. After submitting a form containing the user's identity and password on the H5 page;
1. Submit a form containing user name and password on the H5 page;

2. The NHP-Server server receives the form for verification. After the verification is successful, it initiates a knock on the NHP-AC server;

Expand Down Expand Up @@ -264,10 +267,6 @@ After the plugin deployment is complete, it is necessary to validate its functio
Developing plugins for the NHP server can extend the server's functionality in a modular and maintainable way. By following the steps outlined above, you can create your own plugins and contribute to the NHP server project.


[Chinese version](/docs/zh-cn/server_plugin.zh-cn.md){: .label .fs-4 }

---




19 changes: 9 additions & 10 deletions docs/zh-cn/server_plugin.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ layout: page
title: 服务器插件开发
parent: 中文版
nav_order: 7
permalink: /zh-cn/server_plugin.zh-cn/
permalink: /zh-cn/server_plugin/
---

- {: .fs-9 }

# OpenNHP插件开发教程
{: .fs-9 }

[English version](/docs/server_plugin.md){: .label .fs-4 }

---

# 目录

Expand Down Expand Up @@ -116,7 +119,7 @@ NHP服务器接收到来自浏览器的HTTP请求后,会根据请求的URL路

**2.开发工具**:推荐使用IDEA、VS Code等集成开发环境。

**3.NHP SDK**:从GitHub下载最新版本的opennhp代码,并集成至开发环境。下载地址:https://github.com/OpenNHP/opennhp。
**3.OpenNHP源码**:从GitHub下载最新版本的opennhp代码,并集成至开发环境。下载地址:https://github.com/OpenNHP/opennhp。

### 3.2 初始化项目

Expand Down Expand Up @@ -164,7 +167,7 @@ NHP 服务器中的每个插件通常都结构化为一个单独的 Go 包。例

例如“example”插件所要实现的功能主体为:

1. 在H5页面提交包含用户民、密码的表单后
1. 在H5页面提交包含用户名、密码的表单

2. NHP-Server服务器接收表单进行验证,验证成功后向NHP-AC服务器发起敲门;

Expand Down Expand Up @@ -263,8 +266,4 @@ NHP 服务器中的每个插件通常都结构化为一个单独的 Go 包。例
插件部署完成后,需要在实际应用环境中对其进行功能验证,确保在生产环境下插件能够正常工作。在插件上线后,还应定期进行运维,持续监控插件的表现,记录运行数据,并及时进行必要的更新和维护,确保插件在长期使用中保持最佳状态。

# 结论
为 NHP 服务器开发插件可以以一种模块化和可维护的方式扩展服务器的功能。通过遵循上述步骤,您可以创建自己的插件并为 NHP 服务器项目做出贡献。

[英文版](/docs/server_plugin.md){: .label .fs-4 }

---
为 NHP 服务器开发插件可以以一种模块化和可维护的方式扩展服务器的功能。通过遵循上述步骤,您可以创建自己的插件并为 NHP 服务器项目做出贡献。
2 changes: 1 addition & 1 deletion server/plugins/example/etc/resource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# RedirectWithParams: whether or not to include queries in the original http request. (only applicable for http agent)
["demo"]
SkipAuth = true
OpenTime = 15
OpenTime = 120
RedirectUrl = "https://acdemo.opennhp.cn"
RedirectWithParams = false
CookieDomain = "opennhp.cn"
Expand Down

0 comments on commit 77a3580

Please sign in to comment.