feat:新增页面退出登录的逻辑

This commit is contained in:
Roe-xin
2026-01-14 18:32:53 +08:00
parent 606f757699
commit 73a1510de4
3 changed files with 48 additions and 6 deletions

View File

@ -157,12 +157,8 @@ export function activate(context: vscode.ExtensionContext) {
try {
const session = await vscode.authentication.getSession("iccoder", [], { createIfNone: false });
if (session) {
// 通过创建新会话并清除偏好来实现登出
await vscode.authentication.getSession("iccoder", [], {
clearSessionPreference: true,
forceNewSession: true
});
vscode.window.showInformationMessage("已退出登录");
// 调用 authProvider 的 removeSession 方法
await authProvider.removeSession(session.id);
} else {
vscode.window.showInformationMessage("当前未登录");
}