feat: 更新版本号和依赖项,添加获取工作空间 Cookie 的功能,新增测试用例

This commit is contained in:
2026-02-25 16:41:41 +08:00
parent e6042e025f
commit dd691f7a59
7 changed files with 1031 additions and 10 deletions

View File

@@ -16,6 +16,18 @@ export class User extends CNBCore {
useCookie: true,
});
}
/**
* 判断当前 Cookie 是否有效
* @returns
*/
async checkCookieValid(): Promise<Result> {
const user = await this.getCurrentUser();
if (user.code === 200) {
return { code: 200, message: 'cookie valid' };
} else {
return { code: 401, message: 'cookie invalid' };
}
}
/**
* 使用 Token 获取用户信息
* @returns