zlwu 0cb340ddb1 提交 7 달 전
..
bin 0cb340ddb1 提交 7 달 전
obj 0cb340ddb1 提交 7 달 전
publish 0cb340ddb1 提交 7 달 전
Program.cs 0cb340ddb1 提交 7 달 전
README.md 0cb340ddb1 提交 7 달 전
steamAPI.csproj 0cb340ddb1 提交 7 달 전

README.md

steamAPI

Steam 登录验证本地服务,供客户端调用:使用账号、密码 + maFile 完成 Steam 登录,返回 session、steam_id、cookies 等。

环境要求

启动方式

在项目目录下执行:

cd steam-client/steamAPI
dotnet run
dotnet run --urls "http://localhost:5000"

默认监听 http://localhost:5000(客户端 Tauri 代码中写死为该地址)。

指定端口(可选)

dotnet run --urls "http://localhost:5000"
# 或使用其他端口,例如 5001,同时需修改客户端中 verify_steam_login 的 api_url
dotnet run --urls "http://localhost:5001"

发布为独立可执行文件(Windows x64)

dotnet publish -c Release -r win-x64 --self-contained

输出在 bin/Release/net8.0/win-x64/publish/,可直接运行其中的 steamAPI.exe。

接口说明

  • POST /login
    • Body (JSON): { "Username": "steam用户名", "Password": "密码", "MaFilePath": "maFile 完整路径" }
    • 成功:返回 session(steamId、accessToken、refreshToken、sessionId)及 cookies(含 steamLoginSecure 等)
    • 失败:400/500 + 错误信息

依赖

  • 项目引用同目录下 SteamAuth 及 NuGet 包 SteamKit2、Microsoft.AspNetCore.App。首次运行会自动还原包。