From 8c5170cb7e33f6eefb888e7b4be9cf40b47b27ea Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 11 Sep 2026 15:27:20 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E6=89=8B=E6=9C=BA=E5=8F=B7=E4=B8=8E=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WechatMiniAuthServiceImpl.java | 21 ++------ .../vo/WechatMiniLoginResultVO.java | 22 +++++++++ .../WorkbenchRegistrationServiceImpl.java | 11 +++-- .../modules/user/service/UserService.java | 2 + .../user/service/impl/UserServiceImpl.java | 21 ++++++-- JC-Salon-WeChat/api/auth.js | 18 +++++++ JC-Salon-WeChat/pages/login/index.js | 49 ++++++++++++++++++- JC-Salon-WeChat/pages/login/index.wxml | 6 +-- 8 files changed, 121 insertions(+), 29 deletions(-) diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java index 54b455cd..e97e1921 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/WechatMiniAuthServiceImpl.java @@ -155,25 +155,12 @@ public class WechatMiniAuthServiceImpl implements WechatMiniAuthService { UserDO phoneUser = findActiveUserByPhone(phone); if (phoneUser != null) { - /** - * Run business method `assertUserAvailable`. - * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. - * @param phoneUser parameter `phoneUser` supplied by the caller - * @return result consumed by the caller or returned to the frontend - */ - assertUserAvailable(phoneUser); + if (userShopBindingSupport.listActiveShopIdsByUserId(phoneUser.getId()).isEmpty()) { + return WechatMiniLoginResultVO.registrationRequired(userService.phoneLoginByVerifiedPhone(phone)); + } return loginOrSelectShop(phoneUser, normalizeShopId(requestDTO.getPreferredShopId()), sessionInfo, false); } - - List shops = userShopBindingSupport.listAllActiveShopOptions(); - if (shops.isEmpty()) { - return WechatMiniLoginResultVO.needManualLogin("当前暂无可登录门店,请稍后再试。"); - } - return buildSelectShopResult( - "首次使用微信手机号一键登录,请先选择本次登录门店。", - shops, - new TicketPayload(null, phone, sessionInfo.openId(), sessionInfo.unionId(), true) - ); + return WechatMiniLoginResultVO.registrationRequired(userService.phoneLoginByVerifiedPhone(phone)); } @Override diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/vo/WechatMiniLoginResultVO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/vo/WechatMiniLoginResultVO.java index f67196f4..21c11d67 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/vo/WechatMiniLoginResultVO.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/vo/WechatMiniLoginResultVO.java @@ -65,6 +65,14 @@ public class WechatMiniLoginResultVO { */ private Boolean needSetPassword; + private Boolean registrationRequired; + private String registrationTicket; + private String phone; + private String registrationReason; + private String registrationStatus; + private String registrationRejectReason; + private Long registrationApplicationId; + /** * Purpose: success supports WechatMiniLoginResultVO.java by holding or executing the success business role. * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. @@ -81,6 +89,20 @@ public class WechatMiniLoginResultVO { return resultVO; } + public static WechatMiniLoginResultVO registrationRequired(LoginResponseVO loginResponse) { + WechatMiniLoginResultVO resultVO = new WechatMiniLoginResultVO(); + resultVO.setStatus(STATUS_NEED_MANUAL_LOGIN); + resultVO.setMessage("手机号尚未绑定店铺,请先完成身份注册"); + resultVO.setRegistrationRequired(true); + resultVO.setRegistrationTicket(loginResponse.getRegistrationTicket()); + resultVO.setPhone(loginResponse.getPhone()); + resultVO.setRegistrationReason(loginResponse.getRegistrationReason()); + resultVO.setRegistrationStatus(loginResponse.getRegistrationStatus()); + resultVO.setRegistrationRejectReason(loginResponse.getRegistrationRejectReason()); + resultVO.setRegistrationApplicationId(loginResponse.getRegistrationApplicationId()); + return resultVO; + } + public static WechatMiniLoginResultVO selectShop( String message, String ticket, diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java index 59152247..f6de4ad7 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/registration/service/impl/WorkbenchRegistrationServiceImpl.java @@ -91,8 +91,13 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe } else { require(existing == null, "该手机号已注册,请直接登录或查看审核状态"); } - require(StringUtils.hasText(request.getPassword()), "密码不能为空"); - require(request.getPassword().equals(request.getConfirmPassword()), "两次密码不一致"); + boolean passwordProvided = StringUtils.hasText(request.getPassword()) || StringUtils.hasText(request.getConfirmPassword()); + if (ticket == null) { + require(passwordProvided, "密码不能为空"); + } + if (passwordProvided) { + require(request.getPassword().equals(request.getConfirmPassword()), "两次密码不一致"); + } ShopDO shop = null; if (WorkbenchRegistrationRole.MANAGER.equals(roleType)) { @@ -115,7 +120,7 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe user.setShopId(shop.getId()); user.setNickname((WorkbenchRegistrationRole.MANAGER.equals(roleType) ? shop.getShopName() + "店长" : "Salon店员")); user.setAccount(phone); - user.setPassword(passwordEncoder.encode(request.getPassword())); + user.setPassword(passwordProvided ? passwordEncoder.encode(request.getPassword()) : "$2a$10$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW"); user.setPhone(phone); user.setContactPhone(phone); user.setPhoneVerified(1); diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/UserService.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/UserService.java index dcc2cf36..09efb837 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/UserService.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/UserService.java @@ -106,6 +106,8 @@ public interface UserService extends IService { */ LoginResponseVO phoneLogin(PhoneLoginRequestDTO phoneLoginRequestDTO); + LoginResponseVO phoneLoginByVerifiedPhone(String phone); + /** * Run the login flow. * Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result. diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java index 97109894..44fb9e54 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java @@ -1074,23 +1074,34 @@ public class UserServiceImpl extends ServiceImpl implements throw new RuntimeException("验证码错误或已过期"); } + return phoneLoginByVerifiedPhone(phoneLoginRequestDTO.getPhone(), phoneLoginRequestDTO.getShopId(), Boolean.TRUE.equals(phoneLoginRequestDTO.getRememberMe())); + } + + @Override + public LoginResponseVO phoneLoginByVerifiedPhone(String phone) { + return phoneLoginByVerifiedPhone(phone, null, false); + } + + private LoginResponseVO phoneLoginByVerifiedPhone(String phone, Long shopId, boolean rememberMe) { + String normalizedPhone = validateUserPhone(phone, null, true); + UserDO userDO = userMapper.selectOne( Wrappers.lambdaQuery(UserDO.class) - .eq(UserDO::getPhone, phoneLoginRequestDTO.getPhone()) + .eq(UserDO::getPhone, normalizedPhone) .eq(UserDO::getIsDelete, 0) ); if (userDO == null) { - return buildRegistrationRequiredResponse(phoneLoginRequestDTO.getPhone(), null, "PHONE_NOT_REGISTERED"); + return buildRegistrationRequiredResponse(normalizedPhone, null, "PHONE_NOT_REGISTERED"); } if (userShopBindingSupport.listActiveShopIdsByUserId(userDO.getId()).isEmpty()) { - return buildRegistrationRequiredResponse(phoneLoginRequestDTO.getPhone(), userDO, "NO_SHOP_BINDING"); + return buildRegistrationRequiredResponse(normalizedPhone, userDO, "NO_SHOP_BINDING"); } assertUserAvailable(userDO); clearLoginFailureCount(userDO.getAccount()); - Long resolvedShopId = resolveUserLoginShopId(userDO, phoneLoginRequestDTO.getShopId()); - return buildLoginResponse(userDO, resolvedShopId, ENCODED_UNSET_PASSWORD.equals(userDO.getPassword()), Boolean.TRUE.equals(phoneLoginRequestDTO.getRememberMe())); + Long resolvedShopId = resolveUserLoginShopId(userDO, shopId); + return buildLoginResponse(userDO, resolvedShopId, ENCODED_UNSET_PASSWORD.equals(userDO.getPassword()), rememberMe); } private LoginResponseVO buildRegistrationRequiredResponse(String phone, UserDO userDO, String reason) { diff --git a/JC-Salon-WeChat/api/auth.js b/JC-Salon-WeChat/api/auth.js index cde9398a..54567343 100644 --- a/JC-Salon-WeChat/api/auth.js +++ b/JC-Salon-WeChat/api/auth.js @@ -99,6 +99,24 @@ module.exports = { }) }, + wechatPhoneLogin(data) { + return request({ + url: '/user/wechat-mini/phone-login', + method: 'POST', + params: { __baseUrl: API_DOMAIN }, + data + }) + }, + + wechatConfirmLogin(data) { + return request({ + url: '/user/wechat-mini/confirm-login', + method: 'POST', + params: { __baseUrl: API_DOMAIN }, + data + }) + }, + getPhoneLoginShops(phone) { return request({ url: `/user/check/login-shops/phone/${encodeURIComponent(phone)}`, diff --git a/JC-Salon-WeChat/pages/login/index.js b/JC-Salon-WeChat/pages/login/index.js index 19301dca..3c49eae8 100644 --- a/JC-Salon-WeChat/pages/login/index.js +++ b/JC-Salon-WeChat/pages/login/index.js @@ -101,7 +101,8 @@ Page({ shopSelectVisible: false, shopSelectMode: '', shopOptions: [], - switchingShop: false + switchingShop: false, + wechatLoginTicket: '' }, onLoad() { @@ -291,6 +292,7 @@ Page({ const query = [ `registrationTicket=${encodeURIComponent(ticket)}`, `phone=${encodeURIComponent(data.phone || this.data.form.phone || '')}`, + data.wxCode ? `wxCode=${encodeURIComponent(data.wxCode)}` : '', data.registrationApplicationId ? `applicationId=${encodeURIComponent(data.registrationApplicationId)}` : '' ].filter(Boolean).join('&') setTimeout(() => wx.navigateTo({ url: `/pages/register/index?${query}` }), 700) @@ -382,6 +384,8 @@ Page({ try { if (this.data.shopSelectMode === 'login') { await this.loginWithSelectedShop(shopId) + } else if (this.data.shopSelectMode === 'wechat') { + await this.loginWithWechatSelectedShop(shopId) } else { await this.switchSelectedShop(shopId) } @@ -409,6 +413,16 @@ Page({ wx.reLaunch({ url: '/pages/planning/index' }) }, + async loginWithWechatSelectedShop(shopId) { + const result = await authApi.wechatConfirmLogin({ ticket: this.data.wechatLoginTicket, shopId, ...this.buildAgreementPayload() }) + if (result.status !== 'SUCCESS' || !result.accessToken) { + throw new Error(result.message || '进入店铺失败') + } + getApp().setSession(result) + this.closeShopSelector() + wx.reLaunch({ url: '/pages/planning/index' }) + }, + startCountdown() { if (this.data.countdownTimer) { clearInterval(this.data.countdownTimer) @@ -531,5 +545,38 @@ Page({ } catch (error) { wx.showToast({ title: error.message || '微信快捷登录失败', icon: 'none' }) } + }, + + async wechatPhoneLogin(event) { + if (this.data.loading || !this.ensureAgreementAccepted()) { + return + } + const phoneCode = event && event.detail && event.detail.code + if (!phoneCode) { + wx.showToast({ title: '需要授权手机号后才能登录', icon: 'none' }) + return + } + this.setData({ loading: true }) + try { + const wxCode = await this.getWechatCode() + const result = await authApi.wechatPhoneLogin({ wxCode, phoneCode, ...this.buildAgreementPayload() }) + if (result.registrationRequired) { + this.openRegistrationFlow({ ...result, wxCode }) + return + } + if (result.status === 'SELECT_SHOP') { + this.setData({ shopOptions: buildShopOptionsFromSelection(result), shopSelectVisible: true, shopSelectMode: 'wechat', wechatLoginTicket: result.ticket, switchingShop: false }) + return + } + if (result.status !== 'SUCCESS' || !result.accessToken) { + throw new Error(result.message || '微信手机号登录暂不可用') + } + getApp().setSession(result) + wx.reLaunch({ url: '/pages/planning/index' }) + } catch (error) { + wx.showToast({ title: error.message || '微信手机号登录失败', icon: 'none' }) + } finally { + this.setData({ loading: false }) + } } }) diff --git a/JC-Salon-WeChat/pages/login/index.wxml b/JC-Salon-WeChat/pages/login/index.wxml index 31fa87ab..f95afb5f 100644 --- a/JC-Salon-WeChat/pages/login/index.wxml +++ b/JC-Salon-WeChat/pages/login/index.wxml @@ -23,12 +23,12 @@ 手机号 - + 验证码 - + + From e9a2e74b91d3a2ddf7d03a6279c51598ac67da7f Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 11 Sep 2026 15:31:33 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=B7=B2=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=99=BB=E5=BD=95=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/user/service/impl/UserServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java index 44fb9e54..6e4686e7 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/user/service/impl/UserServiceImpl.java @@ -1083,7 +1083,7 @@ public class UserServiceImpl extends ServiceImpl implements } private LoginResponseVO phoneLoginByVerifiedPhone(String phone, Long shopId, boolean rememberMe) { - String normalizedPhone = validateUserPhone(phone, null, true); + String normalizedPhone = normalizeVerifiedPhone(phone); UserDO userDO = userMapper.selectOne( Wrappers.lambdaQuery(UserDO.class) @@ -1104,6 +1104,14 @@ public class UserServiceImpl extends ServiceImpl implements return buildLoginResponse(userDO, resolvedShopId, ENCODED_UNSET_PASSWORD.equals(userDO.getPassword()), rememberMe); } + private String normalizeVerifiedPhone(String phone) { + String normalizedPhone = phone == null ? null : phone.trim(); + if (!StringUtils.hasText(normalizedPhone) || !normalizedPhone.matches(PHONE_REGEX)) { + throw new RuntimeException("手机号格式不正确"); + } + return normalizedPhone; + } + private LoginResponseVO buildRegistrationRequiredResponse(String phone, UserDO userDO, String reason) { WorkbenchRegistrationApplicationDO application = userDO == null ? null : registrationApplicationMapper.selectOne( Wrappers.lambdaQuery(WorkbenchRegistrationApplicationDO.class) From 2ebaaeec771f1cf1b113ccfc9fd46bbe1404fa67 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 11 Sep 2026 15:35:41 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=BB=91=E5=AE=9A=E5=87=AD=E8=AF=81=E6=97=B6?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-WeChat/pages/register/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/JC-Salon-WeChat/pages/register/index.js b/JC-Salon-WeChat/pages/register/index.js index e32fc289..a382d147 100644 --- a/JC-Salon-WeChat/pages/register/index.js +++ b/JC-Salon-WeChat/pages/register/index.js @@ -71,13 +71,19 @@ Page({ goBackStep() { this.setData({ step: Math.max(1, this.data.step - 1) }) }, + async getCurrentWxCode() { + const result = await new Promise((resolve, reject) => wx.login({ success: resolve, fail: reject })) + return result.code + }, + async submit() { const form = this.data.form if (this.data.role === 'manager' && !String(form.shopName || '').trim()) { wx.showToast({ title: '请输入店铺名称', icon: 'none' }); return } if (this.data.role === 'staff' && !form.shopId) { wx.showToast({ title: '请选择要加入的店铺', icon: 'none' }); return } this.setData({ loading: true }) try { - await authApi.register({ phone: form.phone, verificationCode: this.data.registrationTicket ? undefined : form.code, registrationTicket: this.data.registrationTicket || undefined, applicationId: this.data.applicationId || undefined, password: form.password, confirmPassword: form.confirmPassword, shopName: form.shopName, shopAddress: form.shopAddress, shopId: form.shopId, roleType: this.data.role === 'manager' ? 'MANAGER' : 'STAFF', agreementAccepted: true, wxCode: this.data.wxCode }) + const wxCode = this.data.registrationTicket ? await this.getCurrentWxCode() : this.data.wxCode + await authApi.register({ phone: form.phone, verificationCode: this.data.registrationTicket ? undefined : form.code, registrationTicket: this.data.registrationTicket || undefined, applicationId: this.data.applicationId || undefined, password: form.password, confirmPassword: form.confirmPassword, shopName: form.shopName, shopAddress: form.shopAddress, shopId: form.shopId, roleType: this.data.role === 'manager' ? 'MANAGER' : 'STAFF', agreementAccepted: true, wxCode }) this.setData({ step: 4 }) } catch (error) { wx.showToast({ title: error.message || '提交失败', icon: 'none' }) } finally { this.setData({ loading: false }) } }, From 381dad1fed673b4ce7e21afad9b45d9f65b6bfab Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Fri, 11 Sep 2026 16:11:24 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=E8=B7=B3=E8=BD=AC404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-Frontend/src/config/admin-navigation.test.ts | 2 +- JC-Salon-Frontend/src/config/admin-navigation.ts | 2 +- JC-Salon-Frontend/src/views/admin/ManageView.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/JC-Salon-Frontend/src/config/admin-navigation.test.ts b/JC-Salon-Frontend/src/config/admin-navigation.test.ts index dcfb3804..db26d732 100644 --- a/JC-Salon-Frontend/src/config/admin-navigation.test.ts +++ b/JC-Salon-Frontend/src/config/admin-navigation.test.ts @@ -3,7 +3,7 @@ import { adminNavigationItems, adminPermissionRouteMap, findAdminNavigationItemB describe('admin-navigation', () => { it('keeps dashboard landing and permission routes aligned', () => { - expect(ADMIN_DASHBOARD_PATH).toBe('/admin/dashboard') + expect(ADMIN_DASHBOARD_PATH).toBe('/admin') expect(findAdminNavigationItemByPath('/admin/shops')?.label).toBe('店铺管理') expect(findAdminNavigationItemByPath('/admin/products')).toBeUndefined() expect(adminPermissionRouteMap.some(item => item.code === 'shop:view' && item.path === '/admin/shops')).toBe(true) diff --git a/JC-Salon-Frontend/src/config/admin-navigation.ts b/JC-Salon-Frontend/src/config/admin-navigation.ts index 8fe6010e..dcae102d 100644 --- a/JC-Salon-Frontend/src/config/admin-navigation.ts +++ b/JC-Salon-Frontend/src/config/admin-navigation.ts @@ -20,7 +20,7 @@ export interface AdminNavigationItem { } export const ADMIN_HOME_PATH = '/admin' -export const ADMIN_DASHBOARD_PATH = '/admin/dashboard' +export const ADMIN_DASHBOARD_PATH = ADMIN_HOME_PATH export const adminNavigationItems: AdminNavigationItem[] = [ { path: ADMIN_HOME_PATH, iconKey: 'home', label: '首页', permissionCode: '' }, diff --git a/JC-Salon-Frontend/src/views/admin/ManageView.vue b/JC-Salon-Frontend/src/views/admin/ManageView.vue index c4012d4b..39cd3964 100644 --- a/JC-Salon-Frontend/src/views/admin/ManageView.vue +++ b/JC-Salon-Frontend/src/views/admin/ManageView.vue @@ -91,7 +91,7 @@ const visibleModules = computed(() => { key: 'dashboard', title: '仪表盘', description: '查看经营概览、近期动态和重点提醒。', - path: '/admin/dashboard', + path: '/admin', icon: DashboardOutlined, permissionCode: 'dashboard:view' }, From d2d17cef9381f3a6111cc7fca3877c4dbca9c87b Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 14 Sep 2026 10:14:26 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0SIT=E9=87=8D=E5=BB=BA?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/salon-sit-deploy.yml | 4 ++-- docs/scripts/Salon SIT自动发布配置说明_20260901.md | 8 ++++---- .../sit/jayucloud-artlist/DEFAULT_GROUP/core.yaml | 2 +- .../sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml | 6 +++--- .../sit/jayucloud-salon/DEFAULT_GROUP/core.yaml | 4 ++-- .../sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/salon-sit-deploy.yml b/.gitea/workflows/salon-sit-deploy.yml index 8c0abafe..1fd0eb54 100644 --- a/.gitea/workflows/salon-sit-deploy.yml +++ b/.gitea/workflows/salon-sit-deploy.yml @@ -72,7 +72,7 @@ jobs: mkdir -p "$RUNNER_TEMP/salon-sit" cat > "$RUNNER_TEMP/salon-sit/servers.json" < Date: Mon, 14 Sep 2026 16:35:44 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSIT=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E6=B5=8B=E8=AF=95=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/scripts/deploy-jayucloud-salon-production.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scripts/deploy-jayucloud-salon-production.ps1 b/docs/scripts/deploy-jayucloud-salon-production.ps1 index 7c36be8b..31fbf3f2 100644 --- a/docs/scripts/deploy-jayucloud-salon-production.ps1 +++ b/docs/scripts/deploy-jayucloud-salon-production.ps1 @@ -569,7 +569,7 @@ function Build-ReleasePackage { if (-not $SkipBuild) { $mavenArgs = @("-B", "package") if ($SkipTests) { - $mavenArgs += "-DskipTests" + $mavenArgs += "-Dmaven.test.skip=true" } Write-Step "构建 JC-Salon-Core" From 672cd936fec03cb3509aa40aeb2171abfbd6669f Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 14 Sep 2026 22:09:00 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSIT=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E6=8E=A5=E5=8F=A3=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-Gateway/src/main/resources/application.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JC-Salon-Gateway/src/main/resources/application.yaml b/JC-Salon-Gateway/src/main/resources/application.yaml index 278b327a..3231cd14 100644 --- a/JC-Salon-Gateway/src/main/resources/application.yaml +++ b/JC-Salon-Gateway/src/main/resources/application.yaml @@ -109,6 +109,14 @@ spring: - Path=/admin/api/** filters: - RewritePath=/admin/api/(?.*), /admin/${remaining} + # 工作台注册审核接口实际位于 Core 的 /user/workbench 路径 + - id: admin-workbench-registration-route + order: -10 + uri: lb://jc-salon-core + predicates: + - Path=/admin/api/user/workbench/registration/** + filters: + - RewritePath=/admin/api/user/workbench/registration/(?.*), /user/workbench/registration/${remaining} - id: admin-auth-compat-route order: -8 uri: lb://jc-salon-core From 7b68ef32e197bdbf711c40eeec0d3a93a898d325 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Tue, 15 Sep 2026 20:47:33 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSIT=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml index 975edb3d..103d3528 100644 --- a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml +++ b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml @@ -92,7 +92,7 @@ fingertip-designer: messagehub: client: - base-url: ${MESSAGEHUB_BASE_URL:http://127.0.0.1:8080} + base-url: ${MESSAGEHUB_BASE_URL:http://192.168.10.16:8080} access-token: ${MESSAGEHUB_ACCESS_TOKEN:} ingress-exchange: ${MESSAGEHUB_INGRESS_EXCHANGE:messagehub.ingress.exchange} ingress-routing-key: ${MESSAGEHUB_INGRESS_ROUTING_KEY:message.send} From 0c827782ff3fa1e42a07f0625f3313e41cf6d8a4 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Tue, 15 Sep 2026 23:42:20 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSalon=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MessageHubClientServiceImpl.java | 6 +-- docs/scripts/sql/init/jayucloud-salon.sql | 12 +++--- .../短信模板编码统一修复_20260915.sql | 39 +++++++++++++++++++ 3 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 docs/scripts/sql/短信模板编码统一修复_20260915/短信模板编码统一修复_20260915.sql diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/MessageHubClientServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/MessageHubClientServiceImpl.java index 3a401a35..4b8d6095 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/MessageHubClientServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/integration/service/impl/MessageHubClientServiceImpl.java @@ -26,9 +26,9 @@ import java.util.HashMap; import java.util.Map; /** - * FingertipDesigner 到 MessageHub 的投递客户端。 + * Salon 到 MessageHub 的投递客户端。 * - *

FingertipDesigner 只决定某个业务场景使用哪组 MessageHub 对接参数,不直接连接 Spug、 + *

Salon 只决定某个业务场景使用哪组 MessageHub 对接参数,不直接连接 Spug、 * 阿里云等短信供应商。真实通道选择和供应商密钥仍归 MessageHub 管理。

*/ @Slf4j @@ -80,7 +80,7 @@ public class MessageHubClientServiceImpl implements MessageHubClientService { */ private String sourceSystem; - @Value("${messagehub.client.verify-template-code:SPUG0001}") + @Value("${messagehub.client.verify-template-code:SPUG_SMS_VERIFY_1}") /** * Purpose: verifyTemplateCode supports MessageHubClientServiceImpl.java by holding or executing the verify template code business role. * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. diff --git a/docs/scripts/sql/init/jayucloud-salon.sql b/docs/scripts/sql/init/jayucloud-salon.sql index c6178509..73b27321 100644 --- a/docs/scripts/sql/init/jayucloud-salon.sql +++ b/docs/scripts/sql/init/jayucloud-salon.sql @@ -2103,12 +2103,12 @@ INSERT INTO t_messagehub_push_config ( is_delete ) VALUES - (313931273555137001, 'USER_REGISTER_SMS_CODE', '用户注册验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG0001', NULL, 'SPUG', 1, '注册功能发送验证码时使用', NOW(), NOW(), 0), - (313931273555137002, 'USER_LOGIN_SMS_CODE', '手机号登录验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG0001', NULL, 'SPUG', 1, '手机号验证码登录时使用', NOW(), NOW(), 0), - (313931273555137003, 'USER_RESET_PASSWORD_SMS_CODE', '找回密码验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG0001', NULL, 'SPUG', 1, '找回密码时使用', NOW(), NOW(), 0), - (313931273555137004, 'USER_BIND_PHONE_SMS_CODE', '绑定手机号验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG0001', NULL, 'SPUG', 1, '绑定手机号时使用', NOW(), NOW(), 0), - (313931273555137005, 'USER_CHANGE_PHONE_SMS_CODE', '修改手机号验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG0001', NULL, 'SPUG', 1, '修改手机号时使用', NOW(), NOW(), 0), - (313931273555137006, 'USER_CHANGE_PASSWORD_SMS_CODE', '修改密码验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG0001', NULL, 'SPUG', 1, '修改密码时使用', NOW(), NOW(), 0) + (313931273555137001, 'USER_REGISTER_SMS_CODE', '用户注册验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG_SMS_VERIFY_1', NULL, 'SPUG', 1, '注册功能发送验证码时使用', NOW(), NOW(), 0), + (313931273555137002, 'USER_LOGIN_SMS_CODE', '手机号登录验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG_SMS_VERIFY_1', NULL, 'SPUG', 1, '手机号验证码登录时使用', NOW(), NOW(), 0), + (313931273555137003, 'USER_RESET_PASSWORD_SMS_CODE', '找回密码验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG_SMS_VERIFY_1', NULL, 'SPUG', 1, '找回密码时使用', NOW(), NOW(), 0), + (313931273555137004, 'USER_BIND_PHONE_SMS_CODE', '绑定手机号验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG_SMS_VERIFY_1', NULL, 'SPUG', 1, '绑定手机号时使用', NOW(), NOW(), 0), + (313931273555137005, 'USER_CHANGE_PHONE_SMS_CODE', '修改手机号验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG_SMS_VERIFY_1', NULL, 'SPUG', 1, '修改手机号时使用', NOW(), NOW(), 0), + (313931273555137006, 'USER_CHANGE_PASSWORD_SMS_CODE', '修改密码验证码', 'SMS', 'VERIFICATION', 'smsQueue', 'jayucloud-salon', 'SPUG_SMS_VERIFY_1', NULL, 'SPUG', 1, '修改密码时使用', NOW(), NOW(), 0) ON DUPLICATE KEY UPDATE scene_name = VALUES(scene_name), platform = VALUES(platform), diff --git a/docs/scripts/sql/短信模板编码统一修复_20260915/短信模板编码统一修复_20260915.sql b/docs/scripts/sql/短信模板编码统一修复_20260915/短信模板编码统一修复_20260915.sql new file mode 100644 index 00000000..c85a19ac --- /dev/null +++ b/docs/scripts/sql/短信模板编码统一修复_20260915/短信模板编码统一修复_20260915.sql @@ -0,0 +1,39 @@ +-- Salon Spug 短信模板编码统一修复 +-- 版本:0.0.1 +-- 说明:将店务端六个短信验证码场景统一映射到当前 Spug 模板 SPUG_SMS_VERIFY_1。 + +START TRANSACTION; + +UPDATE t_messagehub_push_config +SET template_code = 'SPUG_SMS_VERIFY_1', + channel_id = NULL, + send_method = 'SPUG', + enabled = 1, + is_delete = 0, + update_time = NOW() +WHERE platform = 'SMS' + AND source_system = 'jayucloud-salon' + AND scene_code IN ( + 'USER_REGISTER_SMS_CODE', + 'USER_LOGIN_SMS_CODE', + 'USER_RESET_PASSWORD_SMS_CODE', + 'USER_BIND_PHONE_SMS_CODE', + 'USER_CHANGE_PHONE_SMS_CODE', + 'USER_CHANGE_PASSWORD_SMS_CODE' + ); + +COMMIT; + +SELECT scene_code, template_code, channel_id, send_method, enabled, is_delete +FROM t_messagehub_push_config +WHERE platform = 'SMS' + AND source_system = 'jayucloud-salon' + AND scene_code IN ( + 'USER_REGISTER_SMS_CODE', + 'USER_LOGIN_SMS_CODE', + 'USER_RESET_PASSWORD_SMS_CODE', + 'USER_BIND_PHONE_SMS_CODE', + 'USER_CHANGE_PHONE_SMS_CODE', + 'USER_CHANGE_PASSWORD_SMS_CODE' + ) +ORDER BY scene_code; From e8e8e5a40414b8ff90045253aa5997ba198e56ef Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Wed, 16 Sep 2026 09:22:30 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E6=A0=A1=E9=AA=8C=E5=92=8C=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/VerificationCodeServiceImpl.java | 3 +-- JC-Salon-WeChat/pages/appointment-form/index.js | 4 ++++ JC-Salon-WeChat/pages/appointment-form/index.wxml | 2 +- JC-Salon-WeChat/pages/customers/index.js | 4 ++++ JC-Salon-WeChat/pages/customers/index.wxml | 2 +- JC-Salon-WeChat/pages/employees/index.js | 4 ++++ JC-Salon-WeChat/pages/employees/index.wxml | 2 +- JC-Salon-WeChat/pages/login/index.js | 8 +++++++- JC-Salon-WeChat/pages/profile/index.js | 7 ++++++- JC-Salon-WeChat/pages/profile/index.wxml | 2 +- JC-Salon-WeChat/pages/register/index.js | 14 ++++++++++++-- JC-Salon-WeChat/pages/register/index.wxml | 4 ++-- 12 files changed, 44 insertions(+), 12 deletions(-) diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/auth/service/impl/VerificationCodeServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/auth/service/impl/VerificationCodeServiceImpl.java index 37017c0c..b15c35bd 100644 --- a/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/auth/service/impl/VerificationCodeServiceImpl.java +++ b/JC-Salon-Core/src/main/java/com/xiaowang/jacyucloudsalon/core/modules/auth/service/impl/VerificationCodeServiceImpl.java @@ -97,11 +97,10 @@ public class VerificationCodeServiceImpl implements VerificationCodeService { String codeKey = CODE_PREFIX + phone; String sendTimeKey = SEND_TIME_PREFIX + phone; + messageHubClientService.sendSmsVerificationCode(sceneCode, phone, code); redisTemplate.opsForValue().set(codeKey, code, Duration.ofMinutes(CODE_EXPIRE_MINUTES)); redisTemplate.opsForValue().set(sendTimeKey, String.valueOf(System.currentTimeMillis()), Duration.ofSeconds(RESEND_INTERVAL_SECONDS)); - - messageHubClientService.sendSmsVerificationCode(sceneCode, phone, code); log.info("验证码已发送,手机号: {}, sceneCode: {}", phone, sceneCode); } diff --git a/JC-Salon-WeChat/pages/appointment-form/index.js b/JC-Salon-WeChat/pages/appointment-form/index.js index e414f937..a027f887 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.js +++ b/JC-Salon-WeChat/pages/appointment-form/index.js @@ -693,6 +693,10 @@ Page({ wx.showToast({ title: '请补全预约信息', icon: 'none' }) return } + if (!/^1[3-9]\d{9}$/.test(String(form.phone).trim())) { + wx.showToast({ title: '请输入正确手机号', icon: 'none' }) + return + } if (!durationMinutes) { wx.showToast({ title: '请填写预约时长', icon: 'none' }) return diff --git a/JC-Salon-WeChat/pages/appointment-form/index.wxml b/JC-Salon-WeChat/pages/appointment-form/index.wxml index a725d8fe..47fa1bc3 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.wxml +++ b/JC-Salon-WeChat/pages/appointment-form/index.wxml @@ -7,7 +7,7 @@
手机号 - + 正在搜索客户... diff --git a/JC-Salon-WeChat/pages/customers/index.js b/JC-Salon-WeChat/pages/customers/index.js index cb5468c5..0d140be2 100644 --- a/JC-Salon-WeChat/pages/customers/index.js +++ b/JC-Salon-WeChat/pages/customers/index.js @@ -85,6 +85,10 @@ Page({ wx.showToast({ title: '请填写客户姓名和手机号', icon: 'none' }) return } + if (!/^1[3-9]\d{9}$/.test(phone)) { + wx.showToast({ title: '请输入正确手机号', icon: 'none' }) + return + } this.setData({ creating: true }) try { await customersApi.create({ nickname, phone }) diff --git a/JC-Salon-WeChat/pages/customers/index.wxml b/JC-Salon-WeChat/pages/customers/index.wxml index c853c402..369c52f4 100644 --- a/JC-Salon-WeChat/pages/customers/index.wxml +++ b/JC-Salon-WeChat/pages/customers/index.wxml @@ -35,7 +35,7 @@ 手机号 - +
diff --git a/JC-Salon-WeChat/pages/employees/index.js b/JC-Salon-WeChat/pages/employees/index.js index 417c9c61..d351c82f 100644 --- a/JC-Salon-WeChat/pages/employees/index.js +++ b/JC-Salon-WeChat/pages/employees/index.js @@ -161,6 +161,10 @@ Page({ wx.showToast({ title: '请补全美甲师信息', icon: 'none' }) return } + if (!/^1[3-9]\d{9}$/.test(phone)) { + wx.showToast({ title: '请输入正确手机号', icon: 'none' }) + return + } this.setData({ creating: true }) try { await employeesApi.createUser({ diff --git a/JC-Salon-WeChat/pages/employees/index.wxml b/JC-Salon-WeChat/pages/employees/index.wxml index af3f16dc..8ae50780 100644 --- a/JC-Salon-WeChat/pages/employees/index.wxml +++ b/JC-Salon-WeChat/pages/employees/index.wxml @@ -49,7 +49,7 @@
手机号 - + 登录账号 diff --git a/JC-Salon-WeChat/pages/login/index.js b/JC-Salon-WeChat/pages/login/index.js index 3c49eae8..15c766bf 100644 --- a/JC-Salon-WeChat/pages/login/index.js +++ b/JC-Salon-WeChat/pages/login/index.js @@ -121,8 +121,11 @@ Page({ onInput(event) { const field = event.currentTarget.dataset.field + const value = field === 'phone' + ? String(event.detail.value || '').replace(/\D/g, '').slice(0, 11) + : event.detail.value this.setData({ - [`form.${field}`]: event.detail.value + [`form.${field}`]: value }) }, @@ -135,6 +138,9 @@ Page({ }, async sendLoginCode() { + if (!this.ensureAgreementAccepted()) { + return + } const phone = String(this.data.form.phone || '').trim() if (!PHONE_REGEX.test(phone)) { wx.showToast({ title: '请输入正确手机号', icon: 'none' }) diff --git a/JC-Salon-WeChat/pages/profile/index.js b/JC-Salon-WeChat/pages/profile/index.js index 0f48b262..f2f0242d 100644 --- a/JC-Salon-WeChat/pages/profile/index.js +++ b/JC-Salon-WeChat/pages/profile/index.js @@ -220,6 +220,11 @@ Page({ async saveProfile() { const form = this.data.profileForm const nickname = String(form.nickname || '').trim() + const contactPhone = String(form.contactPhone || '').trim() + if (contactPhone && !/^1[3-9]\d{9}$/.test(contactPhone)) { + wx.showToast({ title: '请输入正确联系电话', icon: 'none' }) + return + } if (!nickname) { wx.showToast({ title: '请填写昵称', icon: 'none' }) return @@ -229,7 +234,7 @@ Page({ await userApi.updateInfo({ nickname, avatar: form.avatar || '', - contactPhone: String(form.contactPhone || '').trim(), + contactPhone, wechatId: String(form.wechatId || '').trim(), signature: String(form.signature || '').trim() }) diff --git a/JC-Salon-WeChat/pages/profile/index.wxml b/JC-Salon-WeChat/pages/profile/index.wxml index 37fda680..c9654420 100644 --- a/JC-Salon-WeChat/pages/profile/index.wxml +++ b/JC-Salon-WeChat/pages/profile/index.wxml @@ -84,7 +84,7 @@ 联系电话 - + 微信号 diff --git a/JC-Salon-WeChat/pages/register/index.js b/JC-Salon-WeChat/pages/register/index.js index a382d147..a09d4b9c 100644 --- a/JC-Salon-WeChat/pages/register/index.js +++ b/JC-Salon-WeChat/pages/register/index.js @@ -18,7 +18,8 @@ Page({ loading: false, codeLoading: false, countdown: 0, - countdownTimer: null + countdownTimer: null, + agreementAccepted: false }, async onLoad(options) { @@ -39,11 +40,20 @@ Page({ } }, - onInput(event) { this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value }) }, + onInput(event) { + const field = event.currentTarget.dataset.field + const value = field === 'phone' + ? String(event.detail.value || '').replace(/\D/g, '').slice(0, 11) + : event.detail.value + this.setData({ [`form.${field}`]: value }) + }, togglePasswordMode() { this.setData({ passwordMode: !this.data.passwordMode }) }, + toggleAgreement() { this.setData({ agreementAccepted: !this.data.agreementAccepted }) }, + async sendCode() { + if (!this.data.agreementAccepted) { wx.showToast({ title: '请先同意用户协议和隐私政策', icon: 'none' }); return } const phone = String(this.data.form.phone || '').trim() if (!PHONE_REGEX.test(phone)) { wx.showToast({ title: '请输入正确手机号', icon: 'none' }); return } if (this.data.codeLoading || this.data.countdown > 0) return diff --git a/JC-Salon-WeChat/pages/register/index.wxml b/JC-Salon-WeChat/pages/register/index.wxml index d11233e0..7aadaa20 100644 --- a/JC-Salon-WeChat/pages/register/index.wxml +++ b/JC-Salon-WeChat/pages/register/index.wxml @@ -3,9 +3,9 @@ 123 验证手机号手机号将作为你的工作台登录账号 - 手机号手机号已验证 + 手机号手机号已验证 验证码 - 使用密码注册 › + {{agreementAccepted ? '✓' : ''}}我已阅读并同意《用户协议》和《隐私政策》使用密码注册 › 设置密码确认密码 From 5288dbf9b0430424ea4c5be22103deb7cb9ef366 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Wed, 16 Sep 2026 10:47:01 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=9C=89=E6=95=88=E6=9C=9F=E6=8F=90=E7=A4=BA=E5=92=8C?= =?UTF-8?q?=E9=87=8D=E5=8F=91=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-WeChat/pages/login/index.js | 2 ++ JC-Salon-WeChat/pages/login/index.wxml | 2 +- JC-Salon-WeChat/pages/register/index.js | 3 ++- JC-Salon-WeChat/pages/register/index.wxml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/JC-Salon-WeChat/pages/login/index.js b/JC-Salon-WeChat/pages/login/index.js index 15c766bf..10fc2401 100644 --- a/JC-Salon-WeChat/pages/login/index.js +++ b/JC-Salon-WeChat/pages/login/index.js @@ -89,6 +89,7 @@ Page({ loading: false, codeLoading: false, countdown: 0, + codeSent: false, countdownTimer: null, agreementAccepted: false, agreementLoading: false, @@ -153,6 +154,7 @@ Page({ try { await authApi.sendLoginCode(phone) wx.showToast({ title: '验证码已发送' }) + this.setData({ codeSent: true }) this.startCountdown() } catch (error) { wx.showToast({ title: error.message || '验证码发送失败', icon: 'none' }) diff --git a/JC-Salon-WeChat/pages/login/index.wxml b/JC-Salon-WeChat/pages/login/index.wxml index f95afb5f..4d28af6c 100644 --- a/JC-Salon-WeChat/pages/login/index.wxml +++ b/JC-Salon-WeChat/pages/login/index.wxml @@ -31,7 +31,7 @@
diff --git a/JC-Salon-WeChat/pages/register/index.js b/JC-Salon-WeChat/pages/register/index.js index a09d4b9c..c2e958e8 100644 --- a/JC-Salon-WeChat/pages/register/index.js +++ b/JC-Salon-WeChat/pages/register/index.js @@ -18,6 +18,7 @@ Page({ loading: false, codeLoading: false, countdown: 0, + codeSent: false, countdownTimer: null, agreementAccepted: false }, @@ -58,7 +59,7 @@ Page({ if (!PHONE_REGEX.test(phone)) { wx.showToast({ title: '请输入正确手机号', icon: 'none' }); return } if (this.data.codeLoading || this.data.countdown > 0) return this.setData({ codeLoading: true }) - try { await authApi.sendCode(phone); wx.showToast({ title: '验证码已发送' }); this.startCountdown() } catch (error) { wx.showToast({ title: error.message || '发送失败', icon: 'none' }) } finally { this.setData({ codeLoading: false }) } + try { await authApi.sendCode(phone); wx.showToast({ title: '验证码已发送' }); this.setData({ codeSent: true }); this.startCountdown() } catch (error) { wx.showToast({ title: error.message || '发送失败', icon: 'none' }) } finally { this.setData({ codeLoading: false }) } }, continueFromPhone() { diff --git a/JC-Salon-WeChat/pages/register/index.wxml b/JC-Salon-WeChat/pages/register/index.wxml index 7aadaa20..94ed8d83 100644 --- a/JC-Salon-WeChat/pages/register/index.wxml +++ b/JC-Salon-WeChat/pages/register/index.wxml @@ -4,7 +4,7 @@ 验证手机号手机号将作为你的工作台登录账号 手机号手机号已验证 - 验证码 + 验证码 {{agreementAccepted ? '✓' : ''}}我已阅读并同意《用户协议》和《隐私政策》使用密码注册 › 设置密码确认密码 From be3d0cccecaea614a7ecbf0048ba63f593e1bff4 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Wed, 16 Sep 2026 12:22:02 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E7=AE=80=E5=8C=96Salon=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-WeChat/pages/login/index.js | 9 +- JC-Salon-WeChat/pages/login/index.wxml | 108 ++------------ JC-Salon-WeChat/pages/login/index.wxss | 197 +++++++++++++++++++++++++ 3 files changed, 220 insertions(+), 94 deletions(-) diff --git a/JC-Salon-WeChat/pages/login/index.js b/JC-Salon-WeChat/pages/login/index.js index 10fc2401..16e6809b 100644 --- a/JC-Salon-WeChat/pages/login/index.js +++ b/JC-Salon-WeChat/pages/login/index.js @@ -79,6 +79,7 @@ function clearLoginPreference() { Page({ data: { + loginView: 'entry', loginMode: 'phone', form: { account: '', @@ -132,10 +133,14 @@ Page({ switchLoginMode(event) { const loginMode = event.currentTarget.dataset.mode - if (loginMode === this.data.loginMode) { + if (loginMode === 'entry') { + this.setData({ loginView: 'entry' }) return } - this.setData({ loginMode }) + if (loginMode === this.data.loginMode && this.data.loginView === 'form') { + return + } + this.setData({ loginMode, loginView: 'form' }) }, async sendLoginCode() { diff --git a/JC-Salon-WeChat/pages/login/index.wxml b/JC-Salon-WeChat/pages/login/index.wxml index 4d28af6c..410b8e78 100644 --- a/JC-Salon-WeChat/pages/login/index.wxml +++ b/JC-Salon-WeChat/pages/login/index.wxml @@ -1,96 +1,20 @@ - - - {{appName}} - 门店工作台 · 让每一次服务都有清晰安排 + 登录 Salon + + {{appName}}门店工作台 + 账号密码登录注册账号 › + {{agreementAccepted ? '✓' : ''}}我已阅读并同意《用户协议》和《隐私政策》 - - - 欢迎回来 - 登录后继续管理门店与今日排班 - - 验证码登录 - 密码登录 - - - - 账号 - - - - 密码 - - - - 手机号 - - - - 验证码 - - - - - - - {{agreementAccepted ? '✓' : ''}} - - 我已阅读并同意 - 《用户协议》 - 和 - 《隐私政策》 - - - {{agreementError}},点此重试 - - {{rememberMe ? '✓' : ''}} - 记住我,保持登录更久 - - - - - - - - - - - - - - 选择店铺 - 请选择本次登录的店铺 - - - - 店 - - {{item.name}} - {{item.description || ('ID ' + item.id)}} - - - - 正在进入店铺... - - - - - - {{selectedAgreement.title || '协议详情'}} - 版本:{{selectedAgreement.version || '-'}} - - {{selectedAgreement.content || '暂无协议内容'}} - - - + + ‹ 返回{{loginMode === 'phone' ? '手机号登录' : '账号密码登录'}}{{loginMode === 'phone' ? '使用手机号验证码登录工作台' : '使用管理员提供的账号登录'}} + 账号 + 密码 + 手机号 + 验证码 + {{agreementAccepted ? '✓' : ''}}我已阅读并同意《用户协议》和《隐私政策》 + {{agreementError}},点此重试{{rememberMe ? '✓' : ''}}记住我,保持登录更久 + 验证码登录账号密码登录注册账号 + {{selectedAgreement.title || '协议详情'}}版本:{{selectedAgreement.version || '-'}}{{selectedAgreement.content || '暂无协议内容'}} + 选择店铺请选择本次登录的店铺店{{item.name}}{{item.description || ('ID ' + item.id)}}正在进入店铺... diff --git a/JC-Salon-WeChat/pages/login/index.wxss b/JC-Salon-WeChat/pages/login/index.wxss index 294295b1..deb935f8 100644 --- a/JC-Salon-WeChat/pages/login/index.wxss +++ b/JC-Salon-WeChat/pages/login/index.wxss @@ -355,3 +355,200 @@ .agreement-modal-close { margin-top: 22rpx; } + +/* 简洁登录布局沿用 Salon 现有绿色配色和控件语言。 */ +.auth-page { + box-sizing: border-box; + min-height: 100vh; + padding: 0 36rpx 48rpx; + background: #f4f8f5; +} + +.topbar { + display: flex; + align-items: center; + justify-content: center; + height: 96rpx; + border-bottom: 1rpx solid #e7eee9; +} + +.topbar-title { + color: #2e4a3d; + font-size: 32rpx; + font-weight: 800; +} + +.entry-view, +.form-view { + width: 100%; + max-width: 680rpx; + margin: 0 auto; +} + +.entry-brand { + margin-top: 132rpx; + margin-bottom: 0; +} + +.entry-brand .logo { + width: 128rpx; + height: 128rpx; +} + +.entry-brand .brand-name { + margin-top: 22rpx; + font-size: 42rpx; +} + +.entry-brand .brand-sub { + margin-top: 10rpx; +} + +.entry-actions { + margin-top: 132rpx; +} + +.entry-primary, +.entry-secondary { + width: 100%; + height: 92rpx; + margin: 0; + border-radius: 14rpx; + font-size: 29rpx; + line-height: 92rpx; +} + +.entry-primary { + background: #6f8f83; + color: #fffdf8; +} + +.entry-secondary { + margin-top: 22rpx; + border: 1rpx solid #9fbcac; + background: #fbfdfb; + color: #55786d; +} + +.entry-password, +.entry-register { + color: #6f8f83; + font-size: 26rpx; + text-align: center; +} + +.entry-password { + margin-top: 30rpx; +} + +.entry-register { + margin-top: 24rpx; + color: #8b968f; +} + +.entry-register text { + margin-left: 4rpx; + font-size: 32rpx; +} + +.entry-agreement { + margin-top: 118rpx; +} + +.form-view { + padding-top: 54rpx; +} + +.form-heading { + position: relative; + margin-bottom: 72rpx; + text-align: center; +} + +.back-entry { + position: absolute; + top: -8rpx; + left: 0; + color: #6f8f83; + font-size: 30rpx; +} + +.back-entry text { + margin-left: 4rpx; + font-size: 24rpx; +} + +.form-title { + color: #2e4a3d; + font-size: 42rpx; + font-weight: 800; +} + +.form-subtitle { + margin-top: 12rpx; + color: #87978c; + font-size: 23rpx; +} + +.compact-field { + margin-top: 28rpx; +} + +.compact-field .field-label { + display: none; +} + +.compact-field input { + box-sizing: border-box; + width: 100%; + height: 88rpx; + padding: 0 8rpx; + border-bottom: 1rpx solid #dce7df; + background: transparent; + color: #2e4a3d; + font-size: 29rpx; +} + +.compact-field .code-row { + border-bottom: 1rpx solid #dce7df; +} + +.compact-field .code-input { + height: 88rpx; + border-bottom: 0; +} + +.compact-field .code-btn { + width: 190rpx; + min-width: 190rpx; + max-width: 190rpx; + height: 72rpx; + border: 0; + background: transparent; + color: #55786d; + line-height: 72rpx; +} + +.form-view .agreement-row { + margin-top: 44rpx; +} + +.form-view .remember-row { + margin-top: 20rpx; +} + +.form-view .login-btn { + height: 88rpx; + margin-top: 38rpx; + border-radius: 14rpx; + line-height: 88rpx; +} + +.form-links { + display: flex; + justify-content: center; + gap: 48rpx; + margin-top: 28rpx; + color: #6f8f83; + font-size: 24rpx; +} From fab7d7789d9af4d2779a07c73f700a7d201fbbf4 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Wed, 16 Sep 2026 12:27:28 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JC-Salon-WeChat/pages/login/index.js | 2 +- JC-Salon-WeChat/pages/login/index.wxml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/JC-Salon-WeChat/pages/login/index.js b/JC-Salon-WeChat/pages/login/index.js index 16e6809b..270a1b93 100644 --- a/JC-Salon-WeChat/pages/login/index.js +++ b/JC-Salon-WeChat/pages/login/index.js @@ -566,7 +566,7 @@ Page({ } const phoneCode = event && event.detail && event.detail.code if (!phoneCode) { - wx.showToast({ title: '需要授权手机号后才能登录', icon: 'none' }) + wx.showToast({ title: '请授权手机号后登录', icon: 'none' }) return } this.setData({ loading: true }) diff --git a/JC-Salon-WeChat/pages/login/index.wxml b/JC-Salon-WeChat/pages/login/index.wxml index 410b8e78..d65532f8 100644 --- a/JC-Salon-WeChat/pages/login/index.wxml +++ b/JC-Salon-WeChat/pages/login/index.wxml @@ -2,7 +2,7 @@ 登录 Salon {{appName}}门店工作台 - 账号密码登录注册账号 › + 账号密码登录注册账号 › {{agreementAccepted ? '✓' : ''}}我已阅读并同意《用户协议》和《隐私政策》