Dev #53

Merged
xiaowang merged 15 commits from dev into sit 2026-09-16 16:55:19 +08:00
34 changed files with 609 additions and 295 deletions
+2 -2
View File
@@ -72,7 +72,7 @@ jobs:
mkdir -p "$RUNNER_TEMP/salon-sit"
cat > "$RUNNER_TEMP/salon-sit/servers.json" <<JSON
[
{"Name":"sit-app01","Host":"192.168.10.106","Port":22,"User":"root","Purpose":"Salon SIT Core/Gateway","Environment":"sit"},
{"Name":"sit-app01","Host":"192.168.10.15","Port":22,"User":"root","Purpose":"Salon SIT Core/Gateway","Environment":"sit"},
{"Name":"salon-web-sit","Host":"${WEB_TARGET_HOST}","Port":${WEB_TARGET_PORT},"User":"${WEB_TARGET_USER}","Purpose":"Salon SIT NGINX","Environment":"sit"}
]
JSON
@@ -86,7 +86,7 @@ jobs:
test -n "$SALON_PROD_SSH_PASSWORD"
test -n "$MESSAGEHUB_ACCESS_TOKEN"
printf 'MESSAGEHUB_ACCESS_TOKEN=%s\n' "$MESSAGEHUB_ACCESS_TOKEN" |
SSHPASS="$SALON_PROD_SSH_PASSWORD" sshpass -e ssh -o StrictHostKeyChecking=no -p 22 root@192.168.10.106 \
SSHPASS="$SALON_PROD_SSH_PASSWORD" sshpass -e ssh -o StrictHostKeyChecking=no -p 22 root@192.168.10.15 \
'install -d -m 700 /etc/sysconfig /etc/systemd/system/jc-salon-core-sit.service.d; install -m 600 /dev/stdin /etc/sysconfig/jc-salon-messagehub; printf "[Service]\\nEnvironmentFile=/etc/sysconfig/jc-salon-messagehub\\n" | install -m 644 /dev/stdin /etc/systemd/system/jc-salon-core-sit.service.d/messagehub.conf; systemctl daemon-reload'
- name: 自动发布 Salon SIT
shell: pwsh
@@ -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);
}
@@ -26,9 +26,9 @@ import java.util.HashMap;
import java.util.Map;
/**
* FingertipDesigner 到 MessageHub 的投递客户端。
* Salon 到 MessageHub 的投递客户端。
*
* <p>FingertipDesigner 只决定某个业务场景使用哪组 MessageHub 对接参数,不直接连接 Spug、
* <p>Salon 只决定某个业务场景使用哪组 MessageHub 对接参数,不直接连接 Spug、
* 阿里云等短信供应商。真实通道选择和供应商密钥仍归 MessageHub 管理。</p>
*/
@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.
@@ -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<ShopSimpleVO> 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
@@ -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,
@@ -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);
@@ -106,6 +106,8 @@ public interface UserService extends IService<UserDO> {
*/
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.
@@ -1074,23 +1074,42 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> 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) {
@@ -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)
@@ -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: '' },
@@ -91,7 +91,7 @@ const visibleModules = computed(() => {
key: 'dashboard',
title: '仪表盘',
description: '查看经营概览、近期动态和重点提醒。',
path: '/admin/dashboard',
path: '/admin',
icon: DashboardOutlined,
permissionCode: 'dashboard:view'
},
@@ -109,6 +109,14 @@ spring:
- Path=/admin/api/**
filters:
- RewritePath=/admin/api/(?<remaining>.*), /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/(?<remaining>.*), /user/workbench/registration/${remaining}
- id: admin-auth-compat-route
order: -8
uri: lb://jc-salon-core
+18
View File
@@ -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)}`,
@@ -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
@@ -7,7 +7,7 @@
</view>
<view class="field">
<text class="field-label required">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" bindfocus="onCustomerFocus" bindblur="hideCustomerDropdown" placeholder="搜索或输入手机号" />
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" bindfocus="onCustomerFocus" bindblur="hideCustomerDropdown" maxlength="11" type="number" placeholder="搜索或输入手机号" />
</view>
<view wx:if="{{customerDropdownVisible}}" class="customer-dropdown">
<view wx:if="{{customerLoading}}" class="customer-option muted-option">正在搜索客户...</view>
+4
View File
@@ -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 })
+1 -1
View File
@@ -35,7 +35,7 @@
</view>
<view class="modal-field">
<text class="required-label">手机号</text>
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="请输入手机号" />
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" maxlength="11" placeholder="请输入手机号" />
</view>
</view>
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitCustomer">保存客户</button>
+4
View File
@@ -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({
+1 -1
View File
@@ -49,7 +49,7 @@
</view>
<view class="modal-field">
<text class="required-label">手机号</text>
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="请输入手机号" />
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" maxlength="11" placeholder="请输入手机号" />
</view>
<view class="modal-field">
<text class="required-label">登录账号</text>
+64 -4
View File
@@ -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 })
}
}
})
+16 -92
View File
@@ -1,96 +1,20 @@
<view class="page no-tab auth-page">
<view class="brand">
<image class="logo" src="/assets/images/app-icon.png" mode="aspectFill"></image>
<text class="brand-name">{{appName}}</text>
<text class="brand-sub">门店工作台 · 让每一次服务都有清晰安排</text>
<view class="topbar"><text class="topbar-title">登录 Salon</text></view>
<view wx:if="{{loginView === 'entry'}}" class="entry-view">
<view class="brand entry-brand"><image class="logo" src="/assets/images/app-icon.png" mode="aspectFill"></image><text class="brand-name">{{appName}}</text><text class="brand-sub">门店工作台</text></view>
<view class="entry-actions"><button class="primary-btn entry-primary" open-type="getPhoneNumber" bindgetphonenumber="wechatPhoneLogin">快捷登录</button><button class="secondary-btn entry-secondary" data-mode="phone" bindtap="switchLoginMode">验证码登录</button><view class="entry-password" data-mode="password" bindtap="switchLoginMode">账号密码登录</view><view class="entry-register" bindtap="goRegister">注册账号 <text>›</text></view></view>
<view class="agreement-row entry-agreement" bindtap="toggleAgreement"><view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view><view class="agreement-copy"><text>我已阅读并同意</text><text class="agreement-link" data-type="USER_TERMS" catchtap="openAgreement">《用户协议》</text><text>和</text><text class="agreement-link" data-type="PRIVACY_POLICY" catchtap="openAgreement">《隐私政策》</text></view></view>
</view>
<view class="card auth-card">
<view class="welcome-copy">欢迎回来</view>
<view class="welcome-hint">登录后继续管理门店与今日排班</view>
<view class="mode-tabs">
<view class="mode-tab {{loginMode === 'phone' ? 'active' : ''}}" data-mode="phone" bindtap="switchLoginMode">验证码登录</view>
<view class="mode-tab {{loginMode === 'password' ? 'active' : ''}}" data-mode="password" bindtap="switchLoginMode">密码登录</view>
</view>
<view wx:if="{{loginMode === 'password'}}" class="field">
<text class="field-label">账号</text>
<input value="{{form.account}}" data-field="account" bindinput="onInput" placeholder="请输入账号" />
</view>
<view wx:if="{{loginMode === 'password'}}" class="field">
<text class="field-label">密码</text>
<input value="{{form.password}}" data-field="password" bindinput="onInput" password placeholder="请输入密码" />
</view>
<view wx:if="{{loginMode === 'phone'}}" class="field">
<text class="field-label">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" placeholder="请输入手机号" />
</view>
<view wx:if="{{loginMode === 'phone'}}" class="field">
<text class="field-label">验证码</text>
<view class="code-row">
<input class="code-input" value="{{form.code}}" data-field="code" bindinput="onInput" type="number" placeholder="请输入验证码" />
<button class="code-btn {{countdown > 0 ? 'counting' : ''}}" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendLoginCode">
<text wx:if="{{countdown > 0}}">重新获取 {{countdown}}s</text>
<text wx:else>获取验证码</text>
</button>
</view>
</view>
<view class="agreement-row" bindtap="toggleAgreement">
<view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view>
<view class="agreement-copy">
<text>我已阅读并同意</text>
<text class="agreement-link" data-type="USER_TERMS" catchtap="openAgreement">《用户协议》</text>
<text>和</text>
<text class="agreement-link" data-type="PRIVACY_POLICY" catchtap="openAgreement">《隐私政策》</text>
</view>
</view>
<view wx:if="{{agreementError}}" class="agreement-error" bindtap="loadAgreements">{{agreementError}},点此重试</view>
<view class="remember-row" bindtap="toggleRememberMe">
<view class="agreement-check {{rememberMe ? 'checked' : ''}}">{{rememberMe ? '✓' : ''}}</view>
<view class="agreement-copy">记住我,保持登录更久</view>
</view>
<button class="primary-btn login-btn {{agreementAccepted ? '' : 'disabled'}}" loading="{{loading}}" disabled="{{loading || agreementLoading}}" bindtap="submit">{{agreementLoading ? '协议加载中...' : '登录'}}</button>
<view class="auth-links">
<button class="text-btn">忘记密码</button>
<button class="text-btn" bindtap="goRegister">注册账号</button>
</view>
</view>
<button class="secondary-btn wechat-btn" bindtap="wechatLogin">微信快捷登录</button>
<view wx:if="{{shopSelectVisible}}" class="shop-select-mask">
<view class="shop-select-dialog">
<view class="shop-select-header">
<text class="shop-select-title">选择店铺</text>
<text class="shop-select-subtitle">请选择本次登录的店铺</text>
</view>
<scroll-view class="shop-option-list" scroll-y>
<view
wx:for="{{shopOptions}}"
wx:key="id"
class="shop-option {{switchingShop ? 'disabled' : ''}}"
data-id="{{item.id}}"
bindtap="selectLoginShop"
>
<view class="shop-option-icon">店</view>
<view class="shop-option-copy">
<text class="shop-option-name">{{item.name}}</text>
<text class="shop-option-id">{{item.description || ('ID ' + item.id)}}</text>
</view>
</view>
</scroll-view>
<view wx:if="{{switchingShop}}" class="shop-switching">正在进入店铺...</view>
</view>
</view>
<view wx:if="{{agreementModalVisible}}" class="agreement-mask" catchtouchmove="stopTap">
<view class="agreement-modal">
<view class="agreement-modal-title">{{selectedAgreement.title || '协议详情'}}</view>
<view class="agreement-modal-meta">版本:{{selectedAgreement.version || '-'}}</view>
<scroll-view class="agreement-modal-body" scroll-y>
<text>{{selectedAgreement.content || '暂无协议内容'}}</text>
</scroll-view>
<button class="primary-btn agreement-modal-close" bindtap="closeAgreementModal">我知道了</button>
</view>
<view wx:if="{{loginView === 'form'}}" class="form-view">
<view class="form-heading"><view class="back-entry" data-mode="entry" bindtap="switchLoginMode">‹ <text>返回</text></view><view class="form-title">{{loginMode === 'phone' ? '手机号登录' : '账号密码登录'}}</view><view class="form-subtitle">{{loginMode === 'phone' ? '使用手机号验证码登录工作台' : '使用管理员提供的账号登录'}}</view></view>
<view wx:if="{{loginMode === 'password'}}" class="field compact-field"><text class="field-label">账号</text><input value="{{form.account}}" data-field="account" bindinput="onInput" placeholder="请输入账号" /></view>
<view wx:if="{{loginMode === 'password'}}" class="field compact-field"><text class="field-label">密码</text><input value="{{form.password}}" data-field="password" bindinput="onInput" password placeholder="请输入密码" /></view>
<view wx:if="{{loginMode === 'phone'}}" class="field compact-field"><text class="field-label">手机号</text><input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="text" maxlength="11" placeholder="请输入手机号" /></view>
<view wx:if="{{loginMode === 'phone'}}" class="field compact-field"><text class="field-label">验证码</text><view class="code-row"><input class="code-input" value="{{form.code}}" data-field="code" bindinput="onInput" type="text" maxlength="6" placeholder="请输入验证码" /><button class="code-btn {{countdown > 0 ? 'counting' : ''}}" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendLoginCode"><text wx:if="{{countdown > 0}}">重新获取 {{countdown}}s</text><text wx:else>{{codeSent ? '重新获取' : '获取验证码'}}</text></button></view></view>
<view class="agreement-row" bindtap="toggleAgreement"><view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view><view class="agreement-copy"><text>我已阅读并同意</text><text class="agreement-link" data-type="USER_TERMS" catchtap="openAgreement">《用户协议》</text><text>和</text><text class="agreement-link" data-type="PRIVACY_POLICY" catchtap="openAgreement">《隐私政策》</text></view></view>
<view wx:if="{{agreementError}}" class="agreement-error" bindtap="loadAgreements">{{agreementError}},点此重试</view><view class="remember-row" bindtap="toggleRememberMe"><view class="agreement-check {{rememberMe ? 'checked' : ''}}">{{rememberMe ? '✓' : ''}}</view><view class="agreement-copy">记住我,保持登录更久</view></view><button class="primary-btn login-btn {{agreementAccepted ? '' : 'disabled'}}" loading="{{loading}}" disabled="{{loading || agreementLoading}}" bindtap="submit">{{agreementLoading ? '协议加载中...' : '登录'}}</button>
<view class="form-links"><view bindtap="switchLoginMode" data-mode="phone" wx:if="{{loginMode === 'password'}}">验证码登录</view><view bindtap="switchLoginMode" data-mode="password" wx:if="{{loginMode === 'phone'}}">账号密码登录</view><view bindtap="goRegister">注册账号</view></view>
</view>
<view wx:if="{{agreementModalVisible}}" class="agreement-mask" catchtouchmove="stopTap"><view class="agreement-modal"><view class="agreement-modal-title">{{selectedAgreement.title || '协议详情'}}</view><view class="agreement-modal-meta">版本:{{selectedAgreement.version || '-'}}</view><scroll-view class="agreement-modal-body" scroll-y><text>{{selectedAgreement.content || '暂无协议内容'}}</text></scroll-view><button class="primary-btn agreement-modal-close" bindtap="closeAgreementModal">我知道了</button></view></view>
<view wx:if="{{shopSelectVisible}}" class="shop-select-mask"><view class="shop-select-dialog"><view class="shop-select-header"><text class="shop-select-title">选择店铺</text><text class="shop-select-subtitle">请选择本次登录的店铺</text></view><scroll-view class="shop-option-list" scroll-y><view wx:for="{{shopOptions}}" wx:key="id" class="shop-option {{switchingShop ? 'disabled' : ''}}" data-id="{{item.id}}" bindtap="selectLoginShop"><view class="shop-option-icon">店</view><view class="shop-option-copy"><text class="shop-option-name">{{item.name}}</text><text class="shop-option-id">{{item.description || ('ID ' + item.id)}}</text></view></view></scroll-view><view wx:if="{{switchingShop}}" class="shop-switching">正在进入店铺...</view></view></view>
</view>
+197
View File
@@ -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;
}
+6 -1
View File
@@ -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()
})
+1 -1
View File
@@ -84,7 +84,7 @@
</view>
<view class="modal-field">
<text>联系电话</text>
<input value="{{profileForm.contactPhone}}" data-field="contactPhone" bindinput="onProfileInput" type="number" placeholder="请输入联系电话" />
<input value="{{profileForm.contactPhone}}" data-field="contactPhone" bindinput="onProfileInput" type="number" maxlength="11" placeholder="请输入联系电话" />
</view>
<view class="modal-field">
<text>微信号</text>
+21 -4
View File
@@ -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 }) }
},
+3 -3
View File
@@ -3,9 +3,9 @@
<view class="progress-row"><view class="progress-step {{step >= 1 ? 'active' : ''}}"><text>1</text><label>验证手机</label></view><view class="progress-line {{step >= 2 ? 'active' : ''}}"></view><view class="progress-step {{step >= 2 ? 'active' : ''}}"><text>2</text><label>选择身份</label></view><view class="progress-line {{step >= 3 ? 'active' : ''}}"></view><view class="progress-step {{step >= 3 ? 'active' : ''}}"><text>3</text><label>提交审核</label></view></view>
<view wx:if="{{step === 1}}" class="card form-card">
<view class="section-title">验证手机号</view><view class="section-desc">手机号将作为你的工作台登录账号</view>
<view class="field"><text class="field-label">手机号</text><input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" disabled="{{phoneVerified}}" placeholder="请输入手机号" /><text wx:if="{{phoneVerified}}" class="verified-tip">手机号已验证</text></view>
<view class="field"><text class="field-label">验证码</text><view class="code-row"><input class="code-input" value="{{form.code}}" data-field="code" bindinput="onInput" type="number" placeholder="请输入6位验证码" /><button class="code-btn {{countdown > 0 ? 'counting' : ''}}" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendCode"><text wx:if="{{countdown > 0}}">{{countdown}}s 后重发</text><text wx:else>获取验证码</text></button></view></view>
<view class="secondary-entry" bindtap="togglePasswordMode">使用密码注册 <text>›</text></view>
<view class="field"><text class="field-label">手机号</text><input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" maxlength="11" disabled="{{phoneVerified}}" placeholder="请输入手机号" /><text wx:if="{{phoneVerified}}" class="verified-tip">手机号已验证</text></view>
<view class="field"><text class="field-label">验证码</text><view class="code-row"><input class="code-input" value="{{form.code}}" data-field="code" bindinput="onInput" type="number" placeholder="请输入6位验证码" /><button class="code-btn {{countdown > 0 ? 'counting' : ''}}" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendCode"><text wx:if="{{countdown > 0}}">{{countdown}}s 后重发</text><text wx:else>{{codeSent ? '重新获取' : '获取验证码'}}</text></button></view></view>
<view class="agreement-row" bindtap="toggleAgreement"><view class="agreement-check {{agreementAccepted ? 'checked' : ''}}">{{agreementAccepted ? '✓' : ''}}</view><view class="agreement-copy">我已阅读并同意《用户协议》和《隐私政策》</view></view><view class="secondary-entry" bindtap="togglePasswordMode">使用密码注册 <text>›</text></view>
<view wx:if="{{passwordMode}}" class="password-panel"><view class="field"><text class="field-label">设置密码</text><input value="{{form.password}}" data-field="password" bindinput="onInput" password placeholder="至少8位密码" /></view><view class="field"><text class="field-label">确认密码</text><input value="{{form.confirmPassword}}" data-field="confirmPassword" bindinput="onInput" password placeholder="再次输入密码" /></view></view>
<button class="primary-btn" loading="{{loading}}" bindtap="continueFromPhone">继续</button>
</view>
@@ -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 注入,不写入本文档。
## 验证
@@ -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"
+6 -6
View File
@@ -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),
@@ -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;
@@ -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
@@ -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}
@@ -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}
@@ -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}