diff --git a/package.json b/package.json index 5e9e23b..4e3ce8d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "publisher": "oeyoews", "name": "usewiki2", "displayName": "usewiki2", - "version": "1.2.1", + "version": "1.3.0", "private": true, "packageManager": "pnpm@9.0.6", "description": "", @@ -57,11 +57,11 @@ "default": 8080, "description": "端口 (请确定你已经启动了太微)" }, - "enableHttps": { + "usewiki2.enableHttps": { "order": 2, "type": "boolean", "default": false, - "markdownDescription": "Enable or disable HTTPS" + "markdownDescription": "Enable or Disable HTTPS(untest for https)" }, "usewiki2.type": { "order": 3, diff --git a/src/featchData.ts b/src/featchData.ts index 3877c85..bc90287 100644 --- a/src/featchData.ts +++ b/src/featchData.ts @@ -1,14 +1,18 @@ import http from 'node:http'; +import https from 'node:https'; import * as vscode from 'vscode'; import { enableHttps, config, getIp, getPort } from './config'; +import { notify } from './notify'; export default function fetchData(): Promise { // notify(`正在获取数据${getPort()}`, 'info'); const protocal = enableHttps() ? 'https' : 'http'; const twurl = `${protocal}://${getIp()}:${getPort()}/status`; + // notify(`正在获取数据${twurl}`, 'info'); + const protocalMethos = enableHttps() ? https : http; return new Promise((resolve, reject) => { - http + protocalMethos .get(twurl, (response) => { let data: any = null; response.on('data', (chunk) => {