diff --git a/Frontend/src/api/shop.ts b/Frontend/src/api/shop.ts index f596eb9d..7230dec6 100644 --- a/Frontend/src/api/shop.ts +++ b/Frontend/src/api/shop.ts @@ -7,6 +7,8 @@ export interface ShopVO { address: string businessHours: string status?: number + coverImageFileId?: string + coverImageUrls?: string[] imageFileIds: string imageUrls?: string[] createTime: string diff --git a/Frontend/src/utils/account.ts b/Frontend/src/utils/account.ts new file mode 100644 index 00000000..2224c2d2 --- /dev/null +++ b/Frontend/src/utils/account.ts @@ -0,0 +1,6 @@ +export const ACCOUNT_REGEX = /^[A-Za-z0-9]+$/ +const ACCOUNT_SANITIZE_REGEX = /[^A-Za-z0-9]/g + +export const ACCOUNT_RULE_MESSAGE = '账号只能包含字母和数字' + +export const sanitizeAccountInput = (value: string) => (value || '').replace(ACCOUNT_SANITIZE_REGEX, '') diff --git a/Frontend/src/views/AuthView.vue b/Frontend/src/views/AuthView.vue index 2ae4effa..adbd9f83 100644 --- a/Frontend/src/views/AuthView.vue +++ b/Frontend/src/views/AuthView.vue @@ -54,6 +54,7 @@ v-model:value="formData.account" placeholder="请输入账号" size="large" + @input="handleAccountInput" @blur="handleRegisterAccountBlur" >