fix: update login error
This commit is contained in:
@@ -65,7 +65,10 @@ const loginCommand = new Command('login')
|
||||
program.addCommand(loginCommand);
|
||||
|
||||
const showMe = async (show = true) => {
|
||||
const me = await queryLogin.getMe();
|
||||
let me = await queryLogin.getMe();
|
||||
if (me.code === 401) {
|
||||
me = await queryLogin.getMe();
|
||||
}
|
||||
if (show) {
|
||||
console.log('Me', me.data);
|
||||
}
|
||||
@@ -84,7 +87,12 @@ const switchOrgCommand = new Command('switch').argument('<username>', 'Switch to
|
||||
program.addCommand(switchOrgCommand);
|
||||
|
||||
const command = new Command('me').description('').action(async () => {
|
||||
await showMe();
|
||||
try {
|
||||
const res = await showMe(false);
|
||||
console.log('me', res?.data);
|
||||
} catch (error) {
|
||||
console.log('me error', error);
|
||||
}
|
||||
});
|
||||
|
||||
program.addCommand(command);
|
||||
|
||||
Reference in New Issue
Block a user