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" <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/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..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 @@ -1074,23 +1074,42 @@ 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 = normalizeVerifiedPhone(phone); + 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 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) { 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' }, 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 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/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 19301dca..270a1b93 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: '', @@ -89,6 +90,7 @@ Page({ loading: false, codeLoading: false, countdown: 0, + codeSent: false, countdownTimer: null, agreementAccepted: false, agreementLoading: false, @@ -101,7 +103,8 @@ Page({ shopSelectVisible: false, shopSelectMode: '', shopOptions: [], - switchingShop: false + switchingShop: false, + wechatLoginTicket: '' }, onLoad() { @@ -120,20 +123,30 @@ 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 }) }, 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() { + if (!this.ensureAgreementAccepted()) { + return + } const phone = String(this.data.form.phone || '').trim() if (!PHONE_REGEX.test(phone)) { wx.showToast({ title: '请输入正确手机号', icon: 'none' }) @@ -146,6 +159,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' }) @@ -291,6 +305,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 +397,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 +426,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 +558,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..d65532f8 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; +} 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 e32fc289..c2e958e8 100644 --- a/JC-Salon-WeChat/pages/register/index.js +++ b/JC-Salon-WeChat/pages/register/index.js @@ -18,7 +18,9 @@ Page({ loading: false, codeLoading: false, countdown: 0, - countdownTimer: null + codeSent: false, + countdownTimer: null, + agreementAccepted: false }, async onLoad(options) { @@ -39,16 +41,25 @@ 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 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() { @@ -71,13 +82,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 }) } }, diff --git a/JC-Salon-WeChat/pages/register/index.wxml b/JC-Salon-WeChat/pages/register/index.wxml index d11233e0..94ed8d83 100644 --- a/JC-Salon-WeChat/pages/register/index.wxml +++ b/JC-Salon-WeChat/pages/register/index.wxml @@ -3,9 +3,9 @@ 123 验证手机号手机号将作为你的工作台登录账号 - 手机号手机号已验证 - 验证码 - 使用密码注册 › + 手机号手机号已验证 + 验证码 + {{agreementAccepted ? '✓' : ''}}我已阅读并同意《用户协议》和《隐私政策》使用密码注册 › 设置密码确认密码 diff --git a/docs/scripts/Salon SIT自动发布配置说明_20260901.md b/docs/scripts/Salon SIT自动发布配置说明_20260901.md index 054a6863..c698f396 100644 --- a/docs/scripts/Salon SIT自动发布配置说明_20260901.md +++ b/docs/scripts/Salon SIT自动发布配置说明_20260901.md @@ -4,10 +4,10 @@ ## 部署目标 -- Core/Gateway:`192.168.10.106:22`,独立目录 `/opt/jc-salon-core-sit`、`/opt/jc-salon-gateway-sit`,服务名 `jc-salon-core-sit`、`jc-salon-gateway-sit`。 +- Core/Gateway:`192.168.10.15:22`,独立目录 `/opt/jc-salon-core-sit`、`/opt/jc-salon-gateway-sit`,服务名 `jc-salon-core-sit`、`jc-salon-gateway-sit`。 - 前端:与生产共用阿里云入口服务器,独立目录 `/opt/jc-salon-frontend-sit`,域名 `sit.yunail.art`。 - 前端构建阶段显式注入 `VITE_API_BASE_URL=https://sit.yunail.art/api` 和 `VITE_ADMIN_API_BASE_URL=https://sit.yunail.art/admin/api`,避免构建产物使用生产接口默认值。 -- SIT 中间件:Nacos `192.168.10.103:8848`、MySQL `192.168.10.102:3306`、Redis `192.168.10.101:6379`、RabbitMQ `192.168.10.104:5672`、MinIO `192.168.10.105:9000`,由 SIT Nacos 配置注入。 +- SIT 中间件:Nacos `192.168.10.10:8848`、MySQL `192.168.10.11:3306`、Redis `192.168.10.12:6379`、RabbitMQ `192.168.10.13:5672`、MinIO `192.168.10.14:9000`,由 SIT Nacos 配置注入。 - 工作流显式传入 `-AllowSitTarget`,仅允许 `Environment=sit` 的目标;生产工作流不传入该开关,仍拒绝非生产节点。 ## 前置配置 @@ -15,13 +15,13 @@ 1. Gitea Secret 中配置 `SALON_PROD_SSH_PASSWORD`,用于连接 SIT 后端和共用的阿里云前端服务器;工作流使用账号 `root`、SSH 端口 `22`。 2. 阿里云 Nginx 新增 `sit.yunail.art` server 配置,将站点根目录指向 `/opt/jc-salon-frontend-sit`,并按现有生产规则代理 `/api`。 3. Nginx 修改后执行 `nginx -t`,通过后再 reload。 -4. 首次部署前确认 `192.168.10.106` 已安装 Java 17、systemd 可用,且网络可访问 SIT Nacos、MySQL、Redis 和 RabbitMQ。 +4. 首次部署前确认 `192.168.10.15` 已安装 Java 17、systemd 可用,且网络可访问 SIT Nacos、MySQL、Redis 和 RabbitMQ。 ## 已确认的 SIT 前置条件 - 数据库 `jayucloud_salon` 已完成初始化;部署工作流继续跳过数据库执行。 - RabbitMQ 已创建/更新业务用户 `xiaowang`,已授权 `/` 和 `/jayucloud-salon-sit`;业务 vhost 使用 `/jayucloud-salon-sit`。 -- MinIO 使用 `192.168.10.105:9000`;七牛 Kodo 和阿里云 OSS 沿用生产凭据与连接参数,SIT 使用带 `sit` 后缀的 Bucket。 +- MinIO 使用 `192.168.10.14:9000`;七牛 Kodo 和阿里云 OSS 沿用生产凭据与连接参数,SIT 使用带 `sit` 后缀的 Bucket。 - RabbitMQ 密码、对象存储密钥和 Nacos 凭据仅通过受控环境或 Gitea Secrets 注入,不写入本文档。 ## 验证 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" 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; diff --git a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/core.yaml b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/core.yaml index b83f5c36..66dda528 100644 --- a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/core.yaml +++ b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/core.yaml @@ -1,6 +1,6 @@ spring: datasource: - url: jdbc:mysql://192.168.10.102:3306/jayucloud_artlist?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + url: jdbc:mysql://192.168.10.11:3306/jayucloud_artlist?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai servlet: multipart: max-file-size: 5MB diff --git a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml index bc5476a1..8463bcbe 100644 --- a/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml +++ b/nacos/namespaces/sit/jayucloud-artlist/DEFAULT_GROUP/infra.yaml @@ -1,12 +1,12 @@ spring: redis: - host: ${REDIS_HOST:192.168.10.101} + host: ${REDIS_HOST:192.168.10.12} port: ${REDIS_PORT:6379} username: ${REDIS_USERNAME:xiaowang} password: ${REDIS_PASSWORD} database: ${REDIS_DATABASE:0} rabbitmq: - addresses: ${RABBITMQ_ADDRESSES:192.168.10.104:5672} + addresses: ${RABBITMQ_ADDRESSES:192.168.10.13:5672} virtual-host: ${RABBITMQ_VHOST} username: ${RABBITMQ_USERNAME} password: ${RABBITMQ_PASSWORD} @@ -32,7 +32,7 @@ object-storage: minio: enabled: ${MINIO_ENABLED:true} - endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000} + endpoint: ${MINIO_ENDPOINT:http://192.168.10.14:9000} bucket-name: ${MINIO_BUCKET_NAME:jayucloud-sit} access-key: ${MINIO_ACCESS_KEY} secret-key: ${MINIO_SECRET_KEY} diff --git a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml index 1bb96f7d..103d3528 100644 --- a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml +++ b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/core.yaml @@ -1,93 +1,93 @@ -spring: - datasource: +spring: + datasource: url: jdbc:mysql://192.168.10.11:3306/jayucloud_salon?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai - servlet: - multipart: - max-file-size: 5MB - max-request-size: 10MB - jackson: - time-zone: Asia/Shanghai - date-format: yyyy-MM-dd HH:mm:ss - -logging: - pattern: - console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n" - -server: - servlet: - encoding: - charset: UTF-8 - force: true - enabled: true - timezone: Asia/Shanghai - -mybatis: - configuration: - map-underscore-to-camel-case: true - + servlet: + multipart: + max-file-size: 5MB + max-request-size: 10MB + jackson: + time-zone: Asia/Shanghai + date-format: yyyy-MM-dd HH:mm:ss + +logging: + pattern: + console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n" + +server: + servlet: + encoding: + charset: UTF-8 + force: true + enabled: true + timezone: Asia/Shanghai + +mybatis: + configuration: + map-underscore-to-camel-case: true + fingertip-designer: - brand: - message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Salon} - manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺} - security: - jwt: - issuer: jayucloud-salon - access-token-expiration-seconds: 7200 - remember-me-access-token-expiration-seconds: 604800 - refresh-token-expiration-seconds: 604800 - clock-skew-seconds: 30 - signature: - enabled: true - window-seconds: 300 - nonce-retention-seconds: 600 - rate-limit: - login: - limit: 10 - window-seconds: 60 - send-code: - limit: 5 - window-seconds: 60 - reset-password: - limit: 5 - window-seconds: 600 - authenticated-write: - limit: 80 - window-seconds: 60 - order-create: - limit: 10 - window-seconds: 60 - cache: - local-max-size: 2048 - product-detail: - local-ttl-seconds: 120 - redis-ttl-seconds: 900 - product-list: - local-ttl-seconds: 60 - redis-ttl-seconds: 300 - product-search: - local-ttl-seconds: 60 - redis-ttl-seconds: 300 - shop: - local-ttl-seconds: 180 - redis-ttl-seconds: 900 - tag: - local-ttl-seconds: 300 - redis-ttl-seconds: 1200 - object-storage-file: - local-ttl-seconds: 300 - redis-ttl-seconds: 1800 - dashboard: - local-ttl-seconds: 30 - redis-ttl-seconds: 90 - slow-request: - enabled: true - threshold-ms: 300 - log-response-header-request-id: true + brand: + message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Salon} + manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺} + security: + jwt: + issuer: jayucloud-salon + access-token-expiration-seconds: 7200 + remember-me-access-token-expiration-seconds: 604800 + refresh-token-expiration-seconds: 604800 + clock-skew-seconds: 30 + signature: + enabled: true + window-seconds: 300 + nonce-retention-seconds: 600 + rate-limit: + login: + limit: 10 + window-seconds: 60 + send-code: + limit: 5 + window-seconds: 60 + reset-password: + limit: 5 + window-seconds: 600 + authenticated-write: + limit: 80 + window-seconds: 60 + order-create: + limit: 10 + window-seconds: 60 + cache: + local-max-size: 2048 + product-detail: + local-ttl-seconds: 120 + redis-ttl-seconds: 900 + product-list: + local-ttl-seconds: 60 + redis-ttl-seconds: 300 + product-search: + local-ttl-seconds: 60 + redis-ttl-seconds: 300 + shop: + local-ttl-seconds: 180 + redis-ttl-seconds: 900 + tag: + local-ttl-seconds: 300 + redis-ttl-seconds: 1200 + object-storage-file: + local-ttl-seconds: 300 + redis-ttl-seconds: 1800 + dashboard: + local-ttl-seconds: 30 + redis-ttl-seconds: 90 + slow-request: + enabled: true + threshold-ms: 300 + log-response-header-request-id: true http-client: - connect-timeout-ms: 3000 - read-timeout-ms: 5000 - connection-request-timeout-ms: 1000 - max-total-connections: 200 + connect-timeout-ms: 3000 + read-timeout-ms: 5000 + connection-request-timeout-ms: 1000 + max-total-connections: 200 max-connections-per-route: 50 messagehub: @@ -97,50 +97,50 @@ messagehub: ingress-exchange: ${MESSAGEHUB_INGRESS_EXCHANGE:messagehub.ingress.exchange} ingress-routing-key: ${MESSAGEHUB_INGRESS_ROUTING_KEY:message.send} source-system: ${MESSAGEHUB_SOURCE_SYSTEM:jayucloud-salon} - -object-storage: - provider-order: - - MINIO - - QINIU_KODO - - ALIYUN_OSS - replica-required-providers: - - MINIO - - QINIU_KODO - - ALIYUN_OSS - primary-provider: MINIO - backup-provider: QINIU_KODO,ALIYUN_OSS - signed-url-expire-minutes: 60 - backup-queue-name: jayucloud-salon.file.object-storage.backup.queue - backup-exchange-name: jayucloud-salon.file.object-storage.backup.exchange - backup-routing-key: jayucloud-salon.file.object-storage.backup - backup-retry-batch-limit: 500 - backup-retry-cron: "0 0 2 * * ?" - -qiniu: - kodo: - access-key: ${QINIU_KODO_ACCESS_KEY:} - secret-key: ${QINIU_KODO_SECRET_KEY:} - bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-sit} - domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art} - zone: ${QINIU_KODO_ZONE:z2} - private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true} - signed-url-expire-minutes: ${QINIU_KODO_SIGNED_URL_EXPIRE_MINUTES:60} - -minio: - enabled: ${MINIO_ENABLED:false} - endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000} - bucket-name: ${MINIO_BUCKET_NAME:jayucloud-sit} - access-key: ${MINIO_ACCESS_KEY:} - secret-key: ${MINIO_SECRET_KEY:} - private-bucket: ${MINIO_PRIVATE_BUCKET:true} - signed-url-expire-minutes: ${MINIO_SIGNED_URL_EXPIRE_MINUTES:60} - -aliyun: - oss: - enabled: ${ALIYUN_OSS_ENABLED:false} - endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com} - region: ${ALIYUN_OSS_REGION:cn-chengdu} - bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-sit} - access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID:} - access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET:} - signed-url-expire-minutes: ${ALIYUN_OSS_SIGNED_URL_EXPIRE_MINUTES:60} + +object-storage: + provider-order: + - MINIO + - QINIU_KODO + - ALIYUN_OSS + replica-required-providers: + - MINIO + - QINIU_KODO + - ALIYUN_OSS + primary-provider: MINIO + backup-provider: QINIU_KODO,ALIYUN_OSS + signed-url-expire-minutes: 60 + backup-queue-name: jayucloud-salon.file.object-storage.backup.queue + backup-exchange-name: jayucloud-salon.file.object-storage.backup.exchange + backup-routing-key: jayucloud-salon.file.object-storage.backup + backup-retry-batch-limit: 500 + backup-retry-cron: "0 0 2 * * ?" + +qiniu: + kodo: + access-key: ${QINIU_KODO_ACCESS_KEY:} + secret-key: ${QINIU_KODO_SECRET_KEY:} + bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-sit} + domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art} + zone: ${QINIU_KODO_ZONE:z2} + private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true} + signed-url-expire-minutes: ${QINIU_KODO_SIGNED_URL_EXPIRE_MINUTES:60} + +minio: + enabled: ${MINIO_ENABLED:false} + endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000} + bucket-name: ${MINIO_BUCKET_NAME:jayucloud-sit} + access-key: ${MINIO_ACCESS_KEY:} + secret-key: ${MINIO_SECRET_KEY:} + private-bucket: ${MINIO_PRIVATE_BUCKET:true} + signed-url-expire-minutes: ${MINIO_SIGNED_URL_EXPIRE_MINUTES:60} + +aliyun: + oss: + enabled: ${ALIYUN_OSS_ENABLED:false} + endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com} + region: ${ALIYUN_OSS_REGION:cn-chengdu} + bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-sit} + access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID:} + access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET:} + signed-url-expire-minutes: ${ALIYUN_OSS_SIGNED_URL_EXPIRE_MINUTES:60} diff --git a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml index bc5476a1..8463bcbe 100644 --- a/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml +++ b/nacos/namespaces/sit/jayucloud-salon/DEFAULT_GROUP/infra.yaml @@ -1,12 +1,12 @@ spring: redis: - host: ${REDIS_HOST:192.168.10.101} + host: ${REDIS_HOST:192.168.10.12} port: ${REDIS_PORT:6379} username: ${REDIS_USERNAME:xiaowang} password: ${REDIS_PASSWORD} database: ${REDIS_DATABASE:0} rabbitmq: - addresses: ${RABBITMQ_ADDRESSES:192.168.10.104:5672} + addresses: ${RABBITMQ_ADDRESSES:192.168.10.13:5672} virtual-host: ${RABBITMQ_VHOST} username: ${RABBITMQ_USERNAME} password: ${RABBITMQ_PASSWORD} @@ -32,7 +32,7 @@ object-storage: minio: enabled: ${MINIO_ENABLED:true} - endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000} + endpoint: ${MINIO_ENDPOINT:http://192.168.10.14:9000} bucket-name: ${MINIO_BUCKET_NAME:jayucloud-sit} access-key: ${MINIO_ACCESS_KEY} secret-key: ${MINIO_SECRET_KEY}