fix: fix the cloud export proxy issue

This commit is contained in:
PetrichorFun 2026-01-30 16:25:40 +08:00
parent 87606bdf05
commit b1f70e9a3a
4 changed files with 14 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "azon-seeker", "name": "azon-seeker",
"displayName": "Azon Seeker v0.7.1.4-beta", "displayName": "Azon Seeker v0.7.1.6-beta",
"version": "0.7.2", "version": "0.7.2",
"private": true, "private": true,
"description": "Starter modify by honestfox101 and PetrichorFun", "description": "Starter modify by honestfox101 and PetrichorFun",

View File

@ -16,11 +16,17 @@ type WebSocketResponse =
| { type: 'progress'; current: number; total: number } | { type: 'progress'; current: number; total: number }
| { type: 'result'; result: string }; | { type: 'result'; result: string };
// 使用 wss:// 和 https://
const protocol = __DEV__ ? 'ws' : 'wss';
const httpProtocol = __DEV__ ? 'http' : 'https';
class ExportExcelPipeline { class ExportExcelPipeline {
private socket: WebSocket; private socket: WebSocket;
constructor() { constructor() {
this.socket = new WebSocket(`ws://${remoteHost}/ws/daa0b9f1-4e4a-4e7c-9269-f5f0e86ae271`); this.socket = new WebSocket(
`${protocol}://${remoteHost}/ws/daa0b9f1-4e4a-4e7c-9269-f5f0e86ae271`,
);
} }
private sendCommand(command: Command) { private sendCommand(command: Command) {
@ -32,7 +38,9 @@ class ExportExcelPipeline {
switch (this.socket.readyState) { switch (this.socket.readyState) {
case WebSocket.CLOSED: case WebSocket.CLOSED:
case WebSocket.CLOSING: case WebSocket.CLOSING:
this.socket = new WebSocket(`ws://${remoteHost}/ws/daa0b9f1-4e4a-4e7c-9269-f5f0e86ae271`); this.socket = new WebSocket(
`${protocol}://${remoteHost}/ws/daa0b9f1-4e4a-4e7c-9269-f5f0e86ae271`,
);
case WebSocket.CONNECTING: case WebSocket.CONNECTING:
return new Promise<ExportExcelPipeline>((resolve) => { return new Promise<ExportExcelPipeline>((resolve) => {
this.socket!.onopen = () => resolve(this); this.socket!.onopen = () => resolve(this);
@ -118,7 +126,7 @@ export const useCloudExporter = () => {
await pipeline.close(); await pipeline.close();
if (file) { if (file) {
const url = `http://${remoteHost}${file}`; const url = `${httpProtocol}://${remoteHost}${file}`;
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.download = `${dayjs().format('YYYY-MM-DD')}.xlsx`; link.download = `${dayjs().format('YYYY-MM-DD')}.xlsx`;

View File

@ -76,10 +76,7 @@ const handleHelpButtonClick = () => {
<router-view /> <router-view />
</main> </main>
<footer> <footer>
<span <span>Azon Seeker v{{ version }} powered by <a href="">@PetrichorZone</a></span>
>Azon Seeker v{{ version }} powered by
<a href="https://github.com/honestfox101">@HonestFox101</a></span
>
</footer> </footer>
</template> </template>

View File

@ -8,7 +8,7 @@ const keyPairPromise = generateKeyPair();
const publicKeyBase64Promise = keyPairPromise.then(async ({ publicKey }) => exportKey(publicKey)); const publicKeyBase64Promise = keyPairPromise.then(async ({ publicKey }) => exportKey(publicKey));
const httpClient = createAlova({ const httpClient = createAlova({
baseURL: `https://${remoteHost}`, baseURL: `${__DEV__ ? 'http' : 'https'}://${remoteHost}`,
requestAdapter: adapterFetch(), requestAdapter: adapterFetch(),
timeout: 10000, timeout: 10000,
statesHook: VueHook, statesHook: VueHook,