Skip to content

Commit

Permalink
enhance the rule of project name and the check logic of project root (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
NingW101 authored Dec 5, 2023
1 parent ff629e3 commit 019b6a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export const store = createStore<State>({
try {
const result = await webinizer.uploadProjectFile(formData);
commit("setProjAddStatus", result.status);
if (result.path) commit("setRoot", result.path);
if (result.path && result.path !== "undefined") commit("setRoot", result.path);
} catch (error) {
throw error as Error;
}
Expand Down
3 changes: 2 additions & 1 deletion src/views/BasicConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ const formFieldRulesObject = {
if (!value || value.trim()?.length < 0) {
return "The name is required.";
}
if (/^(?:@(?:[a-z0-9-*~][a-z0-9-*._~]*)?\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(value)) {
if (/^(?:@(?:[a-zA-Z0-9-*~][a-z0-9-*._~]*)?\/)?[a-zA-Z0-9-~][a-zA-Z0-9-._~]*$/.test(value)) {
return true;
} else {
return "The name format is not correct. It should not contain special characters, such as space, \\, *, etc. If you want to connect multiple words, use a hyphen (-) instead.";
Expand Down Expand Up @@ -883,6 +883,7 @@ async function uploadProjectFile() {
}
} catch (error) {
store.commit("setProjAddStatus", ProjectAddStatus.done);
refUploadProgress.value = 0;
log.errMsgNCuz(error);
return;
}
Expand Down

0 comments on commit 019b6a8

Please sign in to comment.