init for deploy files
This commit is contained in:
19
src/command/me.ts
Normal file
19
src/command/me.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { app, Command } from '@/app.ts';
|
||||
import { getConfig, writeConfig } from '@/module/index.ts';
|
||||
import {queryMe} from '../route/index.ts';
|
||||
|
||||
|
||||
const command = new Command('me')
|
||||
.description('')
|
||||
.action(async () => {
|
||||
const config = getConfig()
|
||||
const res = await queryMe();
|
||||
if(res.code===200) {
|
||||
console.log('me', res.data)
|
||||
} else {
|
||||
console.log('not login')
|
||||
writeConfig({ ...config, token: '' });
|
||||
}
|
||||
});
|
||||
|
||||
app.addCommand(command);
|
||||
Reference in New Issue
Block a user