feat: refactor deploy command to enhance file upload process and user handling
- Updated the deploy command to include a new username retrieval mechanism, falling back to the organization if not specified. - Introduced uploadFilesV2 function to streamline file upload logic, including hash checking to prevent redundant uploads. - Modified queryAppVersion to accept a create parameter for better version management. - Added a new test file to validate the uploadFilesV2 functionality.
This commit is contained in:
@@ -82,6 +82,22 @@ const loginCommand = new Command('login')
|
||||
|
||||
program.addCommand(loginCommand);
|
||||
|
||||
export const getUsername = async () => {
|
||||
const token = getEnvToken();
|
||||
const localToken = storage.getItem('token');
|
||||
if (!token && !localToken) {
|
||||
console.log('请先登录');
|
||||
return null;
|
||||
}
|
||||
let me = await queryLogin.getMe(localToken || token);
|
||||
if (me?.code === 401) {
|
||||
me = await queryLogin.getMe();
|
||||
}
|
||||
if (me?.code === 200) {
|
||||
return me.data?.username;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
const showMe = async (show = true) => {
|
||||
const token = getEnvToken();
|
||||
const localToken = storage.getItem('token');
|
||||
|
||||
Reference in New Issue
Block a user