forked from elecV2/elecV2P-dei
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
148 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
elecV2P 开发笔记/草稿。 | ||
|
||
有时候想到一个功能,得先捋清一下思路,才能开始码代码。有些功能可能比较复杂,所以用笔记的形式记录一下。 | ||
|
||
当时的笔记可能不是最终实现的样子,仅供参考(其实也没有什么参考意义,如果感兴趣的话,可以稍微看看 | ||
|
||
总之,这就是在开发过程中,为了捋清楚某些开发步骤而作的一些笔记。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
### 目的 | ||
|
||
限制某个 token 可访问的目录/时间/次数等。 | ||
|
||
### 实现 | ||
|
||
- 可设置多个 token | ||
|
||
每个 token 对应的权限: | ||
- 可访问目录。比如 限制某个 token 除 logs 外其他接口都不可访问 | ||
- 可访问时间。2021-07-20 至 2021-07-21 可精确到秒 | ||
- 可访问次数。访问几次后,该 token 自动失效 | ||
- 其他可能添加 | ||
- 限制 IP | ||
|
||
以上权限取并集。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
### websocket 通信协议设计 | ||
|
||
基础: json-RPC | ||
参考: telegram api | ||
|
||
### 内部函数管理/初始化 | ||
|
||
函数和数据分离 | ||
|
||
服务器端 | ||
- 处理客户端发送过来的数据,对应 method | ||
- 更新 method | ||
- 添加 临时 method / 传输函数 | ||
|
||
``` JS | ||
const wsSer = { | ||
methods: { // 现有方法集 | ||
add(){ // 添加新的方法 | ||
|
||
} | ||
} | ||
} | ||
``` | ||
|
||
### 基础数据传输结构: | ||
|
||
客户端发送: client.send | ||
- 发送者 sender | ||
- 发送模块(单元) unit | ||
- 数据类型(调用函数) | ||
- 函数参数 | ||
- 需要返回 ? | ||
|
||
服务器接收: server.recv | ||
- methods | ||
- reply_to all/sender/unit | ||
|
||
服务器发送: server.send | ||
- 指定接收者 (sender/unit) | ||
- 数据类型(调用函数) | ||
- 函数参数 | ||
- 需要返回 ? | ||
|
||
客户端接收: client.recv | ||
- 接收函数 methods | ||
- reply ? | ||
|
||
|
||
``` 接收 | ||
{ | ||
methods: 'newmthod', | ||
param | ||
} | ||
``` | ||
|
||
## 需要实现的功能 | ||
|
||
- 生成 send 函数。用于向前端网页的某一个单元发送消息 | ||
- 生成 recv 函数。用于接收消息并处理 | ||
|
||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### contextmenu.vue | ||
|
||
``` XML | ||
<contextmenu :menus='menu.list' :x='menu.x' :y='menu.y' /> | ||
``` | ||
|
||
- x <number> : x 坐标 | ||
- y <number> : y 坐标 | ||
- menus <array> : 菜单内容 | ||
- 菜单选项 <object> (建议始终设置 label,其他项视情况添加) | ||
- label <string> : 菜单显示文字 | ||
- click <function> : 点击文字后执行函数 | ||
- rclick <function> : 右键菜单后执行函数 | ||
- dclick <function> : 双击菜单后执行函数 | ||
- color <string> : 菜单选项颜色 | ||
- bkcolor <string> : 菜单选项背景颜色 | ||
- fontsize <string> : 菜单选项文字大小 | ||
- 菜单选项 <object> 同上 | ||
- ... |