Merge remote-tracking branch 'refs/remotes/origin/merge/merge' into feat/back-to-front

# Conflicts:
#	src/config/settings.ts
#	src/services/icCoderAuthProvider.ts
This commit is contained in:
XiaoFeng
2026-01-10 19:01:22 +08:00
21 changed files with 1514 additions and 47 deletions

View File

@ -2,6 +2,7 @@ import * as vscode from "vscode";
import * as http from "http";
import * as path from "path";
import * as fs from "fs";
import { onTokenReceived, type UserInfo, clearUserInfo } from "./userService";
import { getConfig } from "../config/settings";
/**
@ -62,13 +63,16 @@ export class ICCoderAuthenticationProvider
try {
const token = await this.login();
// 获取到 token 后立即调用用户信息接口
const userInfo = await onTokenReceived(token);
// 创建会话
const session: vscode.AuthenticationSession = {
id: this.generateSessionId(),
accessToken: token,
account: {
id: "iccoder-user",
label: "IC Coder 用户",
id: userInfo?.userId || "iccoder-user",
label: userInfo?.nickname || userInfo?.username || "IC Coder 用户",
},
scopes: [...scopes],
};
@ -109,6 +113,9 @@ export class ICCoderAuthenticationProvider
this._sessions.splice(sessionIndex, 1);
await this.saveSessions();
// 清除用户信息缓存
await clearUserInfo();
// 触发会话变化事件
this._onDidChangeSessions.fire({
added: [],