From fa165d4e0c0f456be7f910f1758f588662c102dc Mon Sep 17 00:00:00 2001 From: Fripine Date: Thu, 7 Nov 2024 19:04:40 +0800 Subject: [PATCH 1/6] feat: postAddLagrangeGocq --- src/api/im_connections/index.ts | 18 +++++++++++- src/components/PageConnectInfoItems.vue | 37 ++++++++++++++++--------- src/store/index.ts | 12 +++++++- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/src/api/im_connections/index.ts b/src/api/im_connections/index.ts index bc28d66..3e37d80 100644 --- a/src/api/im_connections/index.ts +++ b/src/api/im_connections/index.ts @@ -180,6 +180,22 @@ export function postAddLagrange(account: string, signServerUrl: string, signServ ); } +export function postAddLagrangeGocq( + account: string, + signServerUrl: string, + signServerVersion: string, +) { + return request( + 'post', + 'addLagrangeGocq', + { account, signServerUrl, signServerVersion }, + 'json', + { + timeout: 65000, + }, + ); +} + export function postConnectionDel(id: string) { return request('post', 'del', { id }); } @@ -364,4 +380,4 @@ type ServerConfig = { url: string; key: string; authorization: string; -}; +}; \ No newline at end of file diff --git a/src/components/PageConnectInfoItems.vue b/src/components/PageConnectInfoItems.vue index 02f9b2f..e00d539 100644 --- a/src/components/PageConnectInfoItems.vue +++ b/src/components/PageConnectInfoItems.vue @@ -774,6 +774,17 @@ class="mb-6"> 当前为容器模式,内置客户端被禁用。 + + 当前为容器模式,内置 gocq 被禁用。 + @@ -784,6 +795,12 @@ :disabled=" store.diceServers.length > 0 && store.diceServers[0].baseInfo.containerMode "> + @@ -796,12 +813,6 @@ - @@ -854,14 +865,14 @@ --> @@ -872,14 +883,14 @@ @@ -1756,7 +1767,7 @@ (form.accountType === 9 && (form.botToken === '' || form.appToken === '')) || (form.accountType === 11 && (form.account === '' || form.reverseAddr === '')) || (form.accountType === 13 && (form.token === '' || form.url === '')) || - (form.accountType === 15 && + ((form.accountType === 15 || form.accountType === 16) && (form.account === '' || (form.signServerType === 2 && form.signServerUrl === ''))) " @click="goStepTwo"> @@ -2024,7 +2035,7 @@ const goStepTwo = async () => { setRecentLogin(); duringRelogin.value = false; - if (form.accountType === 15) { + if (form.accountType === 15 || form.accountType === 16) { switch (form.signServerType) { case 0: form.signServerUrl = 'sealdice'; @@ -2481,4 +2492,4 @@ const doRemove = async (i: DiceConnection) => { .the-dialog { min-width: 370px; } - + \ No newline at end of file diff --git a/src/store/index.ts b/src/store/index.ts index d624c3b..d1be8f6 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -15,6 +15,7 @@ import { postAddGocqSeparate, postAddKook, postAddLagrange, + postAddLagrangeGocq, postAddMinecraft, postAddOfficialQQ, postAddOnebot11ReverseWs, @@ -364,6 +365,15 @@ export const useStore = defineStore('main', { info = await postAddLagrange(account, signServerUrl, version); } break; + case 16: + { + let version = ''; + if (signServerUrl === 'sealdice' || signServerUrl === 'lagrange') { + version = signServerVersion; + } + info = await postAddLagrangeGocq(account, signServerUrl, version); + } + break; } return info as DiceConnection; }, @@ -431,4 +441,4 @@ export const useStore = defineStore('main', { return this.token != ''; }, }, -}); +}); \ No newline at end of file From 3a9e15733fad4f2fa245c60eef4c235e711dcbbe Mon Sep 17 00:00:00 2001 From: Fripine Date: Thu, 7 Nov 2024 19:08:48 +0800 Subject: [PATCH 2/6] lint --- src/api/im_connections/index.ts | 2 +- src/components/PageConnectInfoItems.vue | 2 +- src/store/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/im_connections/index.ts b/src/api/im_connections/index.ts index 3e37d80..7625709 100644 --- a/src/api/im_connections/index.ts +++ b/src/api/im_connections/index.ts @@ -380,4 +380,4 @@ type ServerConfig = { url: string; key: string; authorization: string; -}; \ No newline at end of file +}; diff --git a/src/components/PageConnectInfoItems.vue b/src/components/PageConnectInfoItems.vue index e00d539..4287773 100644 --- a/src/components/PageConnectInfoItems.vue +++ b/src/components/PageConnectInfoItems.vue @@ -2492,4 +2492,4 @@ const doRemove = async (i: DiceConnection) => { .the-dialog { min-width: 370px; } - \ No newline at end of file + diff --git a/src/store/index.ts b/src/store/index.ts index d1be8f6..502915a 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -441,4 +441,4 @@ export const useStore = defineStore('main', { return this.token != ''; }, }, -}); \ No newline at end of file +}); From 53dadd8014c7c984b24f512bd8d7ae7258584f69 Mon Sep 17 00:00:00 2001 From: Fripine Date: Fri, 8 Nov 2024 14:47:55 +0800 Subject: [PATCH 3/6] delete postAddLagrangeGocq --- src/api/im_connections/index.ts | 20 ++------------------ src/store/index.ts | 5 ++--- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/api/im_connections/index.ts b/src/api/im_connections/index.ts index 7625709..53f3f17 100644 --- a/src/api/im_connections/index.ts +++ b/src/api/im_connections/index.ts @@ -168,27 +168,11 @@ export function postAddSatori(platform: string, host: string, port: string, toke }); } -export function postAddLagrange(account: string, signServerUrl: string, signServerVersion: string) { +export function postAddLagrange(account: string, signServerUrl: string, signServerVersion: string, isGocq: boolean) { return request( 'post', 'addLagrange', - { account, signServerUrl, signServerVersion }, - 'json', - { - timeout: 65000, - }, - ); -} - -export function postAddLagrangeGocq( - account: string, - signServerUrl: string, - signServerVersion: string, -) { - return request( - 'post', - 'addLagrangeGocq', - { account, signServerUrl, signServerVersion }, + { account, signServerUrl, signServerVersion, isGocq }, 'json', { timeout: 65000, diff --git a/src/store/index.ts b/src/store/index.ts index 502915a..75cda55 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -15,7 +15,6 @@ import { postAddGocqSeparate, postAddKook, postAddLagrange, - postAddLagrangeGocq, postAddMinecraft, postAddOfficialQQ, postAddOnebot11ReverseWs, @@ -362,7 +361,7 @@ export const useStore = defineStore('main', { if (signServerUrl === 'sealdice' || signServerUrl === 'lagrange') { version = signServerVersion; } - info = await postAddLagrange(account, signServerUrl, version); + info = await postAddLagrange(account, signServerUrl, version, false); } break; case 16: @@ -371,7 +370,7 @@ export const useStore = defineStore('main', { if (signServerUrl === 'sealdice' || signServerUrl === 'lagrange') { version = signServerVersion; } - info = await postAddLagrangeGocq(account, signServerUrl, version); + info = await postAddLagrange(account, signServerUrl, version, true); } break; } From 6f657effb337617a240a21e5824153d82574c193 Mon Sep 17 00:00:00 2001 From: Fripine Date: Fri, 8 Nov 2024 15:09:28 +0800 Subject: [PATCH 4/6] lint --- src/api/im_connections/index.ts | 7 ++++++- src/components/PageConnectInfoItems.vue | 26 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/api/im_connections/index.ts b/src/api/im_connections/index.ts index 53f3f17..b89b11a 100644 --- a/src/api/im_connections/index.ts +++ b/src/api/im_connections/index.ts @@ -168,7 +168,12 @@ export function postAddSatori(platform: string, host: string, port: string, toke }); } -export function postAddLagrange(account: string, signServerUrl: string, signServerVersion: string, isGocq: boolean) { +export function postAddLagrange( + account: string, + signServerUrl: string, + signServerVersion: string, + isGocq: boolean, +) { return request( 'post', 'addLagrange', diff --git a/src/components/PageConnectInfoItems.vue b/src/components/PageConnectInfoItems.vue index 4287773..ce37e0d 100644 --- a/src/components/PageConnectInfoItems.vue +++ b/src/components/PageConnectInfoItems.vue @@ -249,6 +249,32 @@ + +