mirror of
https://github.com/snltty/linker.git
synced 2025-12-24 12:38:04 +08:00
Action
This commit is contained in:
@@ -5,12 +5,7 @@ sidebar_position: 6
|
||||
# 6、Action请求
|
||||
|
||||
:::tip[说明]
|
||||
1. 在客户端连接服务器时,可以发出HTTP POST请求,当赶回`ok`时继续连接服务器,当`非ok`时断开连接
|
||||
:::
|
||||
|
||||
## 1、使用ws向linker提交Action参数
|
||||
|
||||
以 javascript为例,提交Action参数
|
||||
如果你设置了Action参数。则在客户端连接服务器时,发出HTTP POST请求,当获得`ok`结果时继续连接服务器,当`非ok`时断开连接,以 javascript为例,提交Action参数
|
||||
```
|
||||
const ws = new WebSocket(`ws://127.0.0.1:1803`, ['接口密钥']);
|
||||
ws.onopen = () => {
|
||||
@@ -25,4 +20,6 @@ ws.onopen = () => {
|
||||
}
|
||||
```
|
||||
|
||||

|
||||

|
||||
:::
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project ver="10" name="linker.tray.win" libEmbed="true" icon="..\linker\favicon.ico" ui="win" output="linker.tray.win.exe" CompanyName="snltty" FileDescription="linker.tray.win" LegalCopyright="Copyright (C) snltty 2024" ProductName="linker.tray.win" InternalName="linker.install.win" FileVersion="0.0.0.102" ProductVersion="0.0.0.102" publishDir="/dist/" dstrip="false" local="false" ignored="false">
|
||||
<project ver="10" name="linker.tray.win" libEmbed="true" icon="..\linker\favicon.ico" ui="win" output="linker.tray.win.exe" CompanyName="snltty" FileDescription="linker.tray.win" LegalCopyright="Copyright (C) snltty 2024" ProductName="linker.tray.win" InternalName="linker.install.win" FileVersion="0.0.0.103" ProductVersion="0.0.0.103" publishDir="/dist/" dstrip="false" local="false" ignored="false">
|
||||
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
|
||||
<folder name="资源文件" path="res" embed="true" local="false" ignored="false">
|
||||
<file name="favicon.ico" path="res\favicon.ico" comment="res\favicon.ico"/>
|
||||
|
||||
@@ -2,21 +2,26 @@
|
||||
using linker.libs.extends;
|
||||
using linker.plugins.capi;
|
||||
using linker.plugins.action;
|
||||
using linker.plugins.client;
|
||||
|
||||
namespace linker.plugins.signin
|
||||
{
|
||||
public sealed class ActionApiController : IApiClientController
|
||||
{
|
||||
private readonly ActionTransfer actionTransfer;
|
||||
private readonly ClientSignInTransfer clientSignInTransfer;
|
||||
|
||||
public ActionApiController(ActionTransfer actionTransfer)
|
||||
public ActionApiController(ActionTransfer actionTransfer, ClientSignInTransfer clientSignInTransfer)
|
||||
{
|
||||
this.actionTransfer = actionTransfer;
|
||||
this.clientSignInTransfer = clientSignInTransfer;
|
||||
}
|
||||
|
||||
public void SetArgs(ApiControllerParamsInfo param)
|
||||
{
|
||||
actionTransfer.SetActions(param.Content.DeJson<List<ActionInfo>>());
|
||||
clientSignInTransfer.SignOut();
|
||||
_ = clientSignInTransfer.SignIn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
v1.3.4
|
||||
2024-09-13 15:04:01
|
||||
2024-09-13 15:17:56
|
||||
1. 优化添加防火墙规则,不使用文件
|
||||
2. 优化权限配置
|
||||
3. 新增Action功能,可用于连接服务器时的自定义第三方验证
|
||||
Reference in New Issue
Block a user