From 9ed9e9b97389d491a14dcd93aafaa746a66258f3 Mon Sep 17 00:00:00 2001 From: po-lan <42771836+po-lan@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9WSL=E8=99=9A=E6=8B=9F=E6=9C=BA=20?= =?UTF-8?q?=E4=BB=A3=E7=90=86=20=E6=B7=BB=E5=8A=A0=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configs/config.py b/configs/config.py index 70ff7a1e..6528e3a8 100644 --- a/configs/config.py +++ b/configs/config.py @@ -2,6 +2,10 @@ from typing import Optional from pathlib import Path from .utils import ConfigsManager +import platform +if platform.system() == "Linux": + import os + hostip = os.popen("cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'").read().replace("\n","") # 回复消息名称 NICKNAME: str = "小真寻" @@ -18,6 +22,7 @@ port: str = "" # 数据库端口 database: str = "" # 数据库名称 # 代理,例如 "http://127.0.0.1:7890" +# 如果是WLS 可以 f"http://{hostip}:7890" 使用寄主机的代理 SYSTEM_PROXY: Optional[str] = None # 全局代理