feat: clear rollup

This commit is contained in:
2025-04-24 12:42:02 +08:00
parent c2e8818975
commit 6827945446
13 changed files with 285 additions and 361 deletions

View File

@@ -106,8 +106,21 @@ const command = new Command('me')
.action(async (options) => {
try {
let res = await showMe(false);
let isRefresh = false;
if (res.code === 200 && res.data?.accessToken) {
res = await showMe(false);
isRefresh = true;
}
if (res.code === 200) {
if (isRefresh) {
console.log(chalk.green('refresh token success'), '\n');
}
} else {
console.log(
isRefresh ? chalk.red('refresh token failed, please login again.') : chalk.red('you need login first. \n run `envision login` to login'),
'\n',
);
return;
}
const baseURL = getConfig().baseURL;
const pickData = pick(res?.data, ['username', 'type', 'orgs']);