Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 动态拉取sign反代 #253

Merged
merged 10 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions src/api/im_connections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export function postGoCqHttpRelogin(id: string) {
});
}

export function getLagrangeSignInfo() {
return request<{ result: true; data: SignInfo[] } | { result: false; err: string }>(
'get',
'get_lgr_signinfo',
);
}

export function postAddGocq(
account: string,
password: string,
Expand Down Expand Up @@ -170,14 +177,14 @@ export function postAddSatori(platform: string, host: string, port: string, toke

export function postAddLagrange(
account: string,
signServerUrl: string,
signServerName: string,
signServerVersion: string,
isGocq: boolean,
) {
return request<DiceConnection>(
'post',
'addLagrange',
{ account, signServerUrl, signServerVersion, isGocq },
{ account, signServerName, signServerVersion, isGocq },
'json',
{
timeout: 65000,
Expand Down Expand Up @@ -231,18 +238,6 @@ export function postConnectSetData(
});
}

export function postSetSignServer(
id: string,
signServerUrl: string | 'sealdice' | 'lagrange',
w: boolean,
signServerVersion: string,
) {
return request<
| { result: false; err: string }
| { result: true; signServerUrl: string; signServerVersion: string }
>('post', 'set_sign_server', { id, signServerUrl, w, signServerVersion });
}

export interface DiceConnection {
id: string;
state: number;
Expand Down Expand Up @@ -284,6 +279,8 @@ interface AdapterQQ {
isReverse: boolean;
reverseAddr: string;
builtinMode: 'gocq' | 'lagrange' | 'lagrange-gocq';
signServerVer: string;
signServerName: string;
}
enum goCqHttpStateCode {
Init = 0,
Expand Down Expand Up @@ -370,3 +367,19 @@ type ServerConfig = {
key: string;
authorization: string;
};
interface SignServer {
name: string;
url: string;
latency: number;
selected: boolean;
ignored: boolean;
note: string;
}
export interface SignInfo {
version: string;
appinfo: [];
servers: SignServer[];
selected: boolean;
ignored: boolean;
note: string;
}
119 changes: 101 additions & 18 deletions src/components/PageAbout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -428,25 +428,108 @@
<div>格莱德 - 在4月7日的可靠性测试中,参与构造了让旧版海豹进程崩溃的指令</div>
<div>我来逛街 - 提出很多建议;帮助改进了DND5E同义词列表,增加许多常用说法</div>

<div style="margin-top: 2rem;" class="subtitle">手册编写</div>
<div style="margin-top: 2rem" class="subtitle">手册编写</div>
<div class="developers">
<el-link :underline="false" href="https://github.com/JustAnotherID" target="_blank"><el-avatar shape="circle" :size="50" style="border: 1px solid #aaa;" :src="urlBase + '/sd-api/utils/ga/JustAnotherID'"/>只是另一个ID</el-link>
<el-link :underline="false" href="https://github.com/Xiangze-Li" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/Xiangze-Li'"/>JohNSoN</el-link>
<el-link :underline="false" href="https://github.com/MX-fox" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/MX-fox'"/>暮星</el-link>
<el-link :underline="false" href="https://github.com/Szzrain" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/Szzrain?v=1'"/>Szzrain</el-link>
<el-link :underline="false" href="https://github.com/fy0" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/fy0'"/>木落</el-link>
<el-link :underline="false" href="https://github.com/kenichiLyon" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/kenichiLyon'"/>山本健一</el-link>
<el-link :underline="false" href="https://github.com/MintCider" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/MintCider'"/>逐风</el-link>
<el-link :underline="false" href="https://github.com/f44r" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/f44r'"/>脑</el-link>
<el-link :underline="false" href="https://github.com/bugtower100" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/bugtower100'"/>Bugtower</el-link>
<el-link :underline="false" href="https://github.com/Mitxoleta" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/Mitxoleta'"/>Monad</el-link>
<el-link :underline="false" href="https://github.com/yichirehuijian" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/yichirehuijian'"/>以炽热挥剑</el-link>
<el-link :underline="false" href="https://github.com/oissevalt" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/oissevalt'"/>檀轶步棋</el-link>
<el-link :underline="false" href="https://github.com/lxy071130" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/lxy071130'"/>流溪</el-link>
<el-link :underline="false" href="https://github.com/PaienNate" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/PaienNate'"/>PaienNate</el-link>
<el-link :underline="false" href="https://github.com/nodisease" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/nodisease'"/>病</el-link>
<el-link :underline="false" href="https://github.com/Stanlty998" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/Stanlty998'"/>綮小灰</el-link>
<el-link :underline="false" href="https://github.com/-" target="_blank"><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/-'"/>大概不全,下版本纠正……</el-link>
<el-link :underline="false" href="https://github.com/JustAnotherID" target="_blank"
><el-avatar
shape="circle"
:size="50"
style="border: 1px solid #aaa"
:src="urlBase + '/sd-api/utils/ga/JustAnotherID'" />只是另一个ID</el-link
>
<el-link :underline="false" href="https://github.com/Xiangze-Li" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/Xiangze-Li'" />JohNSoN</el-link
>
<el-link :underline="false" href="https://github.com/MX-fox" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/MX-fox'" />暮星</el-link
>
<el-link :underline="false" href="https://github.com/Szzrain" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/Szzrain?v=1'" />Szzrain</el-link
>
<el-link :underline="false" href="https://github.com/fy0" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/fy0'" />木落</el-link
>
<el-link :underline="false" href="https://github.com/kenichiLyon" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/kenichiLyon'" />山本健一</el-link
>
<el-link :underline="false" href="https://github.com/MintCider" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/MintCider'" />逐风</el-link
>
<el-link :underline="false" href="https://github.com/f44r" target="_blank"
><el-avatar shape="circle" :size="50" :src="urlBase + '/sd-api/utils/ga/f44r'" />脑</el-link
>
<el-link :underline="false" href="https://github.com/bugtower100" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/bugtower100'" />Bugtower</el-link
>
<el-link :underline="false" href="https://github.com/Mitxoleta" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/Mitxoleta'" />Monad</el-link
>
<el-link :underline="false" href="https://github.com/yichirehuijian" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/yichirehuijian'" />以炽热挥剑</el-link
>
<el-link :underline="false" href="https://github.com/oissevalt" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/oissevalt'" />檀轶步棋</el-link
>
<el-link :underline="false" href="https://github.com/lxy071130" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/lxy071130'" />流溪</el-link
>
<el-link :underline="false" href="https://github.com/PaienNate" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/PaienNate'" />PaienNate</el-link
>
<el-link :underline="false" href="https://github.com/nodisease" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/nodisease'" />病</el-link
>
<el-link :underline="false" href="https://github.com/Stanlty998" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/Stanlty998'" />綮小灰</el-link
>
<el-link :underline="false" href="https://github.com/-" target="_blank"
><el-avatar
shape="circle"
:size="50"
:src="urlBase + '/sd-api/utils/ga/-'" />大概不全,下版本纠正……</el-link
>
</div>

<div style="margin-top: 2rem" class="subtitle">参考</div>
Expand Down
Loading
Loading