feat: 移除用户信息、余额检查和登录过期提示

- 隐藏用户信息显示和退出登录按钮
   - 删除发送消息前的余额检查逻辑
   - 删除对话完成后的余额更新逻辑
   - 注释掉所有登录过期弹窗提示
   - 移除用户服务和余额服务的初始化调用
This commit is contained in:
Roe-xin
2026-03-09 14:28:41 +08:00
parent 7cde4fa138
commit ad0f0336d5
9 changed files with 118 additions and 516 deletions

View File

@ -2,7 +2,6 @@ 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";
import { resetInvitationVerification } from "./apiClient";
@ -85,7 +84,7 @@ export class ICCoderAuthenticationProvider
const oldSession = this._sessions[0];
this._sessions = [];
await this.saveSessions();
await clearUserInfo();
// await clearUserInfo();
this._onDidChangeSessions.fire({
added: [],
removed: [oldSession],
@ -97,15 +96,15 @@ export class ICCoderAuthenticationProvider
const token = await this.login();
// 获取到 token 后立即调用用户信息接口
const userInfo = await onTokenReceived(token);
// const userInfo = await onTokenReceived(token);
// 创建会话
const session: vscode.AuthenticationSession = {
id: this.generateSessionId(),
accessToken: token,
account: {
id: userInfo?.userId || "iccoder-user",
label: userInfo?.nickname || userInfo?.username || "IC Coder 用户",
id: "user",
label: "IC Coder User",
},
scopes: [...scopes],
};
@ -158,7 +157,7 @@ export class ICCoderAuthenticationProvider
await this.saveSessions();
// 3. 清除用户信息缓存
await clearUserInfo();
// await clearUserInfo();
// 4. 触发会话变化事件
this._onDidChangeSessions.fire({
@ -182,14 +181,14 @@ export class ICCoderAuthenticationProvider
*/
async clearSessionsForRelogin(): Promise<void> {
if (this._sessions.length === 0) {
await clearUserInfo();
// await clearUserInfo();
return;
}
const removed = [...this._sessions];
this._sessions = [];
await this.saveSessions();
await clearUserInfo();
// await clearUserInfo();
this._onDidChangeSessions.fire({
added: [],