Merge pull request 'Dev合并到Sit' (#54) from dev into sit
Reviewed-on: http://wcy111.top:3000/xiaowang/JayuCloud/pulls/54
This commit was merged in pull request #54.
This commit is contained in:
@@ -1,138 +1 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/jayucloud_artlist?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
|
||||
|
||||
fingertip-designer:
|
||||
brand:
|
||||
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:FingertipDesigner}
|
||||
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
|
||||
security:
|
||||
jwt:
|
||||
issuer: fingertip-designer
|
||||
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
|
||||
max-connections-per-route: 50
|
||||
|
||||
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: fingertip-designer.file.object-storage.backup.queue
|
||||
backup-exchange-name: fingertip-designer.file.object-storage.backup.exchange
|
||||
backup-routing-key: fingertip-designer.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:}
|
||||
domain: ${QINIU_KODO_DOMAIN:}
|
||||
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:}
|
||||
bucket-name: ${MINIO_BUCKET_NAME:}
|
||||
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:}
|
||||
region: ${ALIYUN_OSS_REGION:}
|
||||
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:}
|
||||
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}
|
||||
# 除 bootstrap.yaml 中的 Nacos 启动引导参数外,后端运行参数统一由 Nacos 配置源管理。
|
||||
|
||||
@@ -5,29 +5,29 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# Nacos 集群地址,默认指向开发环境,生产环境通过环境变量覆盖。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.10.11:8848,192.168.10.12:8848,192.168.10.13:8848}
|
||||
# Nacos 命名空间,默认指向开发环境。
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-artlist}
|
||||
# Nacos 启动引导地址固定指向开发配置中心。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 启动引导命名空间。
|
||||
namespace: jayucloud-artlist
|
||||
# 服务注册分组。
|
||||
group: DEFAULT_GROUP
|
||||
# 注册到 Nacos 的服务名。
|
||||
service: ${spring.application.name}
|
||||
service: jc-artlist-core
|
||||
# 是否启用服务发现。
|
||||
enabled: true
|
||||
# 是否将当前服务注册到 Nacos。
|
||||
register-enabled: true
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD}
|
||||
password: 122503wcy....
|
||||
config:
|
||||
# Nacos 配置中心地址,与服务发现使用同一组集群节点,默认指向开发环境。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.10.11:8848,192.168.10.12:8848,192.168.10.13:8848}
|
||||
# Nacos 配置中心命名空间,默认指向开发环境。
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-artlist}
|
||||
# Nacos 配置中心地址,与服务发现使用同一开发节点。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 配置中心命名空间。
|
||||
namespace: jayucloud-artlist
|
||||
# 配置分组。
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
# Core 服务独有配置文件。
|
||||
name: core
|
||||
# 所有 Nacos 配置均使用 YAML。
|
||||
@@ -35,17 +35,17 @@ spring:
|
||||
# 是否启用配置中心。
|
||||
enabled: true
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD}
|
||||
password: 122503wcy....
|
||||
# Core 与 Gateway 共享的公共配置文件。
|
||||
shared-configs:
|
||||
- data-id: infra.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: secret.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: logging.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
|
||||
@@ -1,132 +1 @@
|
||||
spring:
|
||||
cloud:
|
||||
gateway:
|
||||
routes:
|
||||
# 前台API路由
|
||||
- id: product-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/product/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: product-like-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/product-like/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: shop-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/shop/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: user-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/user/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: comment-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/comment/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: balance-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/balance/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: tag-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/tag/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: file-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/file/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: permission-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/permission/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: coupon-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/coupon/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: cart-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/cart/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: order-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/order/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: wishlist-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/wishlist/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: nail-artist-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/nail-artist/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: legal-agreement-route
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/legal-agreement/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
# 前台API兜底路由,避免 Core 新增模块后 Gateway 未同步导致 404
|
||||
- id: frontend-fallback-route
|
||||
order: 100
|
||||
uri: lb://jc-artlist-core
|
||||
predicates:
|
||||
- Path=/api/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
|
||||
fingertip-designer:
|
||||
security:
|
||||
jwt:
|
||||
issuer: fingertip-designer
|
||||
clock-skew-seconds: 30
|
||||
gateway:
|
||||
whitelist:
|
||||
- /api/user/login
|
||||
- /api/user/register
|
||||
- /api/user/check/**
|
||||
- /api/user/refresh-token
|
||||
- /api/user/send-verification-code
|
||||
- /api/user/phone-login
|
||||
- /api/user/wechat-mini/**
|
||||
- /api/user/reset-password-by-phone
|
||||
- /api/nail-artist/profile/**
|
||||
- /api/nail-artist/*/availability
|
||||
- /api/nail-artist/*/reviews
|
||||
- /api/shop/list
|
||||
- /api/shop/list/simple
|
||||
- /api/legal-agreement/current
|
||||
- /api/legal-agreement/current/**
|
||||
- /api/health/**
|
||||
- /api/error
|
||||
slow-request:
|
||||
enabled: true
|
||||
threshold-ms: 300
|
||||
log-response-header-request-id: true
|
||||
# 除 bootstrap.yaml 中的 Nacos 启动引导参数外,Gateway 路由与运行参数统一由 Nacos 配置源管理。
|
||||
|
||||
@@ -5,41 +5,41 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# Nacos 集群地址,默认指向开发环境,生产环境通过环境变量覆盖。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.10.11:8848,192.168.10.12:8848,192.168.10.13:8848}
|
||||
# Nacos 命名空间,默认指向开发环境
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-artlist}
|
||||
# Nacos 启动引导地址固定指向开发配置中心。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 启动引导命名空间。
|
||||
namespace: jayucloud-artlist
|
||||
# 服务注册分组。
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
# 注册到 Nacos 的服务名。
|
||||
service: ${spring.application.name}
|
||||
service: jc-artlist-gateway
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD}
|
||||
password: 122503wcy....
|
||||
config:
|
||||
# Nacos 配置中心地址,与服务发现使用同一组集群节点,默认指向开发环境。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.10.11:8848,192.168.10.12:8848,192.168.10.13:8848}
|
||||
# Nacos 配置中心命名空间,默认指向开发环境。
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-artlist}
|
||||
# Nacos 配置中心地址,与服务发现使用同一开发节点。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 配置中心命名空间。
|
||||
namespace: jayucloud-artlist
|
||||
# 配置分组。
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
# Gateway 服务独有配置文件。
|
||||
name: gateway
|
||||
# 所有 Nacos 配置均使用 YAML。
|
||||
file-extension: yaml
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD}
|
||||
password: 122503wcy....
|
||||
# Core 与 Gateway 共享的公共配置文件。
|
||||
shared-configs:
|
||||
- data-id: infra.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: secret.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: logging.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
|
||||
+5
-1
@@ -44,7 +44,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
"/user/refresh-token",
|
||||
"/user/send-verification-code",
|
||||
"/user/phone-login",
|
||||
"/user/wechat-mini/**",
|
||||
"/user/wechat-mini/auto-login",
|
||||
"/user/wechat-mini/phone-login",
|
||||
"/user/wechat-mini/confirm-login",
|
||||
"/user/wechat-mini/status",
|
||||
"/user/wechat-mini/quick-login",
|
||||
"/user/workbench/register/**",
|
||||
"/user/workbench/shops/available",
|
||||
"/user/reset-password-by-phone",
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.xiaowang.jacyucloudsalon.core.modules.integration.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/** 微信小程序一键绑定手机号请求。 */
|
||||
@Data
|
||||
public class WechatMiniBindPhoneRequestDTO {
|
||||
@NotBlank(message = "微信手机号凭证不能为空")
|
||||
private String phoneCode;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.xiaowang.jacyucloudsalon.core.modules.integration.dto;
|
||||
|
||||
import com.xiaowang.jacyucloudsalon.core.common.dto.AgreementAwareRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Map;
|
||||
|
||||
/** 微信小程序 OpenID 快捷登录请求。 */
|
||||
@Data
|
||||
public class WechatMiniQuickLoginRequestDTO implements AgreementAwareRequest {
|
||||
@NotBlank(message = "微信登录凭证不能为空")
|
||||
private String wxCode;
|
||||
private Long preferredShopId;
|
||||
private Boolean agreementAccepted;
|
||||
private Map<String, String> agreementVersions;
|
||||
private String clientType;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.xiaowang.jacyucloudsalon.core.modules.integration.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/** 仅供后端消费的微信注册票据载荷。 */
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WechatMiniRegistrationTicket {
|
||||
private Long userId;
|
||||
private String appId;
|
||||
private String openId;
|
||||
}
|
||||
+11
@@ -3,6 +3,9 @@ package com.xiaowang.jacyucloudsalon.core.modules.integration.service;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniAutoLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniConfirmLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniPhoneLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniQuickLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniBindPhoneRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniRegistrationTicket;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.vo.WechatMiniLoginResultVO;
|
||||
|
||||
/**
|
||||
@@ -10,6 +13,14 @@ import com.xiaowang.jacyucloudsalon.core.modules.integration.vo.WechatMiniLoginR
|
||||
*/
|
||||
public interface WechatMiniAuthService {
|
||||
|
||||
WechatMiniLoginResultVO status(WechatMiniAutoLoginRequestDTO requestDTO);
|
||||
|
||||
WechatMiniLoginResultVO quickLogin(WechatMiniQuickLoginRequestDTO requestDTO);
|
||||
|
||||
boolean bindPhone(Long userId, WechatMiniBindPhoneRequestDTO requestDTO);
|
||||
|
||||
WechatMiniRegistrationTicket consumeRegistrationTicket(String ticket);
|
||||
|
||||
/**
|
||||
* Run business method `autoLogin`.
|
||||
* Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result.
|
||||
|
||||
+175
@@ -8,6 +8,12 @@ import com.xiaowang.jacyucloudsalon.core.common.BusinessException;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniAutoLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniConfirmLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniPhoneLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniQuickLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniBindPhoneRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniRegistrationTicket;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationApplicationDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationStatus;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.mapper.WorkbenchRegistrationApplicationMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.entity.UserDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.entity.WechatMiniBindingDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.mapper.UserMapper;
|
||||
@@ -54,6 +60,7 @@ public class WechatMiniAuthServiceImpl implements WechatMiniAuthService {
|
||||
* Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state.
|
||||
*/
|
||||
private static final String TICKET_KEY_PREFIX = "user:wechat-mini:login-ticket:";
|
||||
private static final String REGISTRATION_TICKET_KEY_PREFIX = "user:wechat-mini:registration-ticket:";
|
||||
private static final Duration TICKET_TTL = Duration.ofMinutes(5);
|
||||
/**
|
||||
* Variable `wechatMiniClientService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls.
|
||||
@@ -87,6 +94,124 @@ public class WechatMiniAuthServiceImpl implements WechatMiniAuthService {
|
||||
* Variable `snowflakeIdGenerator`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls.
|
||||
*/
|
||||
private final TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator;
|
||||
private final WorkbenchRegistrationApplicationMapper registrationApplicationMapper;
|
||||
|
||||
@Override
|
||||
public WechatMiniLoginResultVO status(WechatMiniAutoLoginRequestDTO requestDTO) {
|
||||
WechatMiniClientService.SessionInfo sessionInfo = wechatMiniClientService.code2Session(requestDTO.getWxCode());
|
||||
WechatMiniBindingDO binding = findAnyBindingByOpenId(sessionInfo.openId());
|
||||
if (binding == null) {
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_NEW_USER, "当前微信尚未申请使用");
|
||||
}
|
||||
if (!Integer.valueOf(1).equals(binding.getStatus())) {
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_DISABLED, "微信身份关联已停用,请联系管理员");
|
||||
}
|
||||
UserDO user = userMapper.selectById(binding.getUserId());
|
||||
if (user == null || Integer.valueOf(1).equals(user.getIsDelete())) {
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_DISABLED, "账号已失效,请联系管理员");
|
||||
}
|
||||
WorkbenchRegistrationApplicationDO application = findLatestApplication(user.getId());
|
||||
if (application != null && WorkbenchRegistrationStatus.REJECTED.equals(application.getStatus())) {
|
||||
return applicationState(WechatMiniLoginResultVO.STATUS_REJECTED, "申请已被驳回,可修改后重新提交", application);
|
||||
}
|
||||
if (application != null && (WorkbenchRegistrationStatus.PENDING_ADMIN.equals(application.getStatus())
|
||||
|| WorkbenchRegistrationStatus.PENDING_MANAGER.equals(application.getStatus()))) {
|
||||
return applicationState(WechatMiniLoginResultVO.STATUS_PENDING_REVIEW, "申请审核中", application);
|
||||
}
|
||||
if (Integer.valueOf(1).equals(user.getStatus())) {
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_READY, "账号可以登录");
|
||||
}
|
||||
if (Integer.valueOf(0).equals(user.getType()) && application == null) {
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_NEW_USER, "请继续完成身份申请");
|
||||
}
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_DISABLED, "账号已停用,请联系管理员");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public WechatMiniLoginResultVO quickLogin(WechatMiniQuickLoginRequestDTO requestDTO) {
|
||||
WechatMiniClientService.SessionInfo sessionInfo = wechatMiniClientService.code2Session(requestDTO.getWxCode());
|
||||
WechatMiniBindingDO binding = findAnyBindingByOpenId(sessionInfo.openId());
|
||||
if (binding == null) {
|
||||
UserDO user = new UserDO();
|
||||
user.setNickname("微信用户" + snowflakeIdGenerator.nextIdString().substring(13));
|
||||
user.setType(0);
|
||||
user.setStatus(0);
|
||||
user.setPhoneVerified(0);
|
||||
user.setEmailVerified(0);
|
||||
user.setIsDelete(0);
|
||||
userMapper.insert(user);
|
||||
ensureBinding(user.getId(), sessionInfo.openId(), sessionInfo.unionId());
|
||||
return registrationResult(user.getId(), sessionInfo.openId(), null);
|
||||
}
|
||||
if (!Integer.valueOf(1).equals(binding.getStatus())) {
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_DISABLED, "微信身份关联已停用,请联系管理员");
|
||||
}
|
||||
|
||||
UserDO user = userMapper.selectById(binding.getUserId());
|
||||
if (user == null || Integer.valueOf(1).equals(user.getIsDelete())) {
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_DISABLED, "账号已失效,请联系管理员");
|
||||
}
|
||||
WorkbenchRegistrationApplicationDO application = findLatestApplication(user.getId());
|
||||
if (application != null && WorkbenchRegistrationStatus.REJECTED.equals(application.getStatus())) {
|
||||
return registrationResult(user.getId(), sessionInfo.openId(), application);
|
||||
}
|
||||
if (application != null && (WorkbenchRegistrationStatus.PENDING_ADMIN.equals(application.getStatus())
|
||||
|| WorkbenchRegistrationStatus.PENDING_MANAGER.equals(application.getStatus()))) {
|
||||
return applicationState(WechatMiniLoginResultVO.STATUS_PENDING_REVIEW, "申请审核中", application);
|
||||
}
|
||||
if (!Integer.valueOf(1).equals(user.getStatus())) {
|
||||
if (Integer.valueOf(0).equals(user.getType()) && application == null) {
|
||||
return registrationResult(user.getId(), sessionInfo.openId(), null);
|
||||
}
|
||||
return WechatMiniLoginResultVO.state(WechatMiniLoginResultVO.STATUS_DISABLED, "账号已停用,请联系管理员");
|
||||
}
|
||||
return loginOrSelectShop(user, normalizeShopId(requestDTO.getPreferredShopId()), sessionInfo, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean bindPhone(Long userId, WechatMiniBindPhoneRequestDTO requestDTO) {
|
||||
UserDO user = userMapper.selectById(userId);
|
||||
if (user == null || Integer.valueOf(1).equals(user.getIsDelete())) {
|
||||
throw new BusinessException("用户不存在");
|
||||
}
|
||||
String phone = normalizePhone(wechatMiniClientService.getPhoneNumber(requestDTO.getPhoneCode()));
|
||||
if (!phone.matches(PHONE_REGEX)) {
|
||||
throw new BusinessException("获取到的微信手机号格式不正确");
|
||||
}
|
||||
UserDO occupied = findActiveUserByPhone(phone);
|
||||
if (occupied != null && !Objects.equals(occupied.getId(), userId)) {
|
||||
throw new BusinessException("该手机号已被其他账号绑定");
|
||||
}
|
||||
user.setPhone(phone);
|
||||
user.setPhoneVerified(1);
|
||||
userMapper.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WechatMiniRegistrationTicket consumeRegistrationTicket(String ticket) {
|
||||
if (!StringUtils.hasText(ticket)) {
|
||||
throw new BusinessException("注册票据不能为空");
|
||||
}
|
||||
String key = REGISTRATION_TICKET_KEY_PREFIX + ticket;
|
||||
String payload = redisTemplate.opsForValue().get(key);
|
||||
if (!StringUtils.hasText(payload) || !Boolean.TRUE.equals(redisTemplate.delete(key))) {
|
||||
throw new BusinessException("注册票据已失效,请重新发起快捷登录");
|
||||
}
|
||||
try {
|
||||
WechatMiniRegistrationTicket value = objectMapper.readValue(payload, WechatMiniRegistrationTicket.class);
|
||||
WechatMiniBindingDO binding = findBindingByOpenId(value.getOpenId());
|
||||
if (binding == null || !Objects.equals(binding.getUserId(), value.getUserId())
|
||||
|| !Objects.equals(value.getAppId(), wechatMiniClientService.getConfiguredAppId())) {
|
||||
throw new BusinessException("注册票据与微信身份不匹配");
|
||||
}
|
||||
return value;
|
||||
} catch (JsonProcessingException exception) {
|
||||
throw new BusinessException("解析微信注册票据失败", exception);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
@@ -225,6 +350,46 @@ public class WechatMiniAuthServiceImpl implements WechatMiniAuthService {
|
||||
);
|
||||
}
|
||||
|
||||
private WorkbenchRegistrationApplicationDO findLatestApplication(Long userId) {
|
||||
return registrationApplicationMapper.selectOne(
|
||||
new LambdaQueryWrapper<WorkbenchRegistrationApplicationDO>()
|
||||
.eq(WorkbenchRegistrationApplicationDO::getUserId, userId)
|
||||
.eq(WorkbenchRegistrationApplicationDO::getIsDelete, 0)
|
||||
.orderByDesc(WorkbenchRegistrationApplicationDO::getCreateTime)
|
||||
.last("limit 1")
|
||||
);
|
||||
}
|
||||
|
||||
private WechatMiniLoginResultVO applicationState(String status, String message,
|
||||
WorkbenchRegistrationApplicationDO application) {
|
||||
WechatMiniLoginResultVO result = WechatMiniLoginResultVO.state(status, message);
|
||||
result.setRegistrationStatus(application.getStatus());
|
||||
result.setRegistrationRejectReason(application.getRejectReason());
|
||||
result.setRegistrationApplicationId(application.getId());
|
||||
return result;
|
||||
}
|
||||
|
||||
private WechatMiniLoginResultVO registrationResult(Long userId, String openId,
|
||||
WorkbenchRegistrationApplicationDO application) {
|
||||
WechatMiniRegistrationTicket payload = new WechatMiniRegistrationTicket(
|
||||
userId, wechatMiniClientService.getConfiguredAppId(), openId);
|
||||
String ticket = "wxreg_" + snowflakeIdGenerator.nextIdString();
|
||||
try {
|
||||
redisTemplate.opsForValue().set(REGISTRATION_TICKET_KEY_PREFIX + ticket,
|
||||
objectMapper.writeValueAsString(payload), TICKET_TTL);
|
||||
} catch (JsonProcessingException exception) {
|
||||
throw new BusinessException("生成微信注册票据失败", exception);
|
||||
}
|
||||
WechatMiniLoginResultVO result = WechatMiniLoginResultVO.registration(
|
||||
ticket,
|
||||
application == null ? null : application.getStatus(),
|
||||
application == null ? null : application.getRejectReason(),
|
||||
application == null ? null : application.getId()
|
||||
);
|
||||
result.setConsentUserId(userId);
|
||||
return result;
|
||||
}
|
||||
|
||||
private WechatMiniLoginResultVO loginOrSelectShop(
|
||||
UserDO userDO,
|
||||
Long preferredShopId,
|
||||
@@ -359,6 +524,16 @@ public class WechatMiniAuthServiceImpl implements WechatMiniAuthService {
|
||||
);
|
||||
}
|
||||
|
||||
private WechatMiniBindingDO findAnyBindingByOpenId(String openId) {
|
||||
return wechatMiniBindingMapper.selectOne(
|
||||
new LambdaQueryWrapper<WechatMiniBindingDO>()
|
||||
.eq(WechatMiniBindingDO::getAppId, wechatMiniClientService.getConfiguredAppId())
|
||||
.eq(WechatMiniBindingDO::getOpenId, openId)
|
||||
.orderByDesc(WechatMiniBindingDO::getStatus)
|
||||
.last("limit 1")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* List records for the current query or current user scope.
|
||||
* Call guide: pass the named parameters below from the controller or caller; the method validates them and returns the business result.
|
||||
|
||||
+28
@@ -1,5 +1,6 @@
|
||||
package com.xiaowang.jacyucloudsalon.core.modules.integration.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,6 +28,12 @@ public class WechatMiniLoginResultVO {
|
||||
* Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state.
|
||||
*/
|
||||
public static final String STATUS_NEED_MANUAL_LOGIN = "NEED_MANUAL_LOGIN";
|
||||
public static final String STATUS_NEW_USER = "NEW_USER";
|
||||
public static final String STATUS_NEED_REGISTRATION = "NEED_REGISTRATION";
|
||||
public static final String STATUS_PENDING_REVIEW = "PENDING_REVIEW";
|
||||
public static final String STATUS_REJECTED = "REJECTED";
|
||||
public static final String STATUS_READY = "READY";
|
||||
public static final String STATUS_DISABLED = "DISABLED";
|
||||
|
||||
/**
|
||||
* Field `status` (String): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled.
|
||||
@@ -72,6 +79,27 @@ public class WechatMiniLoginResultVO {
|
||||
private String registrationStatus;
|
||||
private String registrationRejectReason;
|
||||
private Long registrationApplicationId;
|
||||
@JsonIgnore
|
||||
private Long consentUserId;
|
||||
|
||||
public static WechatMiniLoginResultVO state(String status, String message) {
|
||||
WechatMiniLoginResultVO result = new WechatMiniLoginResultVO();
|
||||
result.setStatus(status);
|
||||
result.setMessage(message);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static WechatMiniLoginResultVO registration(String ticket, String registrationStatus,
|
||||
String rejectReason, Long applicationId) {
|
||||
WechatMiniLoginResultVO result = state(STATUS_NEED_REGISTRATION, "请完善身份和门店资料并提交审核");
|
||||
result.setNewUser(true);
|
||||
result.setRegistrationRequired(true);
|
||||
result.setRegistrationTicket(ticket);
|
||||
result.setRegistrationStatus(registrationStatus);
|
||||
result.setRegistrationRejectReason(rejectReason);
|
||||
result.setRegistrationApplicationId(applicationId);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: success supports WechatMiniLoginResultVO.java by holding or executing the success business role.
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class WorkbenchRegistrationController {
|
||||
this.shopMapper = shopMapper;
|
||||
}
|
||||
|
||||
@PostMapping("/register/phone")
|
||||
@PostMapping({"/register/phone", "/register/wechat-mini"})
|
||||
public Result<WorkbenchRegistrationStatusVO> registerByPhone(@RequestBody WorkbenchRegistrationRequestDTO request) {
|
||||
return Result.success(registrationService.register(request));
|
||||
}
|
||||
|
||||
-5
@@ -8,11 +8,6 @@ import lombok.Setter;
|
||||
public class WorkbenchRegistrationRequestDTO {
|
||||
private Long applicationId;
|
||||
private String registrationTicket;
|
||||
private String wxCode;
|
||||
private String phone;
|
||||
private String verificationCode;
|
||||
private String password;
|
||||
private String confirmPassword;
|
||||
private String roleType;
|
||||
private Long shopId;
|
||||
private String shopName;
|
||||
|
||||
+46
-105
@@ -1,9 +1,6 @@
|
||||
package com.xiaowang.jacyucloudsalon.core.modules.registration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.auth.service.VerificationCodeService;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.auth.service.PhoneRegistrationTicketService;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.auth.vo.PhoneRegistrationTicketVO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.dto.WorkbenchRegistrationRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationApplicationDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRegistrationRole;
|
||||
@@ -11,9 +8,8 @@ import com.xiaowang.jacyucloudsalon.core.modules.registration.entity.WorkbenchRe
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.mapper.WorkbenchRegistrationApplicationMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.service.WorkbenchRegistrationService;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.vo.WorkbenchRegistrationStatusVO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.entity.WechatMiniBindingDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.mapper.WechatMiniBindingMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.service.WechatMiniClientService;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.service.WechatMiniAuthService;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniRegistrationTicket;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.shop.entity.ShopDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.shop.mapper.ShopMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.shop.support.UserShopBindingSupport;
|
||||
@@ -22,7 +18,6 @@ import com.xiaowang.jacyucloudsalon.core.modules.shop.mapper.UserShopBindingMapp
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.entity.UserDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.mapper.UserMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.service.UserService;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -33,106 +28,93 @@ import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationService {
|
||||
private static final String REGISTER_SCENE = "PLANNING_MANAGER_REGISTER";
|
||||
private final WorkbenchRegistrationApplicationMapper applicationMapper;
|
||||
private final UserMapper userMapper;
|
||||
private final ShopMapper shopMapper;
|
||||
private final UserService userService;
|
||||
private final VerificationCodeService verificationCodeService;
|
||||
private final PhoneRegistrationTicketService phoneRegistrationTicketService;
|
||||
private final UserShopBindingSupport userShopBindingSupport;
|
||||
private final UserShopBindingMapper userShopBindingMapper;
|
||||
private final WechatMiniBindingMapper wechatMiniBindingMapper;
|
||||
private final WechatMiniClientService wechatMiniClientService;
|
||||
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
private final WechatMiniAuthService wechatMiniAuthService;
|
||||
|
||||
public WorkbenchRegistrationServiceImpl(
|
||||
WorkbenchRegistrationApplicationMapper applicationMapper,
|
||||
UserMapper userMapper,
|
||||
ShopMapper shopMapper,
|
||||
UserService userService,
|
||||
VerificationCodeService verificationCodeService,
|
||||
PhoneRegistrationTicketService phoneRegistrationTicketService,
|
||||
UserShopBindingSupport userShopBindingSupport,
|
||||
UserShopBindingMapper userShopBindingMapper,
|
||||
WechatMiniBindingMapper wechatMiniBindingMapper,
|
||||
WechatMiniClientService wechatMiniClientService
|
||||
WechatMiniAuthService wechatMiniAuthService
|
||||
) {
|
||||
this.applicationMapper = applicationMapper;
|
||||
this.userMapper = userMapper;
|
||||
this.shopMapper = shopMapper;
|
||||
this.userService = userService;
|
||||
this.verificationCodeService = verificationCodeService;
|
||||
this.phoneRegistrationTicketService = phoneRegistrationTicketService;
|
||||
this.userShopBindingSupport = userShopBindingSupport;
|
||||
this.userShopBindingMapper = userShopBindingMapper;
|
||||
this.wechatMiniBindingMapper = wechatMiniBindingMapper;
|
||||
this.wechatMiniClientService = wechatMiniClientService;
|
||||
this.wechatMiniAuthService = wechatMiniAuthService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public WorkbenchRegistrationStatusVO register(WorkbenchRegistrationRequestDTO request) {
|
||||
require(request != null, "注册信息不能为空");
|
||||
String phone = requireText(request.getPhone(), "手机号不能为空");
|
||||
PhoneRegistrationTicketVO ticket = null;
|
||||
if (StringUtils.hasText(request.getRegistrationTicket())) {
|
||||
ticket = phoneRegistrationTicketService.consume(request.getRegistrationTicket(), phone);
|
||||
phone = ticket.getPhone();
|
||||
} else {
|
||||
require(verificationCodeService.verifyCode(phone, request.getVerificationCode()), "验证码错误或已过期");
|
||||
}
|
||||
String roleType = requireText(request.getRoleType(), "请选择注册身份").toUpperCase();
|
||||
require(WorkbenchRegistrationRole.MANAGER.equals(roleType) || WorkbenchRegistrationRole.STAFF.equals(roleType), "注册身份不合法");
|
||||
require(request.getAgreementAccepted() == null || request.getAgreementAccepted(), "请先同意用户协议和隐私政策");
|
||||
UserDO existing = userMapper.selectOne(Wrappers.lambdaQuery(UserDO.class).eq(UserDO::getPhone, phone).eq(UserDO::getIsDelete, 0).last("limit 1"));
|
||||
if (ticket != null) {
|
||||
require(ticket.getUserId() == null || existing != null && ticket.getUserId().equals(existing.getId()), "手机号注册凭证与账号不匹配");
|
||||
|
||||
String managerShopName = WorkbenchRegistrationRole.MANAGER.equals(roleType)
|
||||
? requireText(request.getShopName(), "店铺名称不能为空") : null;
|
||||
ShopDO selectedStaffShop = null;
|
||||
if (WorkbenchRegistrationRole.STAFF.equals(roleType)) {
|
||||
require(request.getShopId() != null, "请选择要加入的店铺");
|
||||
selectedStaffShop = shopMapper.selectOne(Wrappers.lambdaQuery(ShopDO.class).eq(ShopDO::getId, request.getShopId()).eq(ShopDO::getStatus, 1).eq(ShopDO::getIsDelete, 0));
|
||||
require(selectedStaffShop != null, "店铺不存在或暂未营业");
|
||||
}
|
||||
|
||||
WechatMiniRegistrationTicket ticket = wechatMiniAuthService.consumeRegistrationTicket(
|
||||
requireText(request.getRegistrationTicket(), "注册票据不能为空"));
|
||||
UserDO user = userMapper.selectById(ticket.getUserId());
|
||||
require(user != null && !Integer.valueOf(1).equals(user.getIsDelete()), "注册用户不存在");
|
||||
|
||||
WorkbenchRegistrationApplicationDO application = request.getApplicationId() == null
|
||||
? findLatest(user.getId()) : applicationMapper.selectById(request.getApplicationId());
|
||||
if (application != null) {
|
||||
require(user.getId().equals(application.getUserId()), "注册申请与账号不匹配");
|
||||
require(WorkbenchRegistrationStatus.REJECTED.equals(application.getStatus()), "该注册申请当前不可重新提交");
|
||||
} else {
|
||||
require(existing == null, "该手机号已注册,请直接登录或查看审核状态");
|
||||
}
|
||||
boolean passwordProvided = StringUtils.hasText(request.getPassword()) || StringUtils.hasText(request.getConfirmPassword());
|
||||
if (ticket == null) {
|
||||
require(passwordProvided, "密码不能为空");
|
||||
}
|
||||
if (passwordProvided) {
|
||||
require(request.getPassword().equals(request.getConfirmPassword()), "两次密码不一致");
|
||||
application = new WorkbenchRegistrationApplicationDO();
|
||||
}
|
||||
|
||||
ShopDO shop = null;
|
||||
if (WorkbenchRegistrationRole.MANAGER.equals(roleType)) {
|
||||
String shopName = requireText(request.getShopName(), "店铺名称不能为空");
|
||||
shop = new ShopDO();
|
||||
shop.setShopName(shopName);
|
||||
shop = WorkbenchRegistrationRole.MANAGER.equals(application.getRoleType()) && application.getShopId() != null
|
||||
? shopMapper.selectById(application.getShopId()) : null;
|
||||
if (shop == null) {
|
||||
shop = new ShopDO();
|
||||
}
|
||||
shop.setShopName(managerShopName);
|
||||
shop.setAddress(request.getShopAddress());
|
||||
shop.setDescription("Salon店务工作台注册申请");
|
||||
shop.setBusinessHours("10:00-22:00");
|
||||
shop.setStatus(0);
|
||||
shop.setIsDelete(0);
|
||||
shopMapper.insert(shop);
|
||||
if (shop.getId() == null) {
|
||||
shopMapper.insert(shop);
|
||||
} else {
|
||||
shopMapper.updateById(shop);
|
||||
}
|
||||
} else {
|
||||
require(request.getShopId() != null, "请选择要加入的店铺");
|
||||
shop = shopMapper.selectOne(Wrappers.lambdaQuery(ShopDO.class).eq(ShopDO::getId, request.getShopId()).eq(ShopDO::getStatus, 1).eq(ShopDO::getIsDelete, 0));
|
||||
require(shop != null, "店铺不存在或暂未营业");
|
||||
shop = selectedStaffShop;
|
||||
}
|
||||
|
||||
UserDO user = existing == null ? new UserDO() : existing;
|
||||
user.setShopId(shop.getId());
|
||||
user.setNickname((WorkbenchRegistrationRole.MANAGER.equals(roleType) ? shop.getShopName() + "店长" : "Salon店员"));
|
||||
user.setAccount(phone);
|
||||
user.setPassword(passwordProvided ? passwordEncoder.encode(request.getPassword()) : "$2a$10$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW");
|
||||
user.setPhone(phone);
|
||||
user.setContactPhone(phone);
|
||||
user.setPhoneVerified(1);
|
||||
if (!StringUtils.hasText(user.getNickname()) || user.getNickname().startsWith("微信用户")) {
|
||||
user.setNickname(WorkbenchRegistrationRole.MANAGER.equals(roleType) ? shop.getShopName() + "店长" : "Salon店员");
|
||||
}
|
||||
user.setType(WorkbenchRegistrationRole.MANAGER.equals(roleType) ? 2 : 3);
|
||||
user.setStatus(0);
|
||||
user.setIsDelete(0);
|
||||
if (existing == null) {
|
||||
userMapper.insert(user);
|
||||
} else {
|
||||
userMapper.updateById(user);
|
||||
}
|
||||
bindWechatUser(request.getWxCode(), user.getId());
|
||||
userMapper.updateById(user);
|
||||
if (WorkbenchRegistrationRole.MANAGER.equals(roleType)) {
|
||||
createPendingBinding(user.getId(), shop.getId());
|
||||
} else {
|
||||
@@ -140,13 +122,6 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe
|
||||
userShopBindingSupport.updateBindingStatus(user.getId(), shop.getId(), 0);
|
||||
}
|
||||
|
||||
WorkbenchRegistrationApplicationDO application = ticket == null || ticket.getApplicationId() == null
|
||||
? new WorkbenchRegistrationApplicationDO()
|
||||
: applicationMapper.selectById(ticket.getApplicationId());
|
||||
if (application.getId() != null) {
|
||||
require(existing != null && existing.getId().equals(application.getUserId()), "注册申请与账号不匹配");
|
||||
require(WorkbenchRegistrationStatus.REJECTED.equals(application.getStatus()), "该注册申请当前不可重新提交");
|
||||
}
|
||||
if (!StringUtils.hasText(application.getApplicationNo())) {
|
||||
application.setApplicationNo("SALON-" + UUID.randomUUID().toString().replace("-", "").substring(0, 20).toUpperCase());
|
||||
}
|
||||
@@ -156,6 +131,9 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe
|
||||
application.setShopName(shop.getShopName());
|
||||
application.setShopAddress(shop.getAddress());
|
||||
application.setStatus(WorkbenchRegistrationRole.MANAGER.equals(roleType) ? WorkbenchRegistrationStatus.PENDING_ADMIN : WorkbenchRegistrationStatus.PENDING_MANAGER);
|
||||
application.setRejectReason(null);
|
||||
application.setReviewerId(null);
|
||||
application.setReviewedAt(null);
|
||||
application.setIsDelete(0);
|
||||
if (application.getId() == null) {
|
||||
applicationMapper.insert(application);
|
||||
@@ -176,22 +154,7 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public WorkbenchRegistrationStatusVO resubmit(WorkbenchRegistrationRequestDTO request) {
|
||||
require(request != null && request.getApplicationId() != null, "申请信息不能为空");
|
||||
WorkbenchRegistrationApplicationDO application = applicationMapper.selectById(request.getApplicationId());
|
||||
require(application != null && WorkbenchRegistrationStatus.REJECTED.equals(application.getStatus()), "该申请当前不可重新提交");
|
||||
String phone = requireText(request.getPhone(), "手机号不能为空");
|
||||
if (StringUtils.hasText(request.getRegistrationTicket())) {
|
||||
PhoneRegistrationTicketVO ticket = phoneRegistrationTicketService.consume(request.getRegistrationTicket(), phone);
|
||||
require(ticket.getApplicationId() != null && ticket.getApplicationId().equals(application.getId()), "手机号注册凭证与申请不匹配");
|
||||
require(ticket.getUserId() == null || ticket.getUserId().equals(application.getUserId()), "手机号注册凭证与账号不匹配");
|
||||
} else {
|
||||
require(verificationCodeService.verifyCode(phone, request.getVerificationCode()), "验证码错误或已过期");
|
||||
}
|
||||
application.setStatus(WorkbenchRegistrationRole.MANAGER.equals(application.getRoleType()) ? WorkbenchRegistrationStatus.PENDING_ADMIN : WorkbenchRegistrationStatus.PENDING_MANAGER);
|
||||
application.setRejectReason(null);
|
||||
application.setReviewerId(null);
|
||||
application.setReviewedAt(null);
|
||||
applicationMapper.updateById(application);
|
||||
return toStatus(application);
|
||||
return register(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,28 +248,6 @@ public class WorkbenchRegistrationServiceImpl implements WorkbenchRegistrationSe
|
||||
userShopBindingMapper.updateById(binding);
|
||||
}
|
||||
|
||||
private void bindWechatUser(String wxCode, Long userId) {
|
||||
if (!StringUtils.hasText(wxCode)) {
|
||||
return;
|
||||
}
|
||||
WechatMiniClientService.SessionInfo sessionInfo = wechatMiniClientService.code2Session(wxCode);
|
||||
String appId = wechatMiniClientService.getConfiguredAppId();
|
||||
WechatMiniBindingDO binding = wechatMiniBindingMapper.selectOne(Wrappers.lambdaQuery(WechatMiniBindingDO.class).eq(WechatMiniBindingDO::getAppId, appId).eq(WechatMiniBindingDO::getOpenId, sessionInfo.openId()).last("limit 1"));
|
||||
if (binding == null) {
|
||||
binding = new WechatMiniBindingDO();
|
||||
binding.setAppId(appId);
|
||||
binding.setOpenId(sessionInfo.openId());
|
||||
}
|
||||
binding.setUserId(userId);
|
||||
binding.setUnionId(sessionInfo.unionId());
|
||||
binding.setStatus(1);
|
||||
if (binding.getId() == null) {
|
||||
wechatMiniBindingMapper.insert(binding);
|
||||
} else {
|
||||
wechatMiniBindingMapper.updateById(binding);
|
||||
}
|
||||
}
|
||||
|
||||
private void require(boolean condition, String message) {
|
||||
if (!condition) {
|
||||
throw new IllegalArgumentException(message);
|
||||
|
||||
+34
-3
@@ -56,6 +56,8 @@ import com.xiaowang.jacyucloudsalon.core.modules.file.dto.ChunkUploadInitRequest
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniAutoLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniConfirmLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniPhoneLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniQuickLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniBindPhoneRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.dto.UserDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.vo.UserAgreementConsentVO;
|
||||
/**
|
||||
@@ -475,6 +477,23 @@ public class UserController {
|
||||
return Result.success(wechatMiniAuthService.autoLogin(requestDTO));
|
||||
}
|
||||
|
||||
@PostMapping("/wechat-mini/status")
|
||||
@OperationGuard(action = "wechat-mini-status", ttlSeconds = 2, message = "状态检测中,请稍后重试")
|
||||
public Result<WechatMiniLoginResultVO> wechatMiniStatus(@Valid @RequestBody WechatMiniAutoLoginRequestDTO requestDTO) {
|
||||
return Result.success(wechatMiniAuthService.status(requestDTO));
|
||||
}
|
||||
|
||||
@PostMapping("/wechat-mini/quick-login")
|
||||
@OperationGuard(action = "wechat-mini-quick-login", ttlSeconds = 8, message = "登录处理中,请勿重复提交")
|
||||
public Result<WechatMiniLoginResultVO> wechatMiniQuickLogin(HttpServletRequest request,
|
||||
@Valid @RequestBody WechatMiniQuickLoginRequestDTO requestDTO) {
|
||||
requestThrottleService.checkWechatMiniLogin(request, "wechat-mini-quick");
|
||||
legalAgreementService.requireAccepted(requestDTO);
|
||||
WechatMiniLoginResultVO result = wechatMiniAuthService.quickLogin(requestDTO);
|
||||
recordWechatConsentIfLoggedIn(result, requestDTO, "WECHAT_MINI_QUICK_LOGIN", request);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@PostMapping("/wechat-mini/phone-login")
|
||||
@OperationGuard(action = "wechat-mini-phone-login", ttlSeconds = 8, message = "登录处理中,请勿重复提交")
|
||||
/**
|
||||
@@ -646,9 +665,13 @@ public class UserController {
|
||||
AgreementAwareRequest dto,
|
||||
String entry,
|
||||
HttpServletRequest request) {
|
||||
if (result != null && result.getUserInfo() != null) {
|
||||
legalAgreementService.recordConsent(result.getUserInfo().getId(), dto, entry, request);
|
||||
securityAuditLogService.record(result.getUserInfo().getId(), null, entry, "SUCCESS", null, request);
|
||||
if (result != null) {
|
||||
Long userId = result.getUserInfo() == null ? result.getConsentUserId() : result.getUserInfo().getId();
|
||||
if (userId == null) {
|
||||
return;
|
||||
}
|
||||
legalAgreementService.recordConsent(userId, dto, entry, request);
|
||||
securityAuditLogService.record(userId, null, entry, "SUCCESS", null, request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,6 +715,14 @@ public class UserController {
|
||||
return Result.success(success);
|
||||
}
|
||||
|
||||
@PostMapping("/wechat-mini/bind-phone")
|
||||
@OperationGuard(action = "wechat-mini-bind-phone", ttlSeconds = 10, message = "手机号绑定处理中,请勿重复提交")
|
||||
public Result<Boolean> bindWechatMiniPhone(HttpServletRequest request,
|
||||
@Valid @RequestBody WechatMiniBindPhoneRequestDTO requestDTO) {
|
||||
Long userId = (Long) request.getAttribute("userId");
|
||||
return Result.success(wechatMiniAuthService.bindPhone(userId, requestDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定邮箱
|
||||
*
|
||||
|
||||
+1
@@ -784,6 +784,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements
|
||||
userVO.setNickname(userDO.getNickname());
|
||||
userVO.setAccount(userDO.getAccount());
|
||||
userVO.setPhone(userDO.getPhone());
|
||||
userVO.setPhoneVerified(userDO.getPhoneVerified());
|
||||
userVO.setContactPhone(userDO.getContactPhone());
|
||||
userVO.setBirthday(userDO.getBirthday());
|
||||
userVO.setWechatId(userDO.getWechatId());
|
||||
|
||||
+1
@@ -111,6 +111,7 @@ public class UserVO {
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
private Integer phoneVerified;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
|
||||
@@ -5,29 +5,29 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# Nacos 集群地址,默认指向开发环境,生产环境通过环境变量覆盖。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.5.15:8848}
|
||||
# Nacos 命名空间,默认指向开发环境。
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-salon}
|
||||
# Nacos 启动引导地址固定指向开发配置中心。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 启动引导命名空间。
|
||||
namespace: jayucloud-salon
|
||||
# 服务注册分组。
|
||||
group: DEFAULT_GROUP
|
||||
# 注册到 Nacos 的服务名。
|
||||
service: ${spring.application.name}
|
||||
service: jc-salon-core
|
||||
# 是否启用服务发现。
|
||||
enabled: true
|
||||
# 是否将当前服务注册到 Nacos。
|
||||
register-enabled: true
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME:jayucloud}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD:122503wcy....}
|
||||
password: 122503wcy....
|
||||
config:
|
||||
# Nacos 配置中心地址,与服务发现使用同一组集群节点,默认指向开发环境。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.5.15:8848}
|
||||
# Nacos 配置中心命名空间,默认指向开发环境。
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-salon}
|
||||
# Nacos 配置中心地址,与服务发现使用同一开发节点。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 配置中心命名空间。
|
||||
namespace: jayucloud-salon
|
||||
# 配置分组。
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
# Core 服务独有配置文件。
|
||||
name: core
|
||||
# 所有 Nacos 配置均使用 YAML。
|
||||
@@ -35,17 +35,17 @@ spring:
|
||||
# 是否启用配置中心。
|
||||
enabled: true
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME:jayucloud}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD:122503wcy....}
|
||||
password: 122503wcy....
|
||||
# Core 与 Gateway 共享的公共配置文件。
|
||||
shared-configs:
|
||||
- data-id: infra.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: secret.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: logging.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.xiaowang.jacyucloudsalon.core.modules.integration.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniAutoLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.dto.WechatMiniQuickLoginRequestDTO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.entity.WechatMiniBindingDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.mapper.WechatMiniBindingMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.service.WechatMiniClientService;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.integration.vo.WechatMiniLoginResultVO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.registration.mapper.WorkbenchRegistrationApplicationMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.shop.support.UserShopBindingSupport;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.entity.UserDO;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.mapper.UserMapper;
|
||||
import com.xiaowang.jacyucloudsalon.core.modules.user.service.UserService;
|
||||
import com.xiaowang.jacyucloudsalon.core.support.id.TimeOrderedSnowflakeIdGenerator;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class WechatMiniAuthServiceImplTest {
|
||||
@Mock private WechatMiniClientService clientService;
|
||||
@Mock private WechatMiniBindingMapper bindingMapper;
|
||||
@Mock private UserMapper userMapper;
|
||||
@Mock private UserService userService;
|
||||
@Mock private UserShopBindingSupport shopBindingSupport;
|
||||
@Mock private StringRedisTemplate redisTemplate;
|
||||
@Mock private ValueOperations<String, String> valueOperations;
|
||||
@Mock private TimeOrderedSnowflakeIdGenerator idGenerator;
|
||||
@Mock private WorkbenchRegistrationApplicationMapper applicationMapper;
|
||||
|
||||
private WechatMiniAuthServiceImpl service;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
service = new WechatMiniAuthServiceImpl(clientService, bindingMapper, userMapper, userService,
|
||||
shopBindingSupport, redisTemplate, new ObjectMapper(), idGenerator, applicationMapper);
|
||||
when(clientService.getConfiguredAppId()).thenReturn("wx-app");
|
||||
}
|
||||
|
||||
@Test
|
||||
void statusDoesNotCreateUnknownUser() {
|
||||
when(clientService.code2Session("probe-code"))
|
||||
.thenReturn(new WechatMiniClientService.SessionInfo("openid-1", null, "session"));
|
||||
when(bindingMapper.selectOne(any())).thenReturn(null);
|
||||
WechatMiniAutoLoginRequestDTO request = new WechatMiniAutoLoginRequestDTO();
|
||||
request.setWxCode("probe-code");
|
||||
|
||||
WechatMiniLoginResultVO result = service.status(request);
|
||||
|
||||
assertEquals(WechatMiniLoginResultVO.STATUS_NEW_USER, result.getStatus());
|
||||
verify(userMapper, never()).insert(any());
|
||||
verifyNoInteractions(userService, redisTemplate);
|
||||
}
|
||||
|
||||
@Test
|
||||
void quickLoginCreatesSinglePendingIdentityWithoutAccountOrPassword() {
|
||||
when(clientService.code2Session("login-code"))
|
||||
.thenReturn(new WechatMiniClientService.SessionInfo("openid-1", "union-1", "session"));
|
||||
when(bindingMapper.selectOne(any())).thenReturn(null);
|
||||
when(bindingMapper.selectList(any())).thenReturn(List.of());
|
||||
when(userMapper.insert(any())).thenAnswer(invocation -> {
|
||||
((UserDO) invocation.getArgument(0)).setId(101L);
|
||||
return 1;
|
||||
});
|
||||
when(idGenerator.nextIdString()).thenReturn("1234567890123456789");
|
||||
when(redisTemplate.opsForValue()).thenReturn(valueOperations);
|
||||
WechatMiniQuickLoginRequestDTO request = new WechatMiniQuickLoginRequestDTO();
|
||||
request.setWxCode("login-code");
|
||||
|
||||
WechatMiniLoginResultVO result = service.quickLogin(request);
|
||||
|
||||
assertEquals(WechatMiniLoginResultVO.STATUS_NEED_REGISTRATION, result.getStatus());
|
||||
assertNotNull(result.getRegistrationTicket());
|
||||
verify(userMapper, times(1)).insert(argThat(user -> user.getAccount() == null
|
||||
&& user.getPassword() == null && Integer.valueOf(0).equals(user.getStatus())));
|
||||
verify(bindingMapper, times(1)).insert(argThat(binding -> "openid-1".equals(binding.getOpenId())
|
||||
&& Long.valueOf(101L).equals(binding.getUserId())));
|
||||
verifyNoInteractions(userService);
|
||||
}
|
||||
|
||||
@Test
|
||||
void inactiveReviewedUserCannotReceiveToken() {
|
||||
WechatMiniBindingDO binding = new WechatMiniBindingDO();
|
||||
binding.setUserId(101L);
|
||||
binding.setStatus(1);
|
||||
UserDO user = new UserDO();
|
||||
user.setId(101L);
|
||||
user.setType(2);
|
||||
user.setStatus(0);
|
||||
user.setIsDelete(0);
|
||||
when(clientService.code2Session("login-code"))
|
||||
.thenReturn(new WechatMiniClientService.SessionInfo("openid-1", null, "session"));
|
||||
when(bindingMapper.selectOne(any())).thenReturn(binding);
|
||||
when(userMapper.selectById(101L)).thenReturn(user);
|
||||
when(applicationMapper.selectOne(any())).thenReturn(null);
|
||||
WechatMiniQuickLoginRequestDTO request = new WechatMiniQuickLoginRequestDTO();
|
||||
request.setWxCode("login-code");
|
||||
|
||||
WechatMiniLoginResultVO result = service.quickLogin(request);
|
||||
|
||||
assertEquals(WechatMiniLoginResultVO.STATUS_DISABLED, result.getStatus());
|
||||
assertNull(result.getAccessToken());
|
||||
verifyNoInteractions(userService);
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -94,7 +94,11 @@ public class AuthGlobalFilter implements GlobalFilter, Ordered {
|
||||
"/api/user/refresh-token",
|
||||
"/api/user/send-verification-code",
|
||||
"/api/user/phone-login",
|
||||
"/api/user/wechat-mini/**",
|
||||
"/api/user/wechat-mini/auto-login",
|
||||
"/api/user/wechat-mini/phone-login",
|
||||
"/api/user/wechat-mini/confirm-login",
|
||||
"/api/user/wechat-mini/status",
|
||||
"/api/user/wechat-mini/quick-login",
|
||||
"/api/user/workbench/register/**",
|
||||
"/api/user/workbench/shops/available",
|
||||
"/api/user/reset-password-by-phone",
|
||||
|
||||
@@ -1,173 +1 @@
|
||||
spring:
|
||||
cloud:
|
||||
gateway:
|
||||
routes:
|
||||
# 前台API路由
|
||||
- id: product-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/product/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: product-like-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/product-like/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: shop-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/shop/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: user-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/user/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: comment-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/comment/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: balance-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/balance/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: tag-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/tag/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: file-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/file/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: permission-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/permission/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: coupon-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/coupon/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: cart-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/cart/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: order-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/order/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: wishlist-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/wishlist/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: nail-artist-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/nail-artist/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
- id: legal-agreement-route
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/legal-agreement/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
# 后台管理API路由(/api/admin/** 格式)
|
||||
- id: admin-api-route
|
||||
order: -10
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/admin/**
|
||||
filters:
|
||||
- RewritePath=/api/admin/(?<remaining>.*), /admin/${remaining}
|
||||
# 后台管理API路由(/admin/api/** 格式)
|
||||
- id: admin-route
|
||||
order: -9
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- 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
|
||||
predicates:
|
||||
- Path=/admin/auth/**
|
||||
# 前台API兜底路由,避免 Core 新增模块后 Gateway 未同步导致 404
|
||||
- id: frontend-fallback-route
|
||||
order: 100
|
||||
uri: lb://jc-salon-core
|
||||
predicates:
|
||||
- Path=/api/**
|
||||
filters:
|
||||
- RewritePath=/api/(?<remaining>.*), /${remaining}
|
||||
|
||||
fingertip-designer:
|
||||
security:
|
||||
jwt:
|
||||
issuer: jayucloud-salon
|
||||
clock-skew-seconds: 30
|
||||
gateway:
|
||||
whitelist:
|
||||
- /api/user/login
|
||||
- /api/user/register
|
||||
- /api/user/check/**
|
||||
- /api/user/refresh-token
|
||||
- /api/user/send-verification-code
|
||||
- /api/user/phone-login
|
||||
- /api/user/wechat-mini/**
|
||||
- /api/user/workbench/register/**
|
||||
- /api/user/workbench/shops/available
|
||||
- /api/user/reset-password-by-phone
|
||||
- /api/nail-artist/profile/**
|
||||
- /api/nail-artist/*/availability
|
||||
- /api/nail-artist/*/reviews
|
||||
- /api/shop/list
|
||||
- /api/shop/list/simple
|
||||
- /api/legal-agreement/current
|
||||
- /api/legal-agreement/current/**
|
||||
- /api/health/**
|
||||
- /api/error
|
||||
- /api/admin/auth/login
|
||||
- /api/admin/auth/login-shops/**
|
||||
- /api/admin/auth/refresh
|
||||
- /api/admin/auth/register
|
||||
- /admin/auth/login
|
||||
- /admin/auth/login-shops/**
|
||||
- /admin/auth/refresh
|
||||
- /admin/api/auth/login
|
||||
- /admin/api/auth/login-shops/**
|
||||
- /admin/api/auth/refresh
|
||||
slow-request:
|
||||
enabled: true
|
||||
threshold-ms: 300
|
||||
log-response-header-request-id: true
|
||||
# 除 bootstrap.yaml 中的 Nacos 启动引导参数外,Gateway 路由与运行参数统一由 Nacos 配置源管理。
|
||||
|
||||
@@ -5,41 +5,41 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# Nacos 集群地址,默认指向开发环境,生产环境通过环境变量覆盖。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.5.15:8848}
|
||||
# Nacos 命名空间,默认指向开发环境
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-salon}
|
||||
# Nacos 启动引导地址固定指向开发配置中心。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 启动引导命名空间。
|
||||
namespace: jayucloud-salon
|
||||
# 服务注册分组。
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
# 注册到 Nacos 的服务名。
|
||||
service: ${spring.application.name:jayucloud-salon-core}
|
||||
service: jc-salon-gateway
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME:jayucloud}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD:122503wcy....}
|
||||
password: 122503wcy....
|
||||
config:
|
||||
# Nacos 配置中心地址,与服务发现使用同一组集群节点,默认指向开发环境。
|
||||
server-addr: ${NACOS_SERVER_ADDR:192.168.5.15:8848}
|
||||
# Nacos 配置中心命名空间,默认指向开发环境。
|
||||
namespace: ${NACOS_NAMESPACE:jayucloud-salon}
|
||||
# Nacos 配置中心地址,与服务发现使用同一开发节点。
|
||||
server-addr: 192.168.5.15:8848
|
||||
# Nacos 配置中心命名空间。
|
||||
namespace: jayucloud-salon
|
||||
# 配置分组。
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
# Gateway 服务独有配置文件。
|
||||
name: gateway
|
||||
# 所有 Nacos 配置均使用 YAML。
|
||||
file-extension: yaml
|
||||
# Nacos 认证用户名。
|
||||
username: ${NACOS_USERNAME:jayucloud}
|
||||
username: jayucloud
|
||||
# Nacos 认证密码。
|
||||
password: ${NACOS_PASSWORD:122503wcy....}
|
||||
password: 122503wcy....
|
||||
# Core 与 Gateway 共享的公共配置文件。
|
||||
shared-configs:
|
||||
- data-id: infra.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: secret.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
- data-id: logging.yaml
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
|
||||
@@ -19,7 +19,7 @@ module.exports = {
|
||||
|
||||
register(data) {
|
||||
return request({
|
||||
url: '/user/workbench/register/phone',
|
||||
url: '/user/workbench/register/wechat-mini',
|
||||
method: 'POST',
|
||||
params: { __baseUrl: API_DOMAIN },
|
||||
data
|
||||
@@ -99,6 +99,24 @@ module.exports = {
|
||||
})
|
||||
},
|
||||
|
||||
wechatStatus(wxCode) {
|
||||
return request({
|
||||
url: '/user/wechat-mini/status',
|
||||
method: 'POST',
|
||||
params: { __baseUrl: API_DOMAIN },
|
||||
data: { wxCode }
|
||||
})
|
||||
},
|
||||
|
||||
wechatQuickLogin(data) {
|
||||
return request({
|
||||
url: '/user/wechat-mini/quick-login',
|
||||
method: 'POST',
|
||||
params: { __baseUrl: API_DOMAIN },
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
wechatPhoneLogin(data) {
|
||||
return request({
|
||||
url: '/user/wechat-mini/phone-login',
|
||||
|
||||
@@ -20,5 +20,32 @@ module.exports = {
|
||||
},
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
bindWechatPhone(phoneCode) {
|
||||
return request({
|
||||
url: '/user/wechat-mini/bind-phone',
|
||||
method: 'POST',
|
||||
params: { __baseUrl: API_DOMAIN },
|
||||
data: { phoneCode }
|
||||
})
|
||||
},
|
||||
|
||||
bindPhone(data) {
|
||||
return request({
|
||||
url: '/user/bind-phone',
|
||||
method: 'POST',
|
||||
params: { __baseUrl: API_DOMAIN },
|
||||
data
|
||||
})
|
||||
},
|
||||
|
||||
sendBindPhoneCode(phone) {
|
||||
return request({
|
||||
url: '/user/send-verification-code',
|
||||
method: 'POST',
|
||||
params: { __baseUrl: API_DOMAIN },
|
||||
data: { phone, sceneCode: 'USER_BIND_PHONE' }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+70
-1
@@ -1,4 +1,5 @@
|
||||
const auth = require('./utils/auth')
|
||||
const authApi = require('./api/auth')
|
||||
const { BRAND_CONFIG } = require('./utils/config')
|
||||
|
||||
App({
|
||||
@@ -6,11 +7,73 @@ App({
|
||||
appName: BRAND_CONFIG.appName,
|
||||
shopName: BRAND_CONFIG.defaultShopName,
|
||||
userInfo: null,
|
||||
planningNeedRefresh: false
|
||||
planningNeedRefresh: false,
|
||||
wechatLoginState: null
|
||||
},
|
||||
|
||||
onLaunch() {
|
||||
this.bootstrapSession()
|
||||
this.bootstrapWechatLogin()
|
||||
},
|
||||
|
||||
getWechatCode() {
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.login({
|
||||
success: result => result.code ? resolve(result.code) : reject(new Error('未获取到微信登录凭证')),
|
||||
fail: reject
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
async bootstrapWechatLogin() {
|
||||
try {
|
||||
const status = await authApi.wechatStatus(await this.getWechatCode())
|
||||
this.publishWechatLoginState(status)
|
||||
const preference = auth.getLoginPreference()
|
||||
if (!preference.rememberMe || status.status !== 'READY') {
|
||||
auth.clearSession()
|
||||
this.globalData.userInfo = null
|
||||
this.goLoginIfNeeded()
|
||||
return
|
||||
}
|
||||
const result = await authApi.wechatQuickLogin({
|
||||
wxCode: await this.getWechatCode(),
|
||||
preferredShopId: preference.preferredShopId,
|
||||
agreementAccepted: true,
|
||||
agreementVersions: preference.agreementVersions || {},
|
||||
clientType: 'WECHAT_MINI'
|
||||
})
|
||||
this.publishWechatLoginState(result)
|
||||
if (result.status === 'SUCCESS' && result.accessToken) {
|
||||
this.setSession(result)
|
||||
wx.reLaunch({ url: '/pages/planning/index' })
|
||||
return
|
||||
}
|
||||
wx.reLaunch({ url: '/pages/login/index' })
|
||||
} catch (error) {
|
||||
auth.clearSession()
|
||||
this.globalData.userInfo = null
|
||||
this.publishWechatLoginState({
|
||||
status: 'ERROR',
|
||||
message: error.message || '自动登录失败,请点击重试'
|
||||
})
|
||||
this.goLoginIfNeeded()
|
||||
}
|
||||
},
|
||||
|
||||
goLoginIfNeeded() {
|
||||
const pages = getCurrentPages()
|
||||
const current = pages.length ? pages[pages.length - 1].route : ''
|
||||
if (current !== 'pages/login/index') wx.reLaunch({ url: '/pages/login/index' })
|
||||
},
|
||||
|
||||
publishWechatLoginState(state) {
|
||||
this.globalData.wechatLoginState = state
|
||||
const pages = getCurrentPages()
|
||||
const current = pages.length ? pages[pages.length - 1] : null
|
||||
if (current && current.route === 'pages/login/index' && typeof current.setData === 'function') {
|
||||
current.setData({ loginState: state })
|
||||
}
|
||||
},
|
||||
|
||||
bootstrapSession() {
|
||||
@@ -29,5 +92,11 @@ App({
|
||||
clearSession() {
|
||||
auth.clearSession()
|
||||
this.globalData.userInfo = null
|
||||
},
|
||||
|
||||
logoutDevice() {
|
||||
auth.clearDeviceLoginState()
|
||||
this.globalData.userInfo = null
|
||||
this.globalData.wechatLoginState = null
|
||||
}
|
||||
})
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"pages/leave-management/index",
|
||||
"pages/color-setting/index",
|
||||
"pages/profile/index",
|
||||
"pages/account-settings/index",
|
||||
"pages/shop-settings/index",
|
||||
"pages/export/index",
|
||||
"pages/password/index",
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
const userApi = require('../../api/user')
|
||||
const authApi = require('../../api/auth')
|
||||
const auth = require('../../utils/auth')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
profile: {},
|
||||
loading: true,
|
||||
binding: false,
|
||||
smsForm: { phone: '', code: '' },
|
||||
codeLoading: false,
|
||||
countdown: 0,
|
||||
timer: null
|
||||
},
|
||||
|
||||
onShow() { this.loadProfile() },
|
||||
|
||||
async loadProfile() {
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const profile = await userApi.info()
|
||||
this.setData({ profile, 'smsForm.phone': profile.phone || '' })
|
||||
const app = getApp()
|
||||
const session = auth.getSession()
|
||||
app.setSession({ ...session, userInfo: { ...(session.userInfo || {}), ...profile } })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '账号信息加载失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
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({ [`smsForm.${field}`]: value })
|
||||
},
|
||||
|
||||
async bindWechatPhone(event) {
|
||||
const phoneCode = event.detail && event.detail.code
|
||||
if (!phoneCode) {
|
||||
wx.showToast({ title: '未获得手机号授权', icon: 'none' }); return
|
||||
}
|
||||
this.setData({ binding: true })
|
||||
try {
|
||||
await userApi.bindWechatPhone(phoneCode)
|
||||
await this.loadProfile()
|
||||
wx.showToast({ title: '手机号已绑定' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '绑定失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ binding: false })
|
||||
}
|
||||
},
|
||||
|
||||
async sendCode() {
|
||||
const phone = String(this.data.smsForm.phone || '')
|
||||
if (!/^1[3-9]\d{9}$/.test(phone)) {
|
||||
wx.showToast({ title: '请输入正确手机号', icon: 'none' }); return
|
||||
}
|
||||
if (this.data.codeLoading || this.data.countdown) return
|
||||
this.setData({ codeLoading: true })
|
||||
try {
|
||||
await userApi.sendBindPhoneCode(phone)
|
||||
this.startCountdown()
|
||||
wx.showToast({ title: '验证码已发送' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '验证码发送失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ codeLoading: false })
|
||||
}
|
||||
},
|
||||
|
||||
startCountdown() {
|
||||
if (this.data.timer) clearInterval(this.data.timer)
|
||||
this.setData({ countdown: 60 })
|
||||
const timer = setInterval(() => {
|
||||
const next = this.data.countdown - 1
|
||||
if (next <= 0) { clearInterval(timer); this.setData({ countdown: 0, timer: null }); return }
|
||||
this.setData({ countdown: next })
|
||||
}, 1000)
|
||||
this.setData({ timer })
|
||||
},
|
||||
|
||||
async bindSmsPhone() {
|
||||
const form = this.data.smsForm
|
||||
if (!/^1[3-9]\d{9}$/.test(form.phone) || !/^\d{6}$/.test(String(form.code || ''))) {
|
||||
wx.showToast({ title: '请输入正确手机号和6位验证码', icon: 'none' }); return
|
||||
}
|
||||
this.setData({ binding: true })
|
||||
try {
|
||||
await userApi.bindPhone({ phone: form.phone, verificationCode: form.code })
|
||||
await this.loadProfile()
|
||||
wx.showToast({ title: '手机号已绑定' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '绑定失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ binding: false })
|
||||
}
|
||||
},
|
||||
|
||||
async logout() {
|
||||
const confirmed = await new Promise(resolve => wx.showModal({ title: '退出登录', content: '退出后将关闭自动登录,并清除本机提醒设置。', success: result => resolve(result.confirm), fail: () => resolve(false) }))
|
||||
if (!confirmed) return
|
||||
try { await authApi.logout() } catch (error) {}
|
||||
getApp().logoutDevice()
|
||||
wx.reLaunch({ url: '/pages/login/index' })
|
||||
},
|
||||
|
||||
onUnload() { if (this.data.timer) clearInterval(this.data.timer) }
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "账号设置"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<view class="page settings-page">
|
||||
<view class="card identity-card"><view class="identity-mark">微</view><view class="identity-copy"><text class="identity-title">微信身份</text><text class="identity-status">已安全关联当前账号</text></view><text class="linked-badge">已关联</text></view>
|
||||
<view class="card phone-card"><view class="section-title">手机号</view><view class="phone-status"><text>{{profile.phoneVerified == 1 ? (profile.maskedPhone || profile.phone) : '尚未绑定'}}</text><text class="status-tag {{profile.phoneVerified == 1 ? 'done' : ''}}">{{profile.phoneVerified == 1 ? '已验证' : '待绑定'}}</text></view><button class="wechat-phone-btn" open-type="getPhoneNumber" loading="{{binding}}" bindgetphonenumber="bindWechatPhone">微信一键{{profile.phoneVerified == 1 ? '更换' : '绑定'}}</button><view class="divider"><text>或使用短信验证码</text></view><view class="field"><input value="{{smsForm.phone}}" data-field="phone" bindinput="onInput" type="number" maxlength="11" placeholder="请输入手机号" /></view><view class="code-row"><input value="{{smsForm.code}}" data-field="code" bindinput="onInput" type="number" maxlength="6" placeholder="6位验证码" /><button bindtap="sendCode" disabled="{{codeLoading || countdown > 0}}">{{countdown > 0 ? countdown + 's' : '获取验证码'}}</button></view><button class="sms-bind-btn" loading="{{binding}}" bindtap="bindSmsPhone">验证并绑定</button></view>
|
||||
<view class="account-note">手机号仅用于账号安全与必要联系,不作为微信快捷登录标识。</view>
|
||||
<button class="logout-btn" bindtap="logout">退出登录</button>
|
||||
</view>
|
||||
@@ -0,0 +1,2 @@
|
||||
.settings-page { padding-top:24rpx; }.identity-card { display:flex; align-items:center; padding:26rpx; }.identity-mark { display:flex; align-items:center; justify-content:center; width:68rpx; height:68rpx; border-radius:20rpx; background:#dcebe1; color:#35634d; font-size:28rpx; font-weight:800; }.identity-copy { display:flex; flex:1; flex-direction:column; margin-left:18rpx; }.identity-title,.section-title { color:#30483c; font-size:28rpx; font-weight:800; }.identity-status { margin-top:6rpx; color:#8a9a91; font-size:21rpx; }.linked-badge,.status-tag { padding:7rpx 14rpx; border-radius:999rpx; background:#e5f2e8; color:#397055; font-size:20rpx; }
|
||||
.phone-card { margin-top:20rpx; padding:28rpx; }.phone-status { display:flex; align-items:center; justify-content:space-between; margin-top:20rpx; padding:20rpx; border-radius:14rpx; background:#f4f8f5; color:#425b4e; font-size:26rpx; }.status-tag { background:#fff0db; color:#9a682e; }.status-tag.done { background:#e5f2e8; color:#397055; }.wechat-phone-btn,.sms-bind-btn { height:80rpx; margin-top:22rpx; border-radius:14rpx; background:#35634d; color:#fff; font-size:26rpx; line-height:80rpx; }.divider { display:flex; align-items:center; justify-content:center; margin:28rpx 0 18rpx; color:#9aa79f; font-size:20rpx; }.field input,.code-row input { box-sizing:border-box; height:78rpx; padding:0 20rpx; border:1rpx solid #dde8e0; border-radius:12rpx; background:#f8faf8; }.code-row { display:flex; gap:12rpx; margin-top:14rpx; }.code-row input { min-width:0; flex:1; }.code-row button { width:190rpx; height:78rpx; padding:0; border-radius:12rpx; background:#e7f0ea; color:#426c57; font-size:23rpx; line-height:78rpx; }.sms-bind-btn { background:#eef4f0; color:#35634d; }.account-note { margin:24rpx 18rpx; color:#8e9c94; font-size:21rpx; line-height:1.6; }.logout-btn { margin-top:52rpx; background:transparent; color:#a24f42; font-size:25rpx; }
|
||||
@@ -1,595 +1,179 @@
|
||||
const authApi = require('../../api/auth')
|
||||
const auth = require('../../utils/auth')
|
||||
const { BRAND_CONFIG } = require('../../utils/config')
|
||||
|
||||
const PHONE_REGEX = /^1[3-9]\d{9}$/
|
||||
const LOGIN_PREFERENCE_KEY = 'fingertip_manager_login_preference'
|
||||
|
||||
function buildSession(data) {
|
||||
const userInfo = data.userInfo || data.user || {}
|
||||
return {
|
||||
...data,
|
||||
accessToken: data.accessToken || data.token,
|
||||
userInfo,
|
||||
shopName: data.shopName || userInfo.shopName || (data.shop && data.shop.shopName)
|
||||
}
|
||||
}
|
||||
|
||||
function getSelectableShopIds(session) {
|
||||
const userInfo = session.userInfo || {}
|
||||
if (Array.isArray(userInfo.shopIds)) {
|
||||
return userInfo.shopIds
|
||||
}
|
||||
return Array.isArray(session.shopIds) ? session.shopIds : []
|
||||
}
|
||||
|
||||
function getSelectableShopNames(session) {
|
||||
const userInfo = session.userInfo || {}
|
||||
if (Array.isArray(userInfo.shopNames)) {
|
||||
return userInfo.shopNames
|
||||
}
|
||||
return Array.isArray(session.shopNames) ? session.shopNames : []
|
||||
}
|
||||
|
||||
function buildShopOptions(session) {
|
||||
const shopIds = getSelectableShopIds(session)
|
||||
const shopNames = getSelectableShopNames(session)
|
||||
return shopIds.map((shopId, index) => ({
|
||||
id: shopId,
|
||||
name: shopNames[index] || `店铺 ${shopId}`
|
||||
function wxLoginCode() {
|
||||
return new Promise((resolve, reject) => wx.login({
|
||||
success: result => result.code ? resolve(result.code) : reject(new Error('未获取到微信登录凭证')),
|
||||
fail: reject
|
||||
}))
|
||||
}
|
||||
|
||||
function buildShopOptionsFromSelection(selection) {
|
||||
const shops = selection && Array.isArray(selection.shops) ? selection.shops : []
|
||||
return shops.map(shop => ({
|
||||
id: shop.id,
|
||||
name: shop.shopName || shop.name || `店铺 ${shop.id}`,
|
||||
description: selection && selection.message ? selection.message : ''
|
||||
function shopOptions(result) {
|
||||
return (Array.isArray(result.shops) ? result.shops : []).map(item => ({
|
||||
id: item.id,
|
||||
name: item.shopName || item.name || `门店 ${item.id}`
|
||||
}))
|
||||
}
|
||||
|
||||
function isShopSelectionRequiredError(error) {
|
||||
const message = error && error.message ? error.message : ''
|
||||
return message.indexOf('选择店铺') !== -1 || message.indexOf('请选择店铺') !== -1 || message.indexOf('请选择登录店铺') !== -1
|
||||
}
|
||||
|
||||
function assertShopSession(session) {
|
||||
const userInfo = session.userInfo || {}
|
||||
if (!userInfo.shopId) {
|
||||
throw new Error('请选择店铺后再进入管理师端')
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
||||
function getLoginPreference() {
|
||||
try {
|
||||
return wx.getStorageSync(LOGIN_PREFERENCE_KEY) || {}
|
||||
} catch (error) {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
function setLoginPreference(preference) {
|
||||
wx.setStorageSync(LOGIN_PREFERENCE_KEY, preference || {})
|
||||
}
|
||||
|
||||
function clearLoginPreference() {
|
||||
wx.removeStorageSync(LOGIN_PREFERENCE_KEY)
|
||||
}
|
||||
|
||||
Page({
|
||||
data: {
|
||||
loginView: 'entry',
|
||||
loginMode: 'phone',
|
||||
form: {
|
||||
account: '',
|
||||
password: '',
|
||||
phone: '',
|
||||
code: ''
|
||||
},
|
||||
appName: BRAND_CONFIG.appName,
|
||||
loading: false,
|
||||
codeLoading: false,
|
||||
countdown: 0,
|
||||
codeSent: false,
|
||||
countdownTimer: null,
|
||||
rememberMe: false,
|
||||
agreementAccepted: false,
|
||||
agreements: [],
|
||||
agreementLoading: false,
|
||||
agreementError: '',
|
||||
selectedAgreement: {},
|
||||
agreementModalVisible: false,
|
||||
selectedAgreement: null,
|
||||
rememberMe: false,
|
||||
agreements: [],
|
||||
appName: BRAND_CONFIG.appName,
|
||||
loginState: null,
|
||||
shopSelectVisible: false,
|
||||
shopSelectMode: '',
|
||||
shopOptions: [],
|
||||
switchingShop: false,
|
||||
wechatLoginTicket: ''
|
||||
loginTicket: '',
|
||||
switchingShop: false
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
const preference = getLoginPreference()
|
||||
if (preference.rememberMe) {
|
||||
this.setData({
|
||||
// 记住账号不代表默认使用密码登录,工作台优先引导手机号验证码登录。
|
||||
loginMode: 'phone',
|
||||
rememberMe: true,
|
||||
'form.account': preference.account || '',
|
||||
'form.phone': preference.phone || ''
|
||||
})
|
||||
}
|
||||
this.setData({ rememberMe: !!auth.getLoginPreference().rememberMe })
|
||||
this.consumeAppState()
|
||||
this.loadAgreements()
|
||||
},
|
||||
|
||||
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
|
||||
})
|
||||
},
|
||||
onShow() { this.consumeAppState() },
|
||||
|
||||
switchLoginMode(event) {
|
||||
const loginMode = event.currentTarget.dataset.mode
|
||||
if (loginMode === 'entry') {
|
||||
this.setData({ loginView: 'entry' })
|
||||
return
|
||||
}
|
||||
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' })
|
||||
return
|
||||
}
|
||||
if (this.data.codeLoading || this.data.countdown > 0) {
|
||||
return
|
||||
}
|
||||
this.setData({ codeLoading: true })
|
||||
try {
|
||||
await authApi.sendLoginCode(phone)
|
||||
wx.showToast({ title: '验证码已发送' })
|
||||
this.setData({ codeSent: true })
|
||||
this.startCountdown()
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '验证码发送失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ codeLoading: false })
|
||||
}
|
||||
consumeAppState() {
|
||||
const state = getApp().globalData.wechatLoginState
|
||||
if (state) this.setData({ loginState: state })
|
||||
},
|
||||
|
||||
async loadAgreements() {
|
||||
if (this.data.agreements.length) {
|
||||
return this.data.agreements
|
||||
}
|
||||
if (this.data.agreementLoading) {
|
||||
return this.data.agreements
|
||||
}
|
||||
if (this.data.agreementLoading || this.data.agreements.length) return
|
||||
this.setData({ agreementLoading: true, agreementError: '' })
|
||||
try {
|
||||
const agreements = await authApi.getCurrentAgreements()
|
||||
const normalizedAgreements = Array.isArray(agreements) ? agreements : []
|
||||
this.setData({ agreements: normalizedAgreements })
|
||||
return normalizedAgreements
|
||||
this.setData({ agreements: Array.isArray(agreements) ? agreements : [] })
|
||||
} catch (error) {
|
||||
const agreementError = error.message || '协议内容加载失败,请稍后重试'
|
||||
this.setData({ agreementError })
|
||||
return []
|
||||
this.setData({ agreementError: error.message || '协议加载失败' })
|
||||
} finally {
|
||||
this.setData({ agreementLoading: false })
|
||||
}
|
||||
},
|
||||
|
||||
toggleAgreement() {
|
||||
this.setData({
|
||||
agreementAccepted: !this.data.agreementAccepted
|
||||
})
|
||||
},
|
||||
|
||||
async openAgreement(event) {
|
||||
const type = event.currentTarget.dataset.type
|
||||
const agreements = await this.loadAgreements()
|
||||
const selectedAgreement = agreements.find(item => item.agreementType === type)
|
||||
if (!selectedAgreement) {
|
||||
wx.showToast({ title: this.data.agreementError || '协议内容暂不可用', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
selectedAgreement,
|
||||
agreementModalVisible: true
|
||||
})
|
||||
},
|
||||
|
||||
closeAgreementModal() {
|
||||
this.setData({
|
||||
agreementModalVisible: false,
|
||||
selectedAgreement: null
|
||||
})
|
||||
},
|
||||
|
||||
stopTap() {
|
||||
},
|
||||
|
||||
toggleAgreement() { this.setData({ agreementAccepted: !this.data.agreementAccepted }) },
|
||||
toggleRememberMe() {
|
||||
const rememberMe = !this.data.rememberMe
|
||||
this.setData({ rememberMe })
|
||||
if (!rememberMe) {
|
||||
clearLoginPreference()
|
||||
}
|
||||
if (!rememberMe) auth.clearLoginPreference()
|
||||
},
|
||||
|
||||
saveLoginPreference() {
|
||||
if (!this.data.rememberMe) {
|
||||
clearLoginPreference()
|
||||
async openAgreement(event) {
|
||||
await this.loadAgreements()
|
||||
const selectedAgreement = this.data.agreements.find(item => item.agreementType === event.currentTarget.dataset.type)
|
||||
if (!selectedAgreement) {
|
||||
wx.showToast({ title: this.data.agreementError || '协议暂不可用', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const form = this.data.form
|
||||
setLoginPreference({
|
||||
rememberMe: true,
|
||||
loginMode: this.data.loginMode,
|
||||
account: String(form.account || '').trim(),
|
||||
phone: String(form.phone || '').trim()
|
||||
})
|
||||
this.setData({ selectedAgreement, agreementModalVisible: true })
|
||||
},
|
||||
|
||||
buildAgreementPayload() {
|
||||
closeAgreementModal() { this.setData({ agreementModalVisible: false, selectedAgreement: {} }) },
|
||||
acceptAgreementModal() { this.setData({ agreementModalVisible: false, selectedAgreement: {}, agreementAccepted: true }) },
|
||||
stopTap() {},
|
||||
|
||||
agreementPayload() {
|
||||
const agreementVersions = {}
|
||||
;(this.data.agreements || []).forEach(item => {
|
||||
if (item && item.agreementType && item.version) {
|
||||
agreementVersions[item.agreementType] = item.version
|
||||
}
|
||||
this.data.agreements.forEach(item => {
|
||||
if (item.agreementType && item.version) agreementVersions[item.agreementType] = item.version
|
||||
})
|
||||
return {
|
||||
agreementAccepted: !!this.data.agreementAccepted,
|
||||
agreementVersions,
|
||||
clientType: 'WECHAT_MINI'
|
||||
}
|
||||
return { agreementAccepted: true, agreementVersions, clientType: 'WECHAT_MINI' }
|
||||
},
|
||||
|
||||
ensureAgreementAccepted() {
|
||||
async ensureCanLogin() {
|
||||
await this.loadAgreements()
|
||||
if (!this.data.agreementAccepted) {
|
||||
wx.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
|
||||
await new Promise(resolve => wx.showModal({
|
||||
title: '请先勾选协议',
|
||||
content: '阅读并勾选用户协议和隐私政策后,才能使用快捷登录。',
|
||||
showCancel: false,
|
||||
complete: resolve
|
||||
}))
|
||||
return false
|
||||
}
|
||||
const versions = this.buildAgreementPayload().agreementVersions
|
||||
const versions = this.agreementPayload().agreementVersions
|
||||
if (!versions.USER_TERMS || !versions.PRIVACY_POLICY) {
|
||||
wx.showToast({ title: this.data.agreementError || '协议版本加载中,请稍后再试', icon: 'none' })
|
||||
wx.showToast({ title: this.data.agreementError || '协议版本加载中,请稍后重试', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
if (!this.data.rememberMe) {
|
||||
const confirmed = await new Promise(resolve => wx.showModal({
|
||||
title: '仅本次登录',
|
||||
content: '未勾选“记住我”,下次打开小程序时需要重新点击快捷登录。',
|
||||
confirmText: '继续登录',
|
||||
success: result => resolve(result.confirm),
|
||||
fail: () => resolve(false)
|
||||
}))
|
||||
if (!confirmed) return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
|
||||
async resolveLoginSession(data) {
|
||||
const session = buildSession(data)
|
||||
const userInfo = session.userInfo || {}
|
||||
if (userInfo.shopId) {
|
||||
return session
|
||||
}
|
||||
const shopOptions = buildShopOptions(session)
|
||||
if (!shopOptions.length) {
|
||||
throw new Error('当前账号没有可用店铺,无法进入管理师端')
|
||||
}
|
||||
if (shopOptions.length === 1) {
|
||||
return this.loginForShop(shopOptions[0].id)
|
||||
}
|
||||
this.setData({
|
||||
shopOptions,
|
||||
shopSelectVisible: true,
|
||||
shopSelectMode: 'login'
|
||||
})
|
||||
return null
|
||||
},
|
||||
|
||||
openRegistrationFlow(data) {
|
||||
const ticket = String(data.registrationTicket || '').trim()
|
||||
const status = data.registrationStatus
|
||||
if (status === 'PENDING_ADMIN' || status === 'PENDING_MANAGER') {
|
||||
wx.showToast({ title: status === 'PENDING_ADMIN' ? '管理员审核中' : '店长审核中', icon: 'none', duration: 2500 })
|
||||
return
|
||||
}
|
||||
if (!ticket) {
|
||||
wx.showToast({ title: data.registrationRejectReason || '该手机号需要先完成身份注册', icon: 'none', duration: 2200 })
|
||||
return
|
||||
}
|
||||
wx.showToast({ title: '手机号已验证,请完成身份注册', icon: 'none', duration: 1600 })
|
||||
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)
|
||||
},
|
||||
|
||||
buildLoginRequestData(shopId) {
|
||||
const form = this.data.form
|
||||
if (this.data.loginMode === 'phone') {
|
||||
return {
|
||||
phone: String(form.phone || '').trim(),
|
||||
verificationCode: String(form.code || '').trim(),
|
||||
rememberMe: !!this.data.rememberMe,
|
||||
...this.buildAgreementPayload(),
|
||||
...(shopId ? { shopId } : {})
|
||||
}
|
||||
}
|
||||
return {
|
||||
account: form.account,
|
||||
password: form.password,
|
||||
rememberMe: !!this.data.rememberMe,
|
||||
...this.buildAgreementPayload(),
|
||||
...(shopId ? { shopId } : {})
|
||||
}
|
||||
},
|
||||
|
||||
requestLogin(shopId) {
|
||||
const data = this.buildLoginRequestData(shopId)
|
||||
return this.data.loginMode === 'phone'
|
||||
? authApi.phoneLogin(data)
|
||||
: authApi.login(data)
|
||||
},
|
||||
|
||||
async loginForShop(shopId) {
|
||||
return assertShopSession(buildSession(await this.requestLogin(shopId)))
|
||||
},
|
||||
|
||||
async loadLoginShopOptions() {
|
||||
const form = this.data.form
|
||||
const selection = this.data.loginMode === 'phone'
|
||||
? await authApi.getPhoneLoginShops(String(form.phone || '').trim())
|
||||
: await authApi.getLoginShops(String(form.account || '').trim())
|
||||
const shopOptions = buildShopOptionsFromSelection(selection)
|
||||
if (!shopOptions.length) {
|
||||
throw new Error((selection && selection.message) || '当前账号没有可用店铺,无法进入管理师端')
|
||||
}
|
||||
return shopOptions
|
||||
},
|
||||
|
||||
async openLoginShopSelector() {
|
||||
const shopOptions = await this.loadLoginShopOptions()
|
||||
if (shopOptions.length === 1) {
|
||||
await this.loginWithSelectedShop(shopOptions[0].id)
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
shopOptions,
|
||||
shopSelectVisible: true,
|
||||
shopSelectMode: 'login'
|
||||
})
|
||||
},
|
||||
|
||||
closeShopSelector() {
|
||||
this.setData({
|
||||
shopOptions: [],
|
||||
shopSelectMode: '',
|
||||
shopSelectVisible: false
|
||||
})
|
||||
},
|
||||
|
||||
async tryOpenLoginShopSelector() {
|
||||
async quickLogin() {
|
||||
if (this.data.loading || !(await this.ensureCanLogin())) return
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
await this.openLoginShopSelector()
|
||||
return true
|
||||
const result = await authApi.wechatQuickLogin({ wxCode: await wxLoginCode(), ...this.agreementPayload() })
|
||||
this.setData({ loginState: result })
|
||||
await this.handleResult(result)
|
||||
} catch (error) {
|
||||
return false
|
||||
this.setData({ loginState: { status: 'ERROR', message: error.message || '快捷登录失败,请重试' } })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
async selectLoginShop(event) {
|
||||
if (this.data.switchingShop) {
|
||||
async handleResult(result) {
|
||||
if (result.status === 'SUCCESS' && result.accessToken) return this.finishLogin(result)
|
||||
if (result.status === 'SELECT_SHOP') {
|
||||
this.setData({ shopOptions: shopOptions(result), loginTicket: result.ticket, shopSelectVisible: true })
|
||||
return
|
||||
}
|
||||
const shopId = event.currentTarget.dataset.id
|
||||
if (!shopId) {
|
||||
wx.showToast({ title: '请选择店铺', icon: 'none' })
|
||||
if (result.status === 'NEED_REGISTRATION' && result.registrationTicket) {
|
||||
const query = [
|
||||
`registrationTicket=${encodeURIComponent(result.registrationTicket)}`,
|
||||
result.registrationApplicationId ? `applicationId=${encodeURIComponent(result.registrationApplicationId)}` : ''
|
||||
].filter(Boolean).join('&')
|
||||
wx.navigateTo({ url: `/pages/register/index?${query}` })
|
||||
return
|
||||
}
|
||||
wx.showToast({ title: result.message || '当前账号暂不能登录', icon: 'none', duration: 2500 })
|
||||
},
|
||||
|
||||
async selectShop(event) {
|
||||
if (this.data.switchingShop) return
|
||||
this.setData({ switchingShop: true })
|
||||
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)
|
||||
}
|
||||
const result = await authApi.wechatConfirmLogin({
|
||||
ticket: this.data.loginTicket,
|
||||
shopId: event.currentTarget.dataset.id,
|
||||
...this.agreementPayload()
|
||||
})
|
||||
if (result.status !== 'SUCCESS' || !result.accessToken) throw new Error(result.message || '进入门店失败')
|
||||
this.finishLogin(result)
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '进入店铺失败', icon: 'none' })
|
||||
wx.showToast({ title: error.message || '进入门店失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ switchingShop: false })
|
||||
}
|
||||
},
|
||||
|
||||
async loginWithSelectedShop(shopId) {
|
||||
const session = await this.loginForShop(shopId)
|
||||
const app = getApp()
|
||||
app.setSession(session)
|
||||
this.saveLoginPreference()
|
||||
this.closeShopSelector()
|
||||
wx.reLaunch({ url: '/pages/planning/index' })
|
||||
},
|
||||
|
||||
async switchSelectedShop(shopId) {
|
||||
const session = buildSession(await authApi.switchShop(shopId))
|
||||
const app = getApp()
|
||||
app.setSession(session)
|
||||
this.closeShopSelector()
|
||||
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 || '进入店铺失败')
|
||||
}
|
||||
finishLogin(result) {
|
||||
getApp().setSession(result)
|
||||
this.closeShopSelector()
|
||||
auth.setLoginPreference(this.data.rememberMe ? {
|
||||
rememberMe: true,
|
||||
preferredShopId: result.userInfo && result.userInfo.shopId,
|
||||
agreementVersions: this.agreementPayload().agreementVersions
|
||||
} : { rememberMe: false })
|
||||
wx.reLaunch({ url: '/pages/planning/index' })
|
||||
},
|
||||
|
||||
startCountdown() {
|
||||
if (this.data.countdownTimer) {
|
||||
clearInterval(this.data.countdownTimer)
|
||||
}
|
||||
this.setData({ countdown: 60 })
|
||||
const timer = setInterval(() => {
|
||||
const next = this.data.countdown - 1
|
||||
if (next <= 0) {
|
||||
clearInterval(timer)
|
||||
this.setData({ countdown: 0, countdownTimer: null })
|
||||
return
|
||||
}
|
||||
this.setData({ countdown: next })
|
||||
}, 1000)
|
||||
this.setData({ countdownTimer: timer })
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
if (this.data.countdownTimer) {
|
||||
clearInterval(this.data.countdownTimer)
|
||||
}
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (this.data.loading) {
|
||||
return
|
||||
}
|
||||
const form = this.data.form
|
||||
if (this.data.loginMode === 'password' && (!form.account || !form.password)) {
|
||||
wx.showToast({ title: '请填写账号和密码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (this.data.loginMode === 'phone' && (!PHONE_REGEX.test(String(form.phone || '').trim()) || !String(form.code || '').trim())) {
|
||||
wx.showToast({ title: '请输入正确手机号和验证码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
await this.loadAgreements()
|
||||
if (!this.ensureAgreementAccepted()) {
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const app = getApp()
|
||||
const data = await this.requestLogin('')
|
||||
if (this.data.loginMode === 'phone' && data && data.registrationRequired) {
|
||||
this.openRegistrationFlow(data)
|
||||
return
|
||||
}
|
||||
const session = await this.resolveLoginSession(data)
|
||||
if (!session) {
|
||||
return
|
||||
}
|
||||
app.setSession(assertShopSession(session))
|
||||
this.saveLoginPreference()
|
||||
wx.reLaunch({ url: '/pages/planning/index' })
|
||||
} catch (error) {
|
||||
if (String(error.message || '').indexOf('禁用') !== -1) {
|
||||
await this.showRegistrationStatus()
|
||||
return
|
||||
}
|
||||
if (isShopSelectionRequiredError(error)) {
|
||||
try {
|
||||
if (!this.data.shopSelectVisible) {
|
||||
await this.openLoginShopSelector()
|
||||
}
|
||||
} catch (shopError) {
|
||||
wx.showToast({ title: shopError.message || '店铺列表加载失败', icon: 'none' })
|
||||
}
|
||||
return
|
||||
}
|
||||
wx.showToast({ title: error.message || '登录失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
async showRegistrationStatus() {
|
||||
try {
|
||||
const phone = this.data.loginMode === 'phone' ? this.data.form.phone : this.data.form.account
|
||||
const status = await authApi.getRegistrationStatus(String(phone || '').trim())
|
||||
const statusText = {
|
||||
PENDING_ADMIN: '管理员审核中',
|
||||
PENDING_MANAGER: '店长审核中',
|
||||
REJECTED: `申请已驳回:${status.rejectReason || '请修改资料后重新提交'}`,
|
||||
APPROVED: '账号已审核,请稍后重试登录'
|
||||
}[status.status] || '账号暂不可用'
|
||||
wx.showToast({ title: statusText, icon: 'none', duration: 3000 })
|
||||
} catch (statusError) {
|
||||
wx.showToast({ title: statusError.message || '账号已被禁用', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
async getWechatCode() {
|
||||
const result = await new Promise((resolve, reject) => wx.login({ success: resolve, fail: reject }))
|
||||
return result.code
|
||||
},
|
||||
|
||||
goRegister(wxCode) {
|
||||
const query = wxCode ? `?wxCode=${encodeURIComponent(wxCode)}` : ''
|
||||
wx.navigateTo({ url: `/pages/register/index${query}` })
|
||||
},
|
||||
|
||||
async wechatLogin() {
|
||||
try {
|
||||
const loginResult = await new Promise((resolve, reject) => {
|
||||
wx.login({ success: resolve, fail: reject })
|
||||
})
|
||||
const result = await authApi.wechatAutoLogin(loginResult.code)
|
||||
if (result.status === 'NEED_MANUAL_LOGIN') {
|
||||
wx.showToast({ title: '新账号请先完成手机号注册和身份审核', icon: 'none', duration: 2500 })
|
||||
const wxCode = await this.getWechatCode()
|
||||
setTimeout(() => this.goRegister(wxCode), 900)
|
||||
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' })
|
||||
}
|
||||
},
|
||||
|
||||
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 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "登录"
|
||||
"navigationBarTitleText": "登录",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationBarTextStyle": "black",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<view class="page no-tab auth-page">
|
||||
<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 class="login-page">
|
||||
<view class="login-main">
|
||||
<view class="brand-area"><image class="login-logo" src="/assets/images/app-icon.png" mode="aspectFill"></image><text class="brand-name">{{appName}}</text><text class="brand-sub">Salon 门店工作台</text></view>
|
||||
<view wx:if="{{loginState && loginState.status !== 'READY' && loginState.status !== 'NEW_USER'}}" class="state-line"><text class="state-title">{{loginState.status === 'PENDING_REVIEW' ? '申请审核中' : loginState.status === 'REJECTED' ? '申请需要修改' : loginState.status === 'DISABLED' ? '账号暂不可用' : loginState.status === 'ERROR' ? '连接失败' : '账号状态'}}</text><text class="state-message">{{loginState.registrationRejectReason || loginState.message}}</text></view>
|
||||
<view class="action-area">
|
||||
<button class="quick-btn" loading="{{loading}}" disabled="{{loading || agreementLoading}}" bindtap="quickLogin"><text class="wechat-symbol">微</text><text>微信快捷登录</text></button>
|
||||
<view class="remember-row" bindtap="toggleRememberMe"><view class="check {{rememberMe ? 'checked' : ''}}">{{rememberMe ? '✓' : ''}}</view><text>记住我,下次自动登录</text></view>
|
||||
</view>
|
||||
</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 class="agreement-footer">
|
||||
<view class="agreement-line" bindtap="toggleAgreement"><view class="check small {{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>
|
||||
<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 wx:if="{{agreementModalVisible}}" class="modal-mask" catchtouchmove="stopTap"><view class="agreement-sheet"><view class="sheet-handle"></view><text class="modal-title">{{selectedAgreement.title || '隐私保护提示'}}</text><text class="modal-version">版本 {{selectedAgreement.version || '-'}}</text><scroll-view class="modal-body" scroll-y><text>{{selectedAgreement.content || '暂无协议内容'}}</text></scroll-view><view class="sheet-actions"><button class="sheet-btn secondary" bindtap="closeAgreementModal">关闭</button><button class="sheet-btn primary" bindtap="acceptAgreementModal">同意并继续</button></view></view></view>
|
||||
<view wx:if="{{shopSelectVisible}}" class="modal-mask center"><view class="shop-dialog"><text class="modal-title">选择本次登录门店</text><view wx:for="{{shopOptions}}" wx:key="id" class="shop-option" data-id="{{item.id}}" bindtap="selectShop"><view class="shop-icon">店</view><text>{{item.name}}</text><text class="shop-arrow">›</text></view><text wx:if="{{switchingShop}}" class="switching">正在进入门店…</text></view></view>
|
||||
</view>
|
||||
|
||||
@@ -1,554 +1,3 @@
|
||||
.auth-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
padding: 34rpx 28rpx 48rpx;
|
||||
background: #f4f8f5;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 30rpx;
|
||||
background: #e5eee9;
|
||||
box-shadow: 0 16rpx 34rpx rgba(111, 143, 131, 0.24);
|
||||
}
|
||||
|
||||
.brand-name {
|
||||
margin-top: 24rpx;
|
||||
color: #2e4a3d;
|
||||
font-size: 42rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.brand-sub {
|
||||
margin-top: 8rpx;
|
||||
color: #7b8f82;
|
||||
font-size: 23rpx;
|
||||
}
|
||||
|
||||
.auth-card {
|
||||
padding: 30rpx 24rpx 26rpx;
|
||||
border: 1rpx solid #e1ebe3;
|
||||
border-radius: 24rpx;
|
||||
background: #fbfdfb;
|
||||
box-shadow: 0 18rpx 46rpx rgba(55, 94, 72, .08);
|
||||
}
|
||||
|
||||
.welcome-copy { color: #2e4a3d; font-size: 34rpx; font-weight: 800; }
|
||||
.welcome-hint { margin-top: 8rpx; color: #87978c; font-size: 23rpx; }
|
||||
|
||||
.mode-tabs {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12rpx;
|
||||
margin: 12rpx 0 10rpx;
|
||||
padding: 8rpx;
|
||||
border-radius: 12px;
|
||||
background: #edf5ef;
|
||||
}
|
||||
|
||||
.mode-tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 64rpx;
|
||||
border-radius: 10px;
|
||||
color: #766f66;
|
||||
font-size: 24rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.mode-tab.active {
|
||||
background: #ffffff;
|
||||
color: #3d6652;
|
||||
box-shadow: 0 8rpx 18rpx rgba(58, 48, 34, 0.08);
|
||||
}
|
||||
|
||||
.code-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
gap: 14rpx;
|
||||
}
|
||||
|
||||
.auth-card .field {
|
||||
display: block;
|
||||
min-height: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.auth-card .field-label {
|
||||
display: block;
|
||||
width: auto;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.auth-card .field input {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 84rpx;
|
||||
flex: none;
|
||||
padding: 0 24rpx;
|
||||
border: 1rpx solid #dfe9e1;
|
||||
border-radius: 14rpx;
|
||||
background: #f7faf7;
|
||||
}
|
||||
|
||||
.code-input {
|
||||
width: auto !important;
|
||||
min-width: 0;
|
||||
flex: 1 !important;
|
||||
}
|
||||
|
||||
.code-btn {
|
||||
width: 176rpx;
|
||||
min-width: 176rpx;
|
||||
max-width: 176rpx;
|
||||
height: 68rpx;
|
||||
flex: none;
|
||||
padding: 0;
|
||||
border: 1rpx solid #b9d0c0;
|
||||
border-radius: 12rpx;
|
||||
background: #edf5ef;
|
||||
color: #6f8f83;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
line-height: 68rpx;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.code-btn.counting {
|
||||
color: #aaa39a;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.agreement-row,
|
||||
.remember-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14rpx;
|
||||
margin-top: 22rpx;
|
||||
color: #736c63;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.remember-row {
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.agreement-check {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 34rpx;
|
||||
min-width: 34rpx;
|
||||
height: 34rpx;
|
||||
border: 1rpx solid #bfb7ad;
|
||||
border-radius: 8rpx;
|
||||
color: #fffdf8;
|
||||
font-size: 22rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.agreement-check.checked {
|
||||
border-color: #6f8f83;
|
||||
background: #6f8f83;
|
||||
}
|
||||
|
||||
.agreement-copy {
|
||||
flex: 1;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.agreement-link {
|
||||
color: #55786d;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.agreement-error {
|
||||
margin-top: 16rpx;
|
||||
color: #c36a6a;
|
||||
font-size: 23rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.login-btn.disabled {
|
||||
opacity: 0.56;
|
||||
}
|
||||
|
||||
.auth-links {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.wechat-btn {
|
||||
margin-top: 34rpx;
|
||||
border: 1rpx solid #c9dbce;
|
||||
background: #edf5ef;
|
||||
color: #3d6652;
|
||||
}
|
||||
|
||||
.shop-select-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 20;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48rpx;
|
||||
background: rgba(36, 33, 29, 0.38);
|
||||
}
|
||||
|
||||
.shop-select-dialog {
|
||||
width: 100%;
|
||||
max-height: 76vh;
|
||||
padding: 28rpx;
|
||||
border-radius: 8px;
|
||||
background: #fffdf8;
|
||||
box-shadow: 0 24rpx 64rpx rgba(58, 48, 34, 0.18);
|
||||
}
|
||||
|
||||
.shop-select-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 22rpx;
|
||||
}
|
||||
|
||||
.shop-select-title {
|
||||
color: #24211d;
|
||||
font-size: 32rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.shop-select-subtitle {
|
||||
color: #928a80;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.shop-option-list {
|
||||
max-height: 520rpx;
|
||||
}
|
||||
|
||||
.shop-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18rpx;
|
||||
min-height: 112rpx;
|
||||
margin-bottom: 14rpx;
|
||||
padding: 18rpx;
|
||||
border: 1rpx solid #ece3d7;
|
||||
border-radius: 8px;
|
||||
background: #fbf7f0;
|
||||
}
|
||||
|
||||
.shop-option.disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.shop-option-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 72rpx;
|
||||
min-width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 8px;
|
||||
background: #e5eee9;
|
||||
color: #55786d;
|
||||
font-size: 26rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.shop-option-copy {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.shop-option-name {
|
||||
color: #2f2a25;
|
||||
font-size: 28rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.shop-option-id {
|
||||
color: #9a9288;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.shop-switching {
|
||||
margin-top: 12rpx;
|
||||
color: #6f8f83;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.agreement-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 90;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 28rpx;
|
||||
background: rgba(36, 33, 29, 0.42);
|
||||
}
|
||||
|
||||
.agreement-modal {
|
||||
width: 100%;
|
||||
max-height: 82vh;
|
||||
padding: 30rpx 28rpx;
|
||||
border-radius: 24rpx;
|
||||
background: #fffdf8;
|
||||
box-shadow: 0 24rpx 64rpx rgba(58, 48, 34, 0.18);
|
||||
}
|
||||
|
||||
.agreement-modal-title {
|
||||
color: #24211d;
|
||||
font-size: 32rpx;
|
||||
font-weight: 900;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.agreement-modal-meta {
|
||||
margin-top: 10rpx;
|
||||
color: #928a80;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.agreement-modal-body {
|
||||
height: 640rpx;
|
||||
max-height: 56vh;
|
||||
margin-top: 22rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 18rpx;
|
||||
background: #f3eee7;
|
||||
color: #2f2a25;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.85;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
.login-page { box-sizing:border-box; display:flex; min-height:calc(100vh - 88rpx); flex-direction:column; padding:0 56rpx 38rpx; background:#fff; }.login-main { display:flex; flex:1; flex-direction:column; }.brand-area { display:flex; flex-direction:column; align-items:center; padding-top:190rpx; }.login-logo { width:196rpx; height:196rpx; border-radius:46rpx; }.brand-name { margin-top:26rpx; color:#202522; font-size:40rpx; font-weight:800; letter-spacing:3rpx; }.brand-sub { margin-top:10rpx; color:#9a9f9c; font-size:22rpx; letter-spacing:4rpx; }.action-area { margin-top:118rpx; }.quick-btn { display:flex; align-items:center; justify-content:center; height:92rpx; border-radius:999rpx; background:#2f8f78; color:#fff; font-size:30rpx; font-weight:500; line-height:92rpx; box-shadow:0 10rpx 20rpx rgba(47,143,120,.16); }.quick-btn::after { border:0; }.wechat-symbol { display:flex; align-items:center; justify-content:center; width:38rpx; height:38rpx; margin-right:14rpx; border:2rpx solid rgba(255,255,255,.9); border-radius:50%; font-size:18rpx; font-weight:800; line-height:38rpx; }.remember-row { display:flex; align-items:center; justify-content:center; margin-top:30rpx; color:#737a76; font-size:23rpx; }.check { display:flex; align-items:center; justify-content:center; width:32rpx; height:32rpx; margin-right:12rpx; border:2rpx solid #b7bdb9; border-radius:50%; color:#fff; font-size:19rpx; }.check.small { width:28rpx; height:28rpx; flex:none; margin-right:8rpx; border-radius:7rpx; }.check.checked { border-color:#2f8f78; background:#2f8f78; }.state-line { display:flex; flex-direction:column; align-items:center; margin-top:34rpx; }.state-title { color:#765b32; font-size:24rpx; font-weight:700; }.state-message { margin-top:7rpx; color:#9a8260; font-size:20rpx; text-align:center; }.agreement-footer { padding-top:50rpx; }.agreement-line { display:flex; align-items:flex-start; justify-content:center; }.agreement-copy { color:#a0a4a1; font-size:20rpx; line-height:1.55; text-align:center; }.agreement-link { color:#6b7570; }.agreement-error { margin-top:10rpx; color:#ad6954; font-size:19rpx; text-align:center; }
|
||||
.modal-mask { position:fixed; z-index:20; inset:0; display:flex; align-items:flex-end; background:rgba(0,0,0,.56); }.modal-mask.center { align-items:center; justify-content:center; padding:36rpx; }.agreement-sheet { box-sizing:border-box; width:100%; max-height:74vh; padding:16rpx 42rpx 48rpx; border-radius:28rpx 28rpx 0 0; background:#fff; }.sheet-handle { width:72rpx; height:8rpx; margin:0 auto 34rpx; border-radius:999rpx; background:#e4e5e4; }.modal-title { display:block; color:#222724; font-size:34rpx; font-weight:800; }.modal-version { display:block; margin-top:10rpx; color:#a1a5a2; font-size:21rpx; }.modal-body { height:38vh; margin-top:24rpx; color:#707773; font-size:25rpx; line-height:1.75; white-space:pre-wrap; }.sheet-actions { display:flex; gap:24rpx; margin-top:30rpx; }.sheet-btn { height:88rpx; flex:1; border-radius:14rpx; font-size:29rpx; line-height:88rpx; }.sheet-btn.secondary { background:#f3f3f3; color:#242824; }.sheet-btn.primary { background:#19be72; color:#fff; }.shop-dialog { box-sizing:border-box; width:100%; padding:34rpx; border-radius:24rpx; background:#fff; }.shop-option { display:flex; align-items:center; margin-top:20rpx; padding:22rpx; border-radius:16rpx; background:#f3f8f5; color:#344b40; font-size:26rpx; }.shop-icon { display:flex; align-items:center; justify-content:center; width:52rpx; height:52rpx; margin-right:16rpx; border-radius:14rpx; background:#dbe9df; color:#35634d; font-weight:800; }.shop-arrow { margin-left:auto; color:#82948a; font-size:34rpx; }.switching { display:block; margin-top:20rpx; color:#82948a; text-align:center; }
|
||||
@media (max-height:700px) { .brand-area { padding-top:90rpx; }.action-area { margin-top:70rpx; }.login-logo { width:160rpx; height:160rpx; } }
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
const planningApi = require('../../api/planning')
|
||||
const dateUtil = require('../../utils/date')
|
||||
const userApi = require('../../api/user')
|
||||
const auth = require('../../utils/auth')
|
||||
const { uploadProfileImage } = require('../../utils/upload')
|
||||
|
||||
function canCreateAppointment() {
|
||||
const app = getApp()
|
||||
@@ -82,7 +85,11 @@ Page({
|
||||
pendingCount: 0,
|
||||
canCreateAppointment: true,
|
||||
loading: false,
|
||||
calendarError: ''
|
||||
calendarError: '',
|
||||
phoneBannerVisible: false,
|
||||
profilePromptVisible: false,
|
||||
profileSaving: false,
|
||||
profileForm: { nickname: '', avatar: '' }
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -99,6 +106,71 @@ Page({
|
||||
wx.removeStorageSync('planningNeedRefresh')
|
||||
this.loadCalendar()
|
||||
}
|
||||
this.refreshAccountPrompts()
|
||||
},
|
||||
|
||||
async refreshAccountPrompts() {
|
||||
try {
|
||||
const profile = await userApi.info()
|
||||
const session = auth.getSession()
|
||||
getApp().setSession({ ...session, userInfo: { ...(session.userInfo || {}), ...profile } })
|
||||
const today = dateUtil.formatDate(new Date())
|
||||
const dismissed = wx.getStorageSync(auth.PHONE_BANNER_DISMISSED_KEY)
|
||||
const missingNickname = !String(profile.nickname || '').trim() || String(profile.nickname).startsWith('微信用户')
|
||||
const skipped = wx.getStorageSync(auth.PROFILE_PROMPT_SKIPPED_KEY) === '1'
|
||||
this.setData({
|
||||
phoneBannerVisible: Number(profile.phoneVerified) !== 1 && dismissed !== today,
|
||||
profilePromptVisible: !skipped && (missingNickname || !profile.avatar),
|
||||
profileForm: { nickname: missingNickname ? '' : profile.nickname, avatar: profile.avatar || '' }
|
||||
})
|
||||
} catch (error) {
|
||||
// 资料提醒失败不影响规划数据。
|
||||
}
|
||||
},
|
||||
|
||||
openAccountSettings() { wx.navigateTo({ url: '/pages/account-settings/index' }) },
|
||||
|
||||
dismissPhoneBanner() {
|
||||
wx.setStorageSync(auth.PHONE_BANNER_DISMISSED_KEY, dateUtil.formatDate(new Date()))
|
||||
this.setData({ phoneBannerVisible: false })
|
||||
},
|
||||
|
||||
onNicknameInput(event) { this.setData({ 'profileForm.nickname': event.detail.value }) },
|
||||
|
||||
async chooseWechatAvatar(event) {
|
||||
const filePath = event.detail && event.detail.avatarUrl
|
||||
if (!filePath) return
|
||||
this.setData({ profileSaving: true })
|
||||
try {
|
||||
const avatar = await uploadProfileImage(filePath)
|
||||
this.setData({ 'profileForm.avatar': avatar })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '头像上传失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ profileSaving: false })
|
||||
}
|
||||
},
|
||||
|
||||
skipProfilePrompt() {
|
||||
wx.setStorageSync(auth.PROFILE_PROMPT_SKIPPED_KEY, '1')
|
||||
this.setData({ profilePromptVisible: false })
|
||||
},
|
||||
|
||||
async saveWechatProfile() {
|
||||
const nickname = String(this.data.profileForm.nickname || '').trim()
|
||||
if (!nickname || !this.data.profileForm.avatar) {
|
||||
wx.showToast({ title: '请选择头像并填写昵称', icon: 'none' }); return
|
||||
}
|
||||
this.setData({ profileSaving: true })
|
||||
try {
|
||||
await userApi.updateInfo({ nickname, avatar: this.data.profileForm.avatar })
|
||||
this.setData({ profilePromptVisible: false })
|
||||
wx.showToast({ title: '资料已保存' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '资料保存失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ profileSaving: false })
|
||||
}
|
||||
},
|
||||
|
||||
switchView(event) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<view class="page planning-page">
|
||||
<view wx:if="{{phoneBannerVisible}}" class="phone-banner">
|
||||
<view class="phone-banner-track" bindtap="openAccountSettings"><text>绑定手机号,便于账号安全验证与重要通知</text><text>点击前往账号设置</text></view>
|
||||
<view class="phone-banner-close" catchtap="dismissPhoneBanner">×</view>
|
||||
</view>
|
||||
<view class="card control-card">
|
||||
<view class="date-row">
|
||||
<view class="date-side">
|
||||
@@ -26,6 +30,15 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{profilePromptVisible}}" class="profile-prompt-mask">
|
||||
<view class="profile-prompt">
|
||||
<text class="profile-prompt-title">完善你的工作名片</text><text class="profile-prompt-desc">头像和昵称会用于门店协作展示,可暂时跳过。</text>
|
||||
<button class="wechat-avatar" open-type="chooseAvatar" bindchooseavatar="chooseWechatAvatar"><image wx:if="{{profileForm.avatar}}" src="{{profileForm.avatar}}" mode="aspectFill"></image><text wx:else>选择头像</text></button>
|
||||
<input class="wechat-nickname" type="nickname" value="{{profileForm.nickname}}" bindinput="onNicknameInput" placeholder="填写微信昵称" />
|
||||
<button class="profile-save" loading="{{profileSaving}}" bindtap="saveWechatProfile">保存资料</button><button class="profile-skip" bindtap="skipProfilePrompt">暂时跳过</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{calendarError}}" class="calendar-error-card">
|
||||
<view class="calendar-error-copy">
|
||||
<text class="calendar-error-title">规划数据加载失败</text>
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
padding-top: 18rpx;
|
||||
}
|
||||
|
||||
.phone-banner { display:flex; align-items:center; margin-bottom:18rpx; padding:16rpx 18rpx; border-radius:14rpx; background:#fff2d8; color:#815f2b; overflow:hidden; }.phone-banner-track { display:flex; flex:1; width:0; gap:50rpx; white-space:nowrap; animation:phoneBannerScroll 10s linear infinite; font-size:22rpx; }.phone-banner-close { position:relative; z-index:2; margin-left:18rpx; padding:6rpx; background:#fff2d8; font-size:32rpx; }.profile-prompt-mask { position:fixed; z-index:30; inset:0; display:flex; align-items:center; justify-content:center; padding:40rpx; background:rgba(25,41,33,.55); }.profile-prompt { box-sizing:border-box; display:flex; width:100%; flex-direction:column; align-items:center; padding:36rpx; border-radius:24rpx; background:#fff; }.profile-prompt-title { color:#30483c; font-size:32rpx; font-weight:800; }.profile-prompt-desc { margin-top:10rpx; color:#89988f; font-size:22rpx; text-align:center; }.wechat-avatar { display:flex; align-items:center; justify-content:center; width:128rpx; height:128rpx; margin-top:28rpx; padding:0; border-radius:50%; background:#e6f0e9; color:#416c56; font-size:22rpx; overflow:hidden; }.wechat-avatar image { width:100%; height:100%; }.wechat-nickname { box-sizing:border-box; width:100%; height:80rpx; margin-top:24rpx; padding:0 22rpx; border:1rpx solid #dce8df; border-radius:13rpx; background:#f7faf8; }.profile-save { width:100%; height:80rpx; margin-top:22rpx; border-radius:14rpx; background:#35634d; color:#fff; line-height:80rpx; }.profile-skip { margin-top:12rpx; background:transparent; color:#7e8e85; font-size:23rpx; }
|
||||
@keyframes phoneBannerScroll { from { transform:translateX(0); } to { transform:translateX(-48%); } }
|
||||
|
||||
.today-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -44,9 +44,9 @@ Page({
|
||||
},
|
||||
menus: [
|
||||
{ title: '个人信息', action: 'editProfile' },
|
||||
{ title: '账号设置', url: '/pages/account-settings/index' },
|
||||
{ title: '店铺设置', url: '/pages/shop-settings/index' },
|
||||
{ title: '数据导出', url: '/pages/export/index' },
|
||||
{ title: '修改密码', url: '/pages/password/index' },
|
||||
{ title: '关于系统', url: '/pages/about/index' }
|
||||
]
|
||||
},
|
||||
@@ -146,6 +146,8 @@ Page({
|
||||
nickname: profile.nickname || '',
|
||||
avatar: profile.avatar || '',
|
||||
phone: profile.phone || currentUserInfo.phone || '',
|
||||
phoneVerified: profile.phoneVerified,
|
||||
maskedPhone: profile.maskedPhone || '',
|
||||
contactPhone: profile.contactPhone || '',
|
||||
wechatId: profile.wechatId || '',
|
||||
signature: profile.signature || '',
|
||||
|
||||
@@ -1,112 +1,82 @@
|
||||
const authApi = require('../../api/auth')
|
||||
|
||||
const PHONE_REGEX = /^1[3-9]\d{9}$/
|
||||
|
||||
Page({
|
||||
data: {
|
||||
step: 1,
|
||||
role: 'manager',
|
||||
passwordMode: false,
|
||||
form: { phone: '', code: '', password: '', confirmPassword: '', shopName: '', shopAddress: '', shopId: '' },
|
||||
wxCode: '',
|
||||
form: { shopName: '', shopAddress: '', shopId: '' },
|
||||
registrationTicket: '',
|
||||
applicationId: '',
|
||||
phoneVerified: false,
|
||||
shopOptions: [],
|
||||
shopIndex: 0,
|
||||
selectedShopName: '',
|
||||
loading: false,
|
||||
codeLoading: false,
|
||||
countdown: 0,
|
||||
codeSent: false,
|
||||
countdownTimer: null,
|
||||
agreementAccepted: false
|
||||
ticketInvalid: false
|
||||
},
|
||||
|
||||
async onLoad(options) {
|
||||
const registrationTicket = options && options.registrationTicket ? options.registrationTicket : ''
|
||||
this.setData({
|
||||
wxCode: options && options.wxCode ? options.wxCode : '',
|
||||
registrationTicket,
|
||||
applicationId: options && options.applicationId ? options.applicationId : '',
|
||||
phoneVerified: Boolean(registrationTicket),
|
||||
'form.phone': options && options.phone ? options.phone : '',
|
||||
step: registrationTicket ? 2 : 1
|
||||
ticketInvalid: !registrationTicket
|
||||
})
|
||||
try {
|
||||
const shopOptions = await authApi.getAvailableRegistrationShops()
|
||||
this.setData({ shopOptions: Array.isArray(shopOptions) ? shopOptions : [] })
|
||||
const shops = await authApi.getAvailableRegistrationShops()
|
||||
this.setData({
|
||||
shopOptions: (Array.isArray(shops) ? shops : []).map(item => ({
|
||||
id: item.id,
|
||||
name: item.shopName || item.name,
|
||||
address: item.address || ''
|
||||
}))
|
||||
})
|
||||
} catch (error) {
|
||||
this.setData({ shopOptions: [] })
|
||||
}
|
||||
},
|
||||
|
||||
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.setData({ codeSent: true }); this.startCountdown() } catch (error) { wx.showToast({ title: error.message || '发送失败', icon: 'none' }) } finally { this.setData({ codeLoading: false }) }
|
||||
},
|
||||
|
||||
continueFromPhone() {
|
||||
const form = this.data.form
|
||||
if (!PHONE_REGEX.test(String(form.phone || '').trim()) || !/^\d{6}$/.test(String(form.code || '').trim())) { wx.showToast({ title: '请输入正确手机号和6位验证码', icon: 'none' }); return }
|
||||
if (this.data.passwordMode && (!form.password || form.password !== form.confirmPassword)) { wx.showToast({ title: '请确认两次密码一致', icon: 'none' }); return }
|
||||
this.setData({ step: 2 })
|
||||
},
|
||||
|
||||
onInput(event) { this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value }) },
|
||||
selectRole(event) { this.setData({ role: event.currentTarget.dataset.role }) },
|
||||
|
||||
continueFromRole() { this.setData({ step: 3 }) },
|
||||
continueFromRole() { if (!this.data.ticketInvalid) this.setData({ step: 2 }) },
|
||||
|
||||
selectShop(event) {
|
||||
const index = Number(event.detail.value)
|
||||
const shop = this.data.shopOptions[index]
|
||||
if (!shop) return
|
||||
this.setData({ shopIndex: index, selectedShopName: shop.name, 'form.shopId': shop.id })
|
||||
if (shop) this.setData({ shopIndex: index, selectedShopName: shop.name, 'form.shopId': shop.id })
|
||||
},
|
||||
|
||||
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
|
||||
},
|
||||
goBackStep() { this.setData({ step: 1 }) },
|
||||
|
||||
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 }
|
||||
if (!this.data.registrationTicket) {
|
||||
wx.showToast({ title: '注册票据已失效,请返回重新快捷登录', icon: 'none' })
|
||||
return
|
||||
}
|
||||
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 {
|
||||
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 }) }
|
||||
await authApi.register({
|
||||
registrationTicket: this.data.registrationTicket,
|
||||
applicationId: this.data.applicationId || undefined,
|
||||
shopName: String(form.shopName || '').trim(),
|
||||
shopAddress: String(form.shopAddress || '').trim(),
|
||||
shopId: form.shopId || undefined,
|
||||
roleType: this.data.role === 'manager' ? 'MANAGER' : 'STAFF',
|
||||
agreementAccepted: true
|
||||
})
|
||||
this.setData({ step: 3, registrationTicket: '' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '提交失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
startCountdown() {
|
||||
if (this.data.countdownTimer) clearInterval(this.data.countdownTimer)
|
||||
this.setData({ countdown: 60 })
|
||||
const timer = setInterval(() => { const next = this.data.countdown - 1; if (next <= 0) { clearInterval(timer); this.setData({ countdown: 0, countdownTimer: null }); return } this.setData({ countdown: next }) }, 1000)
|
||||
this.setData({ countdownTimer: timer })
|
||||
},
|
||||
|
||||
onUnload() { if (this.data.countdownTimer) clearInterval(this.data.countdownTimer) },
|
||||
|
||||
back() { wx.navigateBack() }
|
||||
back() { wx.reLaunch({ url: '/pages/login/index' }) }
|
||||
})
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
<view class="page no-tab auth-page">
|
||||
<view class="auth-header"><image class="logo" src="/assets/images/app-icon.png" mode="aspectFill"></image><view class="header-copy"><text class="brand-name">Salon</text><text class="brand-sub">门店工作台 · 创建你的工作身份</text></view></view>
|
||||
<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" 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>
|
||||
<view wx:if="{{step === 2}}" class="card form-card"><view class="section-title">你要加入哪种工作身份?</view><view class="section-desc">不同身份需要由不同的负责人审核</view><view class="role-list"><view class="role-option {{role === 'manager' ? 'selected' : ''}}" data-role="manager" bindtap="selectRole"><view class="role-icon">店</view><view class="role-copy"><text class="role-title">店长</text><text class="role-desc">创建并负责一家 Salon 门店</text></view><text class="role-mark">{{role === 'manager' ? '✓' : '○'}}</text></view><view class="role-option {{role === 'staff' ? 'selected' : ''}}" data-role="staff" bindtap="selectRole"><view class="role-icon">员</view><view class="role-copy"><text class="role-title">店员</text><text class="role-desc">加入已有门店协同工作</text></view><text class="role-mark">{{role === 'staff' ? '✓' : '○'}}</text></view></view><button class="primary-btn" bindtap="continueFromRole">继续</button><view class="back-entry" bindtap="goBackStep">返回上一步</view></view>
|
||||
<view wx:if="{{step === 3}}" class="card form-card"><view class="section-title">{{role === 'manager' ? '完善店铺资料' : '选择要加入的店铺'}}</view><view class="section-desc">{{role === 'manager' ? '提交后由管理员审核,审核通过后即可登录' : '提交后由对应店长审核,审核通过后即可登录'}}</view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label">店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" placeholder="请输入店铺名称" /></view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label">店铺地址</text><input value="{{form.shopAddress}}" data-field="shopAddress" bindinput="onInput" placeholder="请输入门店所在地址" /></view><view wx:if="{{role === 'staff'}}" class="field"><text class="field-label">选择店铺</text><picker range="{{shopOptions}}" range-key="name" value="{{shopIndex}}" bindchange="selectShop"><view class="picker-value {{selectedShopName ? 'filled' : ''}}">{{selectedShopName || '请选择要加入的店铺'}}</view></picker></view><view wx:if="{{role === 'staff'}}" class="notice">店员申请会发送给所选店铺的店长审核</view><button class="primary-btn" loading="{{loading}}" bindtap="submit">提交审核</button><view class="back-entry" bindtap="goBackStep">返回上一步</view></view>
|
||||
<view wx:if="{{step === 4}}" class="card result-card"><view class="result-icon">✓</view><view class="section-title">申请已提交</view><view class="section-desc">{{role === 'manager' ? '管理员审核通过后,你就可以登录 Salon 工作台。' : '店长审核通过后,你就可以登录 Salon 工作台。'}}</view><view class="result-status">当前状态:<text>等待审核</text></view><button class="primary-btn" bindtap="back">返回登录</button></view>
|
||||
<view class="safe-note">注册并不代表立即获得工作台权限,审核通过后才可登录。</view>
|
||||
<view class="auth-header"><image class="logo" src="/assets/images/app-icon.png" mode="aspectFill"></image><view class="header-copy"><text class="brand-name">Salon</text><text class="brand-sub">用微信身份申请门店工作权限</text></view></view>
|
||||
<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="{{ticketInvalid}}" class="card result-card"><view class="result-icon">!</view><view class="section-title">申请入口已失效</view><view class="section-desc">请返回登录页重新点击微信快捷登录,获取新的申请凭证。</view><button class="primary-btn" bindtap="back">返回登录</button></view>
|
||||
<view wx:elif="{{step === 1}}" class="card form-card"><view class="section-title">选择工作身份</view><view class="section-desc">无需手机号和密码,审核人会根据你的身份处理申请</view><view class="role-list"><view class="role-option {{role === 'manager' ? 'selected' : ''}}" data-role="manager" bindtap="selectRole"><view class="role-icon">店</view><view class="role-copy"><text class="role-title">店长</text><text class="role-desc">创建并负责一家 Salon 门店</text></view><text class="role-mark">{{role === 'manager' ? '✓' : '○'}}</text></view><view class="role-option {{role === 'staff' ? 'selected' : ''}}" data-role="staff" bindtap="selectRole"><view class="role-icon">员</view><view class="role-copy"><text class="role-title">店员</text><text class="role-desc">加入已有门店协同工作</text></view><text class="role-mark">{{role === 'staff' ? '✓' : '○'}}</text></view></view><button class="primary-btn" bindtap="continueFromRole">继续</button></view>
|
||||
<view wx:elif="{{step === 2}}" class="card form-card"><view class="section-title">{{role === 'manager' ? '完善店铺资料' : '选择要加入的店铺'}}</view><view class="section-desc">{{role === 'manager' ? '提交后由平台管理员审核' : '提交后由对应店长审核'}}</view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label">店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" placeholder="请输入店铺名称" /></view><view wx:if="{{role === 'manager'}}" class="field"><text class="field-label">店铺地址</text><input value="{{form.shopAddress}}" data-field="shopAddress" bindinput="onInput" placeholder="请输入门店地址" /></view><view wx:if="{{role === 'staff'}}" class="field"><text class="field-label">选择店铺</text><picker range="{{shopOptions}}" range-key="name" value="{{shopIndex}}" bindchange="selectShop"><view class="picker-value {{selectedShopName ? 'filled' : ''}}">{{selectedShopName || '请选择要加入的店铺'}}</view></picker></view><view wx:if="{{role === 'staff'}}" class="notice">审核通过前不会获得门店业务权限</view><button class="primary-btn" loading="{{loading}}" bindtap="submit">提交审核</button><view class="back-entry" bindtap="goBackStep">返回上一步</view></view>
|
||||
<view wx:elif="{{step === 3}}" class="card result-card"><view class="result-icon">✓</view><view class="section-title">申请已提交</view><view class="section-desc">{{role === 'manager' ? '平台管理员审核通过后,即可使用快捷登录。' : '店长审核通过后,即可使用快捷登录。'}}</view><view class="result-status">当前状态:<text>等待审核</text></view><button class="primary-btn" bindtap="back">返回登录</button></view>
|
||||
<view class="safe-note">OpenID 仅用于识别你的微信身份,不会在页面中展示。</view>
|
||||
</view>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
const SESSION_KEY = 'fingertip_manager_session'
|
||||
const LOGIN_PREFERENCE_KEY = 'jayucloud_salon_login_preference'
|
||||
const PHONE_BANNER_DISMISSED_KEY = 'jayucloud_salon_phone_banner_dismissed'
|
||||
const PROFILE_PROMPT_SKIPPED_KEY = 'jayucloud_salon_profile_prompt_skipped'
|
||||
|
||||
function getSession() {
|
||||
try {
|
||||
@@ -21,9 +24,34 @@ function getAccessToken() {
|
||||
return session.accessToken || session.token || ''
|
||||
}
|
||||
|
||||
function getLoginPreference() {
|
||||
try { return wx.getStorageSync(LOGIN_PREFERENCE_KEY) || {} } catch (error) { return {} }
|
||||
}
|
||||
|
||||
function setLoginPreference(preference) {
|
||||
wx.setStorageSync(LOGIN_PREFERENCE_KEY, preference || {})
|
||||
}
|
||||
|
||||
function clearLoginPreference() {
|
||||
wx.removeStorageSync(LOGIN_PREFERENCE_KEY)
|
||||
}
|
||||
|
||||
function clearDeviceLoginState() {
|
||||
clearSession()
|
||||
clearLoginPreference()
|
||||
wx.removeStorageSync(PHONE_BANNER_DISMISSED_KEY)
|
||||
wx.removeStorageSync(PROFILE_PROMPT_SKIPPED_KEY)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSession,
|
||||
setSession,
|
||||
clearSession,
|
||||
getAccessToken
|
||||
getAccessToken,
|
||||
getLoginPreference,
|
||||
setLoginPreference,
|
||||
clearLoginPreference,
|
||||
clearDeviceLoginState,
|
||||
PHONE_BANNER_DISMISSED_KEY,
|
||||
PROFILE_PROMPT_SKIPPED_KEY
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# FingertipDesigner 配置整理说明
|
||||
|
||||
> 历史说明:后端环境变量注入方式已于 2026-10-10 停用。当前配置方式见 `后端配置统一由Nacos明文管理_20261010.md`。
|
||||
|
||||
## 命名空间
|
||||
|
||||
- `FingertipDesigner-Dev`:开发环境配置。
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# Salon 小程序 OpenID 快捷登录说明
|
||||
|
||||
更新时间:2026-10-10
|
||||
|
||||
## 改造范围
|
||||
|
||||
- `JC-Salon-WeChat` 仅展示微信快捷登录,不再展示手机号、验证码和密码登录入口。
|
||||
- `JC-Salon-Core` 新增微信状态探测、快捷登录、注册票据及微信手机号绑定接口。
|
||||
- `docs/scripts/sql/init/jayucloud-salon.sql` 重新定义空库用户基线:账号和密码允许为空,手机号唯一且允许多行 `NULL`。
|
||||
- 未修改 ArtList,未生成迁移或清库脚本,未连接或操作任何实际数据库。
|
||||
|
||||
本次初始化 SQL 调整是经确认的空库模型重定义,属于对仓库“冻结初始化 SQL”规则的明确任务级例外;已有环境的数据处理由后续独立任务负责。
|
||||
|
||||
## 接口与状态
|
||||
|
||||
- `POST /user/wechat-mini/status`:只探测,不创建用户、不签发 Token。
|
||||
- `POST /user/wechat-mini/quick-login`:新 OpenID 创建待审核用户,已审核用户登录。
|
||||
- `POST /user/wechat-mini/confirm-login`:多门店用户选择门店后完成登录。
|
||||
- `POST /user/wechat-mini/bind-phone`:登录后使用微信手机号凭证完成绑定。
|
||||
- 注册票据有效期为 5 分钟,只能使用一次,并在服务端校验用户、AppID 与 OpenID 绑定关系。
|
||||
|
||||
探测状态包括 `NEW_USER`、`PENDING_REVIEW`、`REJECTED`、`READY`、`DISABLED`。只有 `SUCCESS` 登录结果会返回业务 Token。
|
||||
|
||||
## 小程序行为
|
||||
|
||||
- 每次启动先获取新的微信 code 探测状态;探测 code 不复用于登录。
|
||||
- 本机开启“记住我”且状态为 `READY` 时,再获取新 code 自动登录。
|
||||
- 登录后可在“账号设置”使用微信一键绑定或短信验证码绑定手机号。
|
||||
- 规划页未绑定手机号横幅可关闭到当天;主动退出会清除会话、记住我、当天横幅关闭状态和资料提示跳过状态。
|
||||
- 昵称和头像缺失时使用 `chooseAvatar` 与 `input type="nickname"` 引导完善,可在本机跳过。
|
||||
|
||||
## 部署前检查
|
||||
|
||||
1. 确认微信小程序 AppID、AppSecret 配置正确,服务端可访问微信登录及手机号接口。
|
||||
2. 确认 Redis 可用,注册票据与多门店登录票据依赖 Redis 短期存储。
|
||||
3. 新建空库时执行更新后的 `jayucloud-salon.sql`;不得直接对已有环境执行该初始化文件。
|
||||
4. 网关与 Core 白名单已收紧为明确的探测、登录和确认登录路径;`/api/user/wechat-mini/bind-phone` 不在白名单中,必须携带有效登录会话。
|
||||
5. 仓库内 Salon 的 dev、SIT、prod Nacos `gateway.yaml` 已同步该白名单口径;发布配置前应复核目标命名空间,本文不执行任何配置发布。
|
||||
@@ -597,7 +597,7 @@ create table t_user
|
||||
primary key comment '用户主键索引',
|
||||
shop_id bigint unsigned default 0 null comment '所属店铺ID,关联店铺表主键(0表示无所属店铺)',
|
||||
nickname varchar(50) not null comment '用户昵称',
|
||||
account varchar(50) not null comment '用户账号(登录用)',
|
||||
account varchar(50) null comment '用户账号(登录用,微信快捷登录用户可为空)',
|
||||
phone varchar(50) null comment '手机号',
|
||||
contact_phone varchar(50) null comment '联系电话',
|
||||
birthday date null comment '生日',
|
||||
@@ -606,7 +606,7 @@ create table t_user
|
||||
email varchar(100) null comment '邮箱',
|
||||
phone_verified tinyint unsigned default 0 null comment '手机号是否已验证:0-未验证,1-已验证',
|
||||
email_verified tinyint unsigned default 0 null comment '邮箱是否已验证:0-未验证,1-已验证',
|
||||
password varchar(100) not null comment '用户密码(加密存储)',
|
||||
password varchar(100) null comment '用户密码(加密存储,微信快捷登录用户可为空)',
|
||||
signature varchar(200) default '' null comment '用户签名',
|
||||
level varchar(20) default '普通' null comment '用户等级',
|
||||
type tinyint not null comment '用户类型,(0-用户,2-店长,3-美甲师,4-管理员)',
|
||||
@@ -617,7 +617,9 @@ create table t_user
|
||||
status tinyint unsigned default 1 null comment '用户状态:1-正常,0-禁用',
|
||||
avatar varchar(512) null comment '头像链接',
|
||||
constraint uk_account
|
||||
unique (account) comment '用户账号唯一索引'
|
||||
unique (account) comment '用户账号唯一索引',
|
||||
constraint uk_user_phone
|
||||
unique (phone) comment '用户手机号唯一索引(允许多行NULL)'
|
||||
)
|
||||
comment '系统用户信息表';
|
||||
|
||||
@@ -625,10 +627,6 @@ create index idx_email
|
||||
on t_user (email)
|
||||
comment '按邮箱查询的索引';
|
||||
|
||||
create index idx_phone
|
||||
on t_user (phone)
|
||||
comment '按手机号查询的索引';
|
||||
|
||||
create index idx_shop_id
|
||||
on t_user (shop_id)
|
||||
comment '按店铺查询用户的索引';
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# 后端配置统一由 Nacos 明文管理说明
|
||||
|
||||
更新时间:2026-10-10
|
||||
|
||||
## 调整范围
|
||||
|
||||
本次覆盖以下后端模块与仓库 Nacos 配置源:
|
||||
|
||||
- `JC-Salon-Core`
|
||||
- `JC-Salon-Gateway`
|
||||
- `JC-ArtList-Core`
|
||||
- `JC-ArtList-Gateway`
|
||||
- `nacos/namespaces/dev`
|
||||
- `nacos/namespaces/sit`
|
||||
- `nacos/namespaces/prod`
|
||||
|
||||
前端和微信小程序不在本次范围内。本次未连接、修改或发布任何实际 Nacos 环境。
|
||||
|
||||
## 配置归属
|
||||
|
||||
四个后端模块连接 Nacos 所必需的地址、命名空间、分组、服务名、用户名和密码,直接明文写在各模块 `bootstrap.yaml` 中。这是服务读取 Nacos 前必须具备的启动引导配置。
|
||||
|
||||
数据库、Redis、RabbitMQ、对象存储、MessageHub、微信小程序及其他业务参数在仓库的 Nacos 配置源中明文管理。原 `${ENV}` 与 `${ENV:default}` 环境变量占位符已展开,不再接受操作系统环境变量覆盖。
|
||||
|
||||
ArtList Core、ArtList Gateway 和 Salon Gateway 原有 `application.yaml` 业务兜底已移除,仅保留配置归属说明。服务无法读取 Nacos 时应直接启动失败,不再回退到仓库内另一套运行参数。
|
||||
|
||||
Gateway 的 `${remaining}` 是 `RewritePath` 路由替换表达式,不属于环境变量,继续保留。
|
||||
|
||||
## 环境值处理
|
||||
|
||||
- dev、SIT、prod 保留各自的数据库地址、Redis 地址、RabbitMQ 地址、对象存储地址、数据库名、桶名和命名空间差异。
|
||||
- SIT/prod 原本缺失的用户名、密码和存储密钥按任务确认复制 dev 明文值。
|
||||
- Salon dev、SIT、prod 已写入微信小程序 AppID `wxb6d77f7c07020d51`。
|
||||
- 微信 AppSecret 当前未提供,三个环境均明确配置为空字符串。发布前必须填入真实 AppSecret,否则 OpenID 登录会返回“微信小程序登录未配置 appId/appSecret”。
|
||||
- ArtList 未发现经确认的独立微信凭据,因此未伪造或复用 Salon 微信配置。
|
||||
|
||||
## 风险
|
||||
|
||||
仓库与 Git 历史会直接保存数据库、缓存、消息队列和对象存储等明文凭据。任何拥有仓库读取权限的人均可读取这些值;凭据轮换也必须通过仓库修改和 Nacos 发布完成。
|
||||
|
||||
同一模块的 `bootstrap.yaml` 固定连接开发 Nacos。若后续需要让同一构建产物连接 SIT 或生产 Nacos,必须先明确新的启动引导选择机制;本次不保留环境变量覆盖入口。
|
||||
|
||||
## 发布步骤
|
||||
|
||||
1. 发布前补齐 Salon 微信 AppSecret,并复核每个环境的连接地址和明文凭据。
|
||||
2. 使用现有 Nacos 发布流程选择目标环境,不得跨环境混发。
|
||||
3. 先发布共享的 `infra.yaml`、`secret.yaml`,再发布 `core.yaml`、`gateway.yaml` 和 `logging.yaml`。
|
||||
4. 发布后重启对应 Core/Gateway,验证数据库、Redis、RabbitMQ、对象存储和微信接口。
|
||||
5. 本说明只描述仓库配置,不代表配置已经发布。
|
||||
|
||||
## 验证
|
||||
|
||||
- 扫描四个后端资源目录和 `nacos/namespaces/**`,除 Gateway `${remaining}` 外不得存在 `${...}`。
|
||||
- 解析全部 YAML 配置。
|
||||
- 编译四个后端 Maven 模块,并运行 Core 模块测试。
|
||||
- 确认最终 Git 差异不包含前端、小程序及用户已有工作区修改。
|
||||
|
||||
本次仓库验证结果:
|
||||
|
||||
- SnakeYAML 成功解析 37 个后端与 Nacos YAML 文件。
|
||||
- Salon Core 测试通过(3 个测试,0 失败),Salon Gateway 与 ArtList Gateway 编译通过。
|
||||
- ArtList Core 被既有 Java 源码中的历史包名导入阻断:`UserServiceImpl` 与 `UserController` 仍引用不存在的 `com.xiaowang.fingertipdesigner...` DTO 包。本次没有修改 Java 源码,该失败与配置调整无关,需另行修复后才能完成 ArtList Core 全量编译。
|
||||
- GitNexus 工具在当前会话不可用,提交前使用配置引用扫描、YAML 解析、Git 变更检查和 Maven 验证替代。
|
||||
@@ -1,5 +1,7 @@
|
||||
# 开发环境Nacos默认地址配置说明
|
||||
|
||||
> 历史说明:后端环境变量覆盖入口已于 2026-10-10 移除。当前配置方式见 `后端配置统一由Nacos明文管理_20261010.md`。
|
||||
|
||||
## 当前配置
|
||||
|
||||
- `JC-ArtList-Core/src/main/resources/bootstrap.yaml` 和 `JC-ArtList-Gateway/src/main/resources/bootstrap.yaml` 保留 `NACOS_SERVER_ADDR`、`NACOS_NAMESPACE`、`NACOS_GROUP`、`NACOS_USERNAME`、`NACOS_PASSWORD` 环境变量覆盖方式。
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 接回 MinIO 三副本对象存储配置说明
|
||||
|
||||
> 历史说明:后端对象存储环境变量覆盖入口已于 2026-10-10 移除,参数现由仓库 Nacos 配置源明文管理。当前方式见 `后端配置统一由Nacos明文管理_20261010.md`。
|
||||
|
||||
## 当前结论
|
||||
|
||||
- 开发 MinIO 服务健康检查已通过:`http://192.168.5.15:9000/minio/health/live` 返回 `200 OK`。
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 生产 Salon Core 与 Gateway 环境变量准备说明
|
||||
|
||||
> 历史说明:本方案已于 2026-10-10 停用,不得再生成或注入本文所述环境文件。当前配置方式见 `后端配置统一由Nacos明文管理_20261010.md`。
|
||||
|
||||
更新时间:2026-08-27
|
||||
|
||||
## 适用节点
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 生产与测试环境 Nacos 配置说明
|
||||
|
||||
> 历史说明:后端环境变量注入方式已于 2026-10-10 停用。当前仓库明文配置及发布前检查以 `后端配置统一由Nacos明文管理_20261010.md` 为准。
|
||||
|
||||
## 配置目录
|
||||
|
||||
Nacos 配置源按环境、命名空间和 Group 分离:
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# 后端配置统一由 Nacos 明文管理实施计划
|
||||
|
||||
## 目标
|
||||
|
||||
取消 JayuCloud 后端配置的环境变量覆盖能力:Nacos 启动引导参数明文写入四个后端模块的 `bootstrap.yaml`,其余后端参数明文写入 Salon/ArtList 的 dev、SIT、prod Nacos 配置源。前端、小程序和实际 Nacos 均不操作。
|
||||
|
||||
## 实施步骤
|
||||
|
||||
1. 生成配置占位符清单,排除 Gateway `RewritePath` 使用的 `${remaining}`。
|
||||
2. 修改 Salon Core、Salon Gateway、ArtList Core、ArtList Gateway 的 `bootstrap.yaml`:展开 Nacos 地址、命名空间、分组、用户名、密码、服务名和 Data ID。
|
||||
3. 修改六套 Nacos 配置源:将 `${ENV}` 与 `${ENV:default}` 展开为 YAML 明文值。
|
||||
4. SIT/prod 缺失凭据复制对应产品 dev 值,保留目标环境的地址、数据库名、桶名和命名空间差异。
|
||||
5. Salon 三套环境增加微信小程序配置:AppID 写为 `wxb6d77f7c07020d51`,AppSecret 因尚未提供真实值而保留明确空值;ArtList 不伪造微信凭据。
|
||||
6. 新增 `docs/scripts/后端配置统一由Nacos明文管理_20261010.md`,记录配置归属、明文风险、发布步骤、未发布事实和 AppSecret 阻塞项;同步项目变更记录。
|
||||
7. 自动检查所有后端 YAML:除 `${remaining}` 外不得存在 `${...}`;解析 YAML,并对四个 Maven 模块执行编译/测试。
|
||||
8. 检查最终差异不含前端、小程序与用户已有 `JC-Salon-Frontend/src/components.d.ts`,随后创建中文 Git 提交。
|
||||
|
||||
## 验收条件
|
||||
|
||||
- 后端运行配置不再读取操作系统环境变量。
|
||||
- 所有配置值可从 `bootstrap.yaml` 或对应 Nacos 配置源直接看到。
|
||||
- 六套环境配置保留原有环境地址差异。
|
||||
- 微信 AppID 已进入 Salon Nacos 配置源,AppSecret 缺失被明确记录。
|
||||
- 四个后端模块编译通过,配置扫描通过。
|
||||
- 不连接、不修改、不发布实际 Nacos。
|
||||
@@ -0,0 +1,100 @@
|
||||
# JayuCloud 命名统一设计
|
||||
|
||||
## 背景
|
||||
|
||||
仓库当前同时存在 `JayuCloud`、`FingertipDesigner`、`fingertipdesigner`、`jayucloudsalon` 和拼写错误的 `jacyucloudsalon`。这些名称混用于 Java 包、启动类、文档、构建配置和部署配置,增加了代码检索、模块定位和后续维护的成本。
|
||||
|
||||
本次改造统一代码层和技术文档中的项目命名,同时保留现有外部运行标识,避免对已经部署的 Nacos、服务发现、数据库和发布流程造成破坏性影响。
|
||||
|
||||
## 目标命名
|
||||
|
||||
- 技术项目名统一为 `JayuCloud`。
|
||||
- Java 根包统一为 `com.xiaowang.jayucloud`。
|
||||
- Core 启动类统一为 `JayuCloudCoreApplication`。
|
||||
- Gateway 启动类统一为 `JayuCloudGatewayApplication`。
|
||||
- `JC-Salon-*` 与 `JC-ArtList-*` 继续作为两个业务子系统的目录名和 Maven artifact 名。
|
||||
- “指尖设计师”及 `FingertipDesigner` 只在明确表示产品品牌或兼容外部协议时保留。
|
||||
|
||||
## 改造范围
|
||||
|
||||
### Java 代码
|
||||
|
||||
两个 Core 的包路径从 `com.xiaowang.jacyucloudsalon.core` 迁移到 `com.xiaowang.jayucloud.core`,两个 Gateway 的包路径从 `com.xiaowang.jayucloudsalon.gateway` 迁移到 `com.xiaowang.jayucloud.gateway`。
|
||||
|
||||
迁移同时覆盖:
|
||||
|
||||
- `package` 声明;
|
||||
- `import` 引用;
|
||||
- Java 源码目录;
|
||||
- 测试代码包路径;
|
||||
- MyBatis、Spring 扫描路径及反射字符串;
|
||||
- 启动类文件名、类名和相关引用。
|
||||
|
||||
两个子系统目前复制维护相近的 Core 与 Gateway 代码。本次只统一命名,不合并模块,也不抽取公共依赖。
|
||||
|
||||
### 构建与配置
|
||||
|
||||
检查并更新直接引用旧 Java 包名或旧启动类的 Maven 配置、测试配置、IDE 配置和发布脚本。
|
||||
|
||||
以下外部运行标识保持不变:
|
||||
|
||||
- Nacos namespace:`jayucloud-salon`、`jayucloud-artlist`;
|
||||
- Spring 服务名:`jc-salon-core`、`jc-salon-gateway` 及 ArtList 对应服务名;
|
||||
- Maven artifact 和产物名;
|
||||
- 数据库名、对象存储 bucket、Redis key 前缀;
|
||||
- 已发布 API 路径和 JWT issuer。
|
||||
|
||||
这些标识如需统一,应作为独立的部署迁移项目处理,包含双写或兼容期、环境切换和回滚方案。
|
||||
|
||||
### 前端与小程序
|
||||
|
||||
保留面向用户的“指尖设计师”等品牌文案。仅修改把历史工程名误当作当前技术项目名的注释、配置说明、测试描述和开发文档,不改变路由、存储键、API 路径或小程序标识。
|
||||
|
||||
### 文档
|
||||
|
||||
文档中的技术项目称谓统一为 `JayuCloud`,业务品牌语境继续使用“指尖设计师”。项目地图、当前状态、架构索引和运维说明中的 Java 包路径、启动类名必须与源码同步。
|
||||
|
||||
新增一份命名约定说明,明确项目名、品牌名、子系统名和外部兼容标识的边界,防止旧名称再次扩散。
|
||||
|
||||
历史变更记录中用于描述当时状态的名称不做无差别替换;只有在其声称描述“当前路径”或“当前名称”时才更新。
|
||||
|
||||
## 实施顺序
|
||||
|
||||
1. 建立所有旧名称的引用清单,并区分代码符号、文件路径、运行标识、品牌文案和历史记录。
|
||||
2. 按仓库要求对启动类和关键包迁移执行影响分析;若 GitNexus 不可用,记录原因并通过编译引用、文本引用和调用入口分析补足。
|
||||
3. 先迁移两个 Core,再迁移两个 Gateway,确保每个阶段的源码目录与包声明一致。
|
||||
4. 更新构建配置、测试、脚本及当前有效文档。
|
||||
5. 扫描旧名称残留,根据保留清单逐项确认,而不是要求零匹配。
|
||||
6. 完成构建与测试验证,最后运行仓库规定的变更影响检查。
|
||||
|
||||
## 验证标准
|
||||
|
||||
- 两个 Core 均能完成 Maven 编译和测试。
|
||||
- 两个 Gateway 均能完成 Maven 编译和测试。
|
||||
- Java 源码和测试代码中不再出现 `jacyucloudsalon` 或 `jayucloudsalon` 包声明与导入。
|
||||
- 不再存在 `FingertipDesignerCoreApplication` 或 `FingertipDesignerGatewayApplication` Java 类。
|
||||
- Spring Boot 能从新的启动类扫描到原有 Bean、Mapper、配置属性和控制器。
|
||||
- 前端与小程序不存在因技术命名调整产生的路径或接口变化。
|
||||
- Nacos namespace、服务名、数据库名、API 路径和其他外部兼容标识没有改变。
|
||||
- 所有保留的 `FingertipDesigner` 匹配项都有明确的品牌、兼容或历史原因。
|
||||
|
||||
## 风险与控制
|
||||
|
||||
- **包迁移遗漏:** 通过编译、测试和旧包名扫描共同发现。
|
||||
- **Spring/MyBatis 扫描失效:** 核对启动类位置、显式扫描注解和字符串形式的包配置。
|
||||
- **两个子系统同名启动类造成理解混淆:** 类名可以一致,但分别位于独立 Maven 模块;部署仍由 artifact 和服务名区分。
|
||||
- **误改品牌文案:** 只修改技术语境,用户界面品牌不做批量替换。
|
||||
- **误改外部标识:** 建立明确保留清单,并在提交前检查配置差异。
|
||||
- **工作区既有修改被覆盖:** 每一阶段先检查 Git 状态,只提交本任务产生的文件。
|
||||
|
||||
## 非目标
|
||||
|
||||
- 不重命名仓库根目录和八个子项目目录。
|
||||
- 不合并 Salon 与 ArtList 的重复代码。
|
||||
- 不迁移 Nacos namespace、服务名或数据库。
|
||||
- 不改变产品品牌、UI 视觉或业务行为。
|
||||
- 不调整 API 契约、数据结构或部署拓扑。
|
||||
|
||||
## 完成条件
|
||||
|
||||
代码、当前有效文档和开发约定使用统一的 JayuCloud 技术命名;历史名称只存在于明确的品牌、兼容或历史语境;全部受影响的 Java 模块完成验证,并形成可审计的中文 Git 提交。
|
||||
@@ -0,0 +1,81 @@
|
||||
# 后端配置统一由 Nacos 明文管理设计
|
||||
|
||||
## 目标
|
||||
|
||||
将 JayuCloud 全部后端服务的运行参数统一改为仓库内 Nacos 配置源明文管理,取消通过操作系统环境变量覆盖业务配置的机制。前端和微信小程序不在本次范围内。
|
||||
|
||||
涉及服务:
|
||||
|
||||
- `JC-Salon-Core`
|
||||
- `JC-Salon-Gateway`
|
||||
- `JC-ArtList-Core`
|
||||
- `JC-ArtList-Gateway`
|
||||
|
||||
涉及配置源:
|
||||
|
||||
- `nacos/namespaces/dev/**`
|
||||
- `nacos/namespaces/sit/**`
|
||||
- `nacos/namespaces/prod/**`
|
||||
|
||||
本次只修改仓库,不连接或发布实际 Nacos。
|
||||
|
||||
## 配置边界
|
||||
|
||||
### Nacos 启动引导配置
|
||||
|
||||
服务连接 Nacos 前无法从 Nacos 读取配置,因此以下参数作为唯一例外,直接明文写入四个服务各自的 `bootstrap.yaml`:
|
||||
|
||||
- Nacos 服务地址
|
||||
- 命名空间
|
||||
- 配置分组
|
||||
- 用户名
|
||||
- 密码
|
||||
- 服务注册名称和配置 Data ID
|
||||
|
||||
这些值不再使用 `${ENV}` 或 `${ENV:default}` 形式,不再接受环境变量覆盖。
|
||||
|
||||
### Nacos 托管配置
|
||||
|
||||
数据库、Redis、RabbitMQ、JWT、对象存储、短信、MessageHub、微信小程序及其他后端业务参数均由 Nacos 配置源明文提供。所有环境变量占位符替换为最终 YAML 值。
|
||||
|
||||
dev、SIT、prod 继续保留各自的主机地址、数据库名、桶名、命名空间等环境差异。SIT/prod 中当前缺少真实值的用户名、密码、令牌和密钥,按本次确认直接复制对应 dev 值。
|
||||
|
||||
Gateway 路由中的 `${remaining}` 是 `RewritePath` 正则替换表达式,不是环境变量,必须保持原样。
|
||||
|
||||
## 微信小程序配置
|
||||
|
||||
Salon 微信小程序 AppID 使用项目已确认的 `wxb6d77f7c07020d51`,写入 Salon 的 dev、SIT、prod Nacos 配置源。
|
||||
|
||||
AppSecret 无法从 AppID 推导,当前仓库也不存在可复用真实值。因此不得伪造 AppSecret。未取得真实值前保留明确空值,并在配置说明中标注登录不可用;取得真实 AppSecret 后再以独立配置修改补齐。
|
||||
|
||||
ArtList 仅在存在已确认的独立微信凭据时填写;不得默认复用 Salon 的 AppID 或 AppSecret。
|
||||
|
||||
## 修改策略
|
||||
|
||||
1. 建立后端配置文件清单,区分 Spring 环境变量占位符与 Gateway 路由表达式。
|
||||
2. 将四个 `bootstrap.yaml` 的 Nacos 启动引导参数展开为明文。
|
||||
3. 将六套命名空间(Salon/ArtList × dev/SIT/prod)中的环境变量占位符展开为明文。
|
||||
4. 对只有变量名而没有默认值的 SIT/prod 项,复制对应产品 dev 配置的凭据,同时保留目标环境自己的连接地址和资源名称。
|
||||
5. 将 Salon 微信 AppID 写入 Nacos 配置源;AppSecret 保持明确空值并记录阻塞原因。
|
||||
6. 新增日期化中文说明文档,记录配置归属、发布方法、风险和回滚方式。
|
||||
|
||||
## 安全与运维影响
|
||||
|
||||
采用此方案后,仓库、Git 历史和 Nacos 配置源都将包含明文凭据。任何具有仓库读取权限的人都能读取这些凭据;凭据轮换也必须通过修改仓库配置并重新发布完成。
|
||||
|
||||
由于用户已明确选择明文管理,本次不引入加密、密钥管理服务或环境变量兜底。发布时必须按环境复核 Nacos 命名空间,避免把 dev 凭据发布到错误环境。
|
||||
|
||||
本次不操作实际 Nacos。仓库变更生效需要后续将配置源发布到对应命名空间,并重启或刷新相关服务。
|
||||
|
||||
## 验证标准
|
||||
|
||||
- 四个后端服务的 `bootstrap.yaml` 不再包含环境变量占位符。
|
||||
- 后端 `application.yaml`、`application.yml` 及 `nacos/namespaces/**` 中除 Gateway `${remaining}` 外,不再包含 `${...}`。
|
||||
- Salon 和 ArtList 的 dev、SIT、prod YAML 均可正常解析。
|
||||
- 四个后端 Maven 项目完成编译;受影响模块的现有测试通过。
|
||||
- Git 差异不包含前端、小程序或用户已有的 `JC-Salon-Frontend/src/components.d.ts` 修改。
|
||||
- 配置治理说明记录未发布 Nacos、Salon AppSecret 尚待补齐等事实。
|
||||
|
||||
## 回滚
|
||||
|
||||
仓库层面通过回滚本次配置提交恢复环境变量占位符。若未来已经发布到 Nacos,则还需将回滚后的配置重新发布到对应命名空间;仅回滚 Git 不会自动改变线上 Nacos。
|
||||
@@ -1,5 +1,7 @@
|
||||
# 运维配置与集成说明
|
||||
|
||||
> 已于 2026-10-10 停用后端环境变量注入方案。当前以 `docs/scripts/后端配置统一由Nacos明文管理_20261010.md` 为准;本文中的环境变量表仅保留为历史记录,不得继续作为部署依据。
|
||||
|
||||
## 双端生产隔离
|
||||
|
||||
设计师端和店务端分别使用独立的后端、Web、小程序、数据库和 Nacos namespace:
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# 项目变更记录
|
||||
|
||||
## 2026-10-10 Salon 小程序 OpenID 快捷登录改造
|
||||
|
||||
- Salon 小程序登录页收敛为微信快捷登录,支持启动状态探测、本机记住登录、多门店选择、审核状态与驳回重提。
|
||||
- 新 OpenID 先创建唯一的待审核用户与微信绑定,角色/门店申请通过一次性注册票据补全同一用户;审核通过前不签发业务 Token。
|
||||
- 手机号改为登录后的可选绑定资料,新增账号设置、微信一键绑定、短信绑定及规划页当天可关闭提醒。
|
||||
- 使用微信 `chooseAvatar` 与 `nickname` 合规组件引导补充资料,个人中心移除修改密码入口。
|
||||
- 按本次明确约束仅更新 Salon 空库初始化 SQL,账号和密码允许为空、手机号增加唯一约束;未生成迁移脚本,未操作实际数据库,未修改 ArtList。
|
||||
- 新增 `docs/scripts/Salon小程序OpenID快捷登录说明_20261010.md`,记录接口、启动行为、部署检查及初始化 SQL 例外原因。
|
||||
- Salon Gateway、Core 及三套 Salon Nacos 配置源将微信匿名白名单收紧到明确登录路径,确保登录后的微信手机号绑定接口必须认证;未发布任何 Nacos 配置。
|
||||
|
||||
## 2026-09-04 SIT Salon 部署前置配置确认
|
||||
|
||||
- 已确认 SIT `jayucloud_salon` 数据库完成初始化,SIT 发布继续跳过数据库执行。
|
||||
@@ -64,3 +74,13 @@
|
||||
- 设计师 Web 与小程序移除管理端路由、页面、API、后台会话和管理入口;店务 Web 收敛为管理端路由。
|
||||
- 将双端职责裁剪结果合并到 `docs/scripts/sql/init/jayucloud-salon.sql` 与 `docs/scripts/sql/init/jayucloud-artlist.sql`。
|
||||
- GitNexus impact/detect_changes 受本地 LadybugDB WAL 崩溃影响未能返回结果,已通过四后端打包和前端构建/测试进行替代验证。
|
||||
# 2026-10-10 后端配置统一由 Nacos 明文管理
|
||||
|
||||
- Salon 与 ArtList 四个后端模块的 Nacos 启动引导参数改为 `bootstrap.yaml` 明文配置,不再接受环境变量覆盖。
|
||||
- 移除 ArtList Core、ArtList Gateway 和 Salon Gateway 的本地业务配置兜底,运行参数与 Gateway 路由统一以 Nacos 配置源为准。
|
||||
- dev、SIT、prod 六套 Nacos 配置源中的后端环境变量占位符全部展开为明文,并保留各环境连接地址和资源名称差异。
|
||||
- SIT/prod 缺失凭据按任务确认复制 dev 值;Salon 三套环境写入微信小程序 AppID,AppSecret 因未提供真实值而明确留空。
|
||||
- 新增 `docs/scripts/后端配置统一由Nacos明文管理_20261010.md`,记录明文风险、启动引导例外、发布步骤和验证方式。
|
||||
- 本次未修改前端或小程序,未连接或发布实际 Nacos。
|
||||
- 验证完成 37 个 YAML 文件解析、Salon Core 测试及两个 Gateway 编译;ArtList Core 因既有历史包名导入错误无法编译,已在配置说明中记录。
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ mybatis:
|
||||
|
||||
fingertip-designer:
|
||||
brand:
|
||||
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Artlist}
|
||||
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
|
||||
message-template-name: JayuCloud-Artlist
|
||||
manager-register-shop-description: 甲屿店务注册店铺
|
||||
security:
|
||||
jwt:
|
||||
issuer: jayucloud-artlist
|
||||
@@ -110,29 +110,29 @@ object-storage:
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY:}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY:}
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
|
||||
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}
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
bucket-name: jayucloud-dev
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
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-dev}
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: http://192.168.5.15:9000
|
||||
bucket-name: jayucloud-dev
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
private-bucket: true
|
||||
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-dev}
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-dev
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
spring:
|
||||
redis:
|
||||
host: ${REDIS_HOST:192.168.5.15}
|
||||
port: ${REDIS_PORT:6379}
|
||||
username: ${REDIS_USERNAME:xiaowang}
|
||||
password: ${REDIS_PASSWORD}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
host: 192.168.5.15
|
||||
port: 6379
|
||||
username: xiaowang
|
||||
password: 122503wcy
|
||||
database: 0
|
||||
rabbitmq:
|
||||
addresses: ${RABBITMQ_ADDRESSES:192.168.5.15:5672}
|
||||
virtual-host: ${RABBITMQ_VHOST}
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
addresses: 192.168.5.15:5672
|
||||
virtual-host: /jayucloud-artlist-dev
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
publisher-confirm-type: correlated
|
||||
publisher-returns: true
|
||||
listener:
|
||||
@@ -19,38 +19,38 @@ spring:
|
||||
|
||||
database:
|
||||
business:
|
||||
jdbc-url: ${BUSINESS_JDBC_URL}
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
jdbc-url: jdbc:mysql://192.168.5.15:3306/jayucloud_artlist?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
object-storage:
|
||||
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
|
||||
primary-provider: MINIO
|
||||
provider-order:
|
||||
- MINIO
|
||||
- QINIU_KODO
|
||||
- ALIYUN_OSS
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:true}
|
||||
endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000}
|
||||
bucket-name: ${MINIO_BUCKET_NAME:jayucloud-dev}
|
||||
access-key: ${MINIO_ACCESS_KEY}
|
||||
secret-key: ${MINIO_SECRET_KEY}
|
||||
enabled: true
|
||||
endpoint: http://192.168.5.15:9000
|
||||
bucket-name: jayucloud-dev
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY}
|
||||
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
|
||||
zone: ${QINIU_KODO_ZONE:z2}
|
||||
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
|
||||
bucket-name: jayucloud-dev
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
|
||||
aliyun:
|
||||
oss:
|
||||
enabled: ${ALIYUN_OSS_ENABLED:true}
|
||||
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
|
||||
region: ${ALIYUN_OSS_REGION:cn-chengdu}
|
||||
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-dev}
|
||||
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID}
|
||||
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET}
|
||||
enabled: true
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-dev
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
security:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
username: jayucloud
|
||||
password: 122503wcy....
|
||||
database:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
redis:
|
||||
password: ${REDIS_PASSWORD}
|
||||
password: 122503wcy
|
||||
rabbitmq:
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
@@ -27,9 +27,13 @@ mybatis:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
fingertip-designer:
|
||||
wechat:
|
||||
mini:
|
||||
app-id: wxb6d77f7c07020d51
|
||||
app-secret: "e277fa749a779547dab6086f56c2e833"
|
||||
brand:
|
||||
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Salon}
|
||||
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
|
||||
message-template-name: JayuCloud-Salon
|
||||
manager-register-shop-description: 甲屿店务注册店铺
|
||||
security:
|
||||
jwt:
|
||||
issuer: jayucloud-salon
|
||||
@@ -111,29 +115,29 @@ object-storage:
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY:U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY:WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD}
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
|
||||
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}
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
bucket-name: jayucloud-dev
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
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-dev}
|
||||
access-key: ${MINIO_ACCESS_KEY:minio_xiaowang}
|
||||
secret-key: ${MINIO_SECRET_KEY:122503wcy}
|
||||
private-bucket: ${MINIO_PRIVATE_BUCKET:true}
|
||||
signed-url-expire-minutes: ${MINIO_SIGNED_URL_EXPIRE_MINUTES:60}
|
||||
enabled: false
|
||||
endpoint: http://192.168.5.15:9000
|
||||
bucket-name: jayucloud-dev
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
private-bucket: true
|
||||
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-dev}
|
||||
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID:LTAI5t9divmxMWHiKhLSRdDd}
|
||||
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET:U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q}
|
||||
signed-url-expire-minutes: ${ALIYUN_OSS_SIGNED_URL_EXPIRE_MINUTES:60}
|
||||
enabled: false
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-dev
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
@@ -139,7 +139,11 @@ fingertip-designer:
|
||||
- /api/user/refresh-token
|
||||
- /api/user/send-verification-code
|
||||
- /api/user/phone-login
|
||||
- /api/user/wechat-mini/**
|
||||
- /api/user/wechat-mini/auto-login
|
||||
- /api/user/wechat-mini/phone-login
|
||||
- /api/user/wechat-mini/confirm-login
|
||||
- /api/user/wechat-mini/status
|
||||
- /api/user/wechat-mini/quick-login
|
||||
- /api/user/workbench/register/**
|
||||
- /api/user/workbench/shops/available
|
||||
- /api/user/reset-password-by-phone
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
spring:
|
||||
redis:
|
||||
host: ${REDIS_HOST:192.168.5.15}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PASSWORD:122503wcy}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
host: 192.168.5.15
|
||||
port: 6379
|
||||
password: 122503wcy
|
||||
database: 0
|
||||
rabbitmq:
|
||||
addresses: ${RABBITMQ_ADDRESSES:192.168.5.15:5672}
|
||||
virtual-host: ${RABBITMQ_VHOST:/jayucloud-salon-dev}
|
||||
username: ${RABBITMQ_USERNAME:rabbitmq}
|
||||
password: ${RABBITMQ_PASSWORD:122503wcy....}
|
||||
addresses: 192.168.5.15:5672
|
||||
virtual-host: /jayucloud-salon-dev
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
publisher-confirm-type: correlated
|
||||
publisher-returns: true
|
||||
listener:
|
||||
@@ -18,38 +18,38 @@ spring:
|
||||
|
||||
database:
|
||||
business:
|
||||
jdbc-url: ${BUSINESS_JDBC_URL:jdbc:mysql://192.168.5.15:3306/jayucloud_salon?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai}
|
||||
username: ${BUSINESS_DB_USERNAME:root}
|
||||
password: ${BUSINESS_DB_PASSWORD:122503wcy}
|
||||
jdbc-url: jdbc:mysql://192.168.5.15:3306/jayucloud_salon?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
object-storage:
|
||||
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
|
||||
primary-provider: MINIO
|
||||
provider-order:
|
||||
- MINIO
|
||||
- QINIU_KODO
|
||||
- ALIYUN_OSS
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:true}
|
||||
endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000}
|
||||
bucket-name: ${MINIO_BUCKET_NAME:jayucloud-dev}
|
||||
access-key: ${MINIO_ACCESS_KEY:minio_xiaowang}
|
||||
secret-key: ${MINIO_SECRET_KEY:122503wcy}
|
||||
enabled: true
|
||||
endpoint: http://192.168.5.15:9000
|
||||
bucket-name: jayucloud-dev
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY:U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY:WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD}
|
||||
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
|
||||
zone: ${QINIU_KODO_ZONE:z2}
|
||||
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
|
||||
bucket-name: jayucloud-dev
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
|
||||
aliyun:
|
||||
oss:
|
||||
enabled: ${ALIYUN_OSS_ENABLED:true}
|
||||
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
|
||||
region: ${ALIYUN_OSS_REGION:cn-chengdu}
|
||||
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-dev}
|
||||
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID:LTAI5t9divmxMWHiKhLSRdDd}
|
||||
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET:U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q}
|
||||
enabled: true
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-dev
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
security:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME:jayucloud}
|
||||
password: ${NACOS_PASSWORD:122503wcy....}
|
||||
username: jayucloud
|
||||
password: 122503wcy....
|
||||
database:
|
||||
username: ${BUSINESS_DB_USERNAME:root}
|
||||
password: ${BUSINESS_DB_PASSWORD:122503wcy}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
redis:
|
||||
password: ${REDIS_PASSWORD:122503wcy}
|
||||
password: 122503wcy
|
||||
rabbitmq:
|
||||
username: ${RABBITMQ_USERNAME:rabbitmq}
|
||||
password: ${RABBITMQ_PASSWORD:122503wcy....}
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
username: ${BUSINESS_DB_USERNAME:root}
|
||||
password: ${BUSINESS_DB_PASSWORD:122503wcy}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
@@ -27,8 +27,8 @@ mybatis:
|
||||
|
||||
fingertip-designer:
|
||||
brand:
|
||||
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Artlist}
|
||||
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
|
||||
message-template-name: JayuCloud-Artlist
|
||||
manager-register-shop-description: 甲屿店务注册店铺
|
||||
security:
|
||||
jwt:
|
||||
issuer: jayucloud-artlist
|
||||
@@ -110,29 +110,29 @@ object-storage:
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY:}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY:}
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud}
|
||||
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}
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
bucket-name: jayucloud
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:false}
|
||||
endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000}
|
||||
bucket-name: ${MINIO_BUCKET_NAME:jayucloud}
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: http://192.168.10.105:9000
|
||||
bucket-name: jayucloud
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
private-bucket: true
|
||||
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}
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
spring:
|
||||
redis:
|
||||
sentinel:
|
||||
master: ${REDIS_SENTINEL_MASTER:mymaster}
|
||||
nodes: ${REDIS_SENTINEL_NODES:192.168.10.17:26379,192.168.10.18:26379,192.168.10.19:26379,192.168.20.13:26379,10.66.0.4:26379}
|
||||
username: ${REDIS_USERNAME:xiaowang}
|
||||
password: ${REDIS_PASSWORD}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
master: mymaster
|
||||
nodes: 192.168.10.17:26379,192.168.10.18:26379,192.168.10.19:26379,192.168.20.13:26379,10.66.0.4:26379
|
||||
username: xiaowang
|
||||
password: 122503wcy
|
||||
database: 0
|
||||
rabbitmq:
|
||||
addresses: ${RABBITMQ_ADDRESSES:mq-prod.internal:5672}
|
||||
virtual-host: ${RABBITMQ_VHOST}
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
addresses: mq-prod.internal:5672
|
||||
virtual-host: Jayucloud-ArtList
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
publisher-confirm-type: correlated
|
||||
publisher-returns: true
|
||||
listener:
|
||||
@@ -20,38 +20,38 @@ spring:
|
||||
|
||||
database:
|
||||
business:
|
||||
jdbc-url: ${BUSINESS_JDBC_URL}
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
jdbc-url: jdbc:mysql://192.168.10.200:6033/jayucloud_artlist?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
object-storage:
|
||||
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
|
||||
primary-provider: MINIO
|
||||
provider-order:
|
||||
- MINIO
|
||||
- QINIU_KODO
|
||||
- ALIYUN_OSS
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:true}
|
||||
endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000}
|
||||
bucket-name: ${MINIO_BUCKET_NAME:jayucloud}
|
||||
access-key: ${MINIO_ACCESS_KEY}
|
||||
secret-key: ${MINIO_SECRET_KEY}
|
||||
enabled: true
|
||||
endpoint: http://192.168.10.105:9000
|
||||
bucket-name: jayucloud
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud}
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY}
|
||||
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
|
||||
zone: ${QINIU_KODO_ZONE:z2}
|
||||
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
|
||||
bucket-name: jayucloud
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
|
||||
aliyun:
|
||||
oss:
|
||||
enabled: ${ALIYUN_OSS_ENABLED:true}
|
||||
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
|
||||
region: ${ALIYUN_OSS_REGION:cn-chengdu}
|
||||
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud}
|
||||
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID}
|
||||
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET}
|
||||
enabled: true
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
security:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
username: jayucloud
|
||||
password: 122503wcy....
|
||||
database:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
redis:
|
||||
password: ${REDIS_PASSWORD}
|
||||
password: 122503wcy
|
||||
rabbitmq:
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
@@ -26,9 +26,13 @@ mybatis:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
fingertip-designer:
|
||||
wechat:
|
||||
mini:
|
||||
app-id: wxb6d77f7c07020d51
|
||||
app-secret: ""
|
||||
brand:
|
||||
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Salon}
|
||||
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
|
||||
message-template-name: JayuCloud-Salon
|
||||
manager-register-shop-description: 甲屿店务注册店铺
|
||||
security:
|
||||
jwt:
|
||||
issuer: jayucloud-salon
|
||||
@@ -110,29 +114,29 @@ object-storage:
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY:}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY:}
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud}
|
||||
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}
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
bucket-name: jayucloud
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:false}
|
||||
endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000}
|
||||
bucket-name: ${MINIO_BUCKET_NAME:jayucloud}
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: http://192.168.10.105:9000
|
||||
bucket-name: jayucloud
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
private-bucket: true
|
||||
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}
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
@@ -136,7 +136,11 @@ fingertip-designer:
|
||||
- /api/user/refresh-token
|
||||
- /api/user/send-verification-code
|
||||
- /api/user/phone-login
|
||||
- /api/user/wechat-mini/**
|
||||
- /api/user/wechat-mini/auto-login
|
||||
- /api/user/wechat-mini/phone-login
|
||||
- /api/user/wechat-mini/confirm-login
|
||||
- /api/user/wechat-mini/status
|
||||
- /api/user/wechat-mini/quick-login
|
||||
- /api/user/workbench/register/**
|
||||
- /api/user/workbench/shops/available
|
||||
- /api/user/reset-password-by-phone
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
spring:
|
||||
redis:
|
||||
sentinel:
|
||||
master: ${REDIS_SENTINEL_MASTER:mymaster}
|
||||
nodes: ${REDIS_SENTINEL_NODES:192.168.10.17:26379,192.168.10.18:26379,192.168.10.19:26379,192.168.20.13:26379,10.66.0.4:26379}
|
||||
username: ${REDIS_USERNAME:xiaowang}
|
||||
password: ${REDIS_PASSWORD}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
master: mymaster
|
||||
nodes: 192.168.10.17:26379,192.168.10.18:26379,192.168.10.19:26379,192.168.20.13:26379,10.66.0.4:26379
|
||||
username: xiaowang
|
||||
password: 122503wcy
|
||||
database: 0
|
||||
rabbitmq:
|
||||
addresses: ${RABBITMQ_ADDRESSES:mq-prod.internal:5672}
|
||||
virtual-host: ${RABBITMQ_VHOST}
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
addresses: mq-prod.internal:5672
|
||||
virtual-host: Jayucloud-Salon
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
publisher-confirm-type: correlated
|
||||
publisher-returns: true
|
||||
listener:
|
||||
@@ -20,38 +20,38 @@ spring:
|
||||
|
||||
database:
|
||||
business:
|
||||
jdbc-url: ${BUSINESS_JDBC_URL}
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
jdbc-url: jdbc:mysql://192.168.10.200:6033/jayucloud_salon?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
object-storage:
|
||||
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
|
||||
primary-provider: MINIO
|
||||
provider-order:
|
||||
- MINIO
|
||||
- QINIU_KODO
|
||||
- ALIYUN_OSS
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:true}
|
||||
endpoint: ${MINIO_ENDPOINT:http://192.168.10.105:9000}
|
||||
bucket-name: ${MINIO_BUCKET_NAME:jayucloud}
|
||||
access-key: ${MINIO_ACCESS_KEY}
|
||||
secret-key: ${MINIO_SECRET_KEY}
|
||||
enabled: true
|
||||
endpoint: http://192.168.10.105:9000
|
||||
bucket-name: jayucloud
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud}
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY}
|
||||
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
|
||||
zone: ${QINIU_KODO_ZONE:z2}
|
||||
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
|
||||
bucket-name: jayucloud
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
|
||||
aliyun:
|
||||
oss:
|
||||
enabled: ${ALIYUN_OSS_ENABLED:true}
|
||||
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
|
||||
region: ${ALIYUN_OSS_REGION:cn-chengdu}
|
||||
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud}
|
||||
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID}
|
||||
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET}
|
||||
enabled: true
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
security:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
username: jayucloud
|
||||
password: 122503wcy....
|
||||
database:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
redis:
|
||||
password: ${REDIS_PASSWORD}
|
||||
password: 122503wcy
|
||||
rabbitmq:
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
@@ -27,8 +27,8 @@ mybatis:
|
||||
|
||||
fingertip-designer:
|
||||
brand:
|
||||
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Artlist}
|
||||
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
|
||||
message-template-name: JayuCloud-Artlist
|
||||
manager-register-shop-description: 甲屿店务注册店铺
|
||||
security:
|
||||
jwt:
|
||||
issuer: jayucloud-artlist
|
||||
@@ -110,29 +110,29 @@ object-storage:
|
||||
|
||||
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}
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
bucket-name: jayucloud-sit
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: http://192.168.5.15:9000
|
||||
bucket-name: jayucloud-sit
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
private-bucket: true
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-sit
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
spring:
|
||||
redis:
|
||||
host: ${REDIS_HOST:192.168.10.12}
|
||||
port: ${REDIS_PORT:6379}
|
||||
username: ${REDIS_USERNAME:xiaowang}
|
||||
password: ${REDIS_PASSWORD}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
host: 192.168.10.12
|
||||
port: 6379
|
||||
username: xiaowang
|
||||
password: 122503wcy
|
||||
database: 0
|
||||
rabbitmq:
|
||||
addresses: ${RABBITMQ_ADDRESSES:192.168.10.13:5672}
|
||||
virtual-host: ${RABBITMQ_VHOST}
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
addresses: 192.168.10.13:5672
|
||||
virtual-host: /jayucloud-artlist-sit
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
publisher-confirm-type: correlated
|
||||
publisher-returns: true
|
||||
listener:
|
||||
@@ -19,38 +19,38 @@ spring:
|
||||
|
||||
database:
|
||||
business:
|
||||
jdbc-url: ${BUSINESS_JDBC_URL}
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
jdbc-url: jdbc:mysql://192.168.10.102:3306/jayucloud_artlist?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
object-storage:
|
||||
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
|
||||
primary-provider: MINIO
|
||||
provider-order:
|
||||
- MINIO
|
||||
- QINIU_KODO
|
||||
- ALIYUN_OSS
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:true}
|
||||
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}
|
||||
enabled: true
|
||||
endpoint: http://192.168.10.14:9000
|
||||
bucket-name: jayucloud-sit
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-sit}
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY}
|
||||
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
|
||||
zone: ${QINIU_KODO_ZONE:z2}
|
||||
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
|
||||
bucket-name: jayucloud-sit
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
|
||||
aliyun:
|
||||
oss:
|
||||
enabled: ${ALIYUN_OSS_ENABLED:true}
|
||||
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}
|
||||
enabled: true
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-sit
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
security:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
username: jayucloud
|
||||
password: 122503wcy....
|
||||
database:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
redis:
|
||||
password: ${REDIS_PASSWORD}
|
||||
password: 122503wcy
|
||||
rabbitmq:
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
@@ -26,9 +26,13 @@ mybatis:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
fingertip-designer:
|
||||
wechat:
|
||||
mini:
|
||||
app-id: wxb6d77f7c07020d51
|
||||
app-secret: ""
|
||||
brand:
|
||||
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Salon}
|
||||
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
|
||||
message-template-name: JayuCloud-Salon
|
||||
manager-register-shop-description: 甲屿店务注册店铺
|
||||
security:
|
||||
jwt:
|
||||
issuer: jayucloud-salon
|
||||
@@ -92,11 +96,11 @@ fingertip-designer:
|
||||
|
||||
messagehub:
|
||||
client:
|
||||
base-url: ${MESSAGEHUB_BASE_URL:http://192.168.10.16:8080}
|
||||
access-token: ${MESSAGEHUB_ACCESS_TOKEN:}
|
||||
ingress-exchange: ${MESSAGEHUB_INGRESS_EXCHANGE:messagehub.ingress.exchange}
|
||||
ingress-routing-key: ${MESSAGEHUB_INGRESS_ROUTING_KEY:message.send}
|
||||
source-system: ${MESSAGEHUB_SOURCE_SYSTEM:jayucloud-salon}
|
||||
base-url: http://192.168.10.16:8080
|
||||
access-token: ""
|
||||
ingress-exchange: messagehub.ingress.exchange
|
||||
ingress-routing-key: message.send
|
||||
source-system: jayucloud-salon
|
||||
|
||||
object-storage:
|
||||
provider-order:
|
||||
@@ -118,29 +122,29 @@ object-storage:
|
||||
|
||||
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}
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
bucket-name: jayucloud-sit
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: http://192.168.5.15:9000
|
||||
bucket-name: jayucloud-sit
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
private-bucket: true
|
||||
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}
|
||||
enabled: false
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-sit
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
signed-url-expire-minutes: 60
|
||||
|
||||
@@ -136,7 +136,11 @@ fingertip-designer:
|
||||
- /api/user/refresh-token
|
||||
- /api/user/send-verification-code
|
||||
- /api/user/phone-login
|
||||
- /api/user/wechat-mini/**
|
||||
- /api/user/wechat-mini/auto-login
|
||||
- /api/user/wechat-mini/phone-login
|
||||
- /api/user/wechat-mini/confirm-login
|
||||
- /api/user/wechat-mini/status
|
||||
- /api/user/wechat-mini/quick-login
|
||||
- /api/user/workbench/register/**
|
||||
- /api/user/workbench/shops/available
|
||||
- /api/user/reset-password-by-phone
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
spring:
|
||||
redis:
|
||||
host: ${REDIS_HOST:192.168.10.12}
|
||||
port: ${REDIS_PORT:6379}
|
||||
username: ${REDIS_USERNAME:xiaowang}
|
||||
password: ${REDIS_PASSWORD}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
host: 192.168.10.12
|
||||
port: 6379
|
||||
username: xiaowang
|
||||
password: 122503wcy
|
||||
database: 0
|
||||
rabbitmq:
|
||||
addresses: ${RABBITMQ_ADDRESSES:192.168.10.13:5672}
|
||||
virtual-host: ${RABBITMQ_VHOST}
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
addresses: 192.168.10.13:5672
|
||||
virtual-host: /jayucloud-salon-sit
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
publisher-confirm-type: correlated
|
||||
publisher-returns: true
|
||||
listener:
|
||||
@@ -19,38 +19,38 @@ spring:
|
||||
|
||||
database:
|
||||
business:
|
||||
jdbc-url: ${BUSINESS_JDBC_URL}
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
jdbc-url: jdbc:mysql://192.168.10.102:3306/jayucloud_salon?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
object-storage:
|
||||
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
|
||||
primary-provider: MINIO
|
||||
provider-order:
|
||||
- MINIO
|
||||
- QINIU_KODO
|
||||
- ALIYUN_OSS
|
||||
|
||||
minio:
|
||||
enabled: ${MINIO_ENABLED:true}
|
||||
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}
|
||||
enabled: true
|
||||
endpoint: http://192.168.10.14:9000
|
||||
bucket-name: jayucloud-sit
|
||||
access-key: minio_xiaowang
|
||||
secret-key: 122503wcy
|
||||
|
||||
qiniu:
|
||||
kodo:
|
||||
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-sit}
|
||||
access-key: ${QINIU_KODO_ACCESS_KEY}
|
||||
secret-key: ${QINIU_KODO_SECRET_KEY}
|
||||
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
|
||||
zone: ${QINIU_KODO_ZONE:z2}
|
||||
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
|
||||
bucket-name: jayucloud-sit
|
||||
access-key: U_btHNrxj1X0UaHllVO8mq4p-8jB1Php-87vi2M7
|
||||
secret-key: WIO_jEcir_2upUqoIzn5Hu5EWSb4-yB4sWeLFiXD
|
||||
domain: https://img.yunail.art
|
||||
zone: z2
|
||||
private-bucket: true
|
||||
|
||||
aliyun:
|
||||
oss:
|
||||
enabled: ${ALIYUN_OSS_ENABLED:true}
|
||||
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}
|
||||
enabled: true
|
||||
endpoint: https://oss-cn-chengdu.aliyuncs.com
|
||||
region: cn-chengdu
|
||||
bucket-name: jayucloud-sit
|
||||
access-key-id: LTAI5t9divmxMWHiKhLSRdDd
|
||||
access-key-secret: U4BlsNpy7ISLbWYrQUsBMswaRH8G9Q
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
security:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
username: jayucloud
|
||||
password: 122503wcy....
|
||||
database:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
redis:
|
||||
password: ${REDIS_PASSWORD}
|
||||
password: 122503wcy
|
||||
rabbitmq:
|
||||
username: ${RABBITMQ_USERNAME}
|
||||
password: ${RABBITMQ_PASSWORD}
|
||||
username: rabbitmq
|
||||
password: 122503wcy....
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
username: ${BUSINESS_DB_USERNAME}
|
||||
password: ${BUSINESS_DB_PASSWORD}
|
||||
username: root
|
||||
password: 122503wcy
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# 开发店务 Nacos 默认参数说明
|
||||
|
||||
> 历史说明:后端环境变量覆盖入口已于 2026-10-10 移除。当前配置方式见 `docs/scripts/后端配置统一由Nacos明文管理_20261010.md`。
|
||||
|
||||
更新时间:2026-08-26
|
||||
|
||||
适用范围:`nacos/namespaces/dev/jayucloud-salon/DEFAULT_GROUP/`。
|
||||
|
||||
Reference in New Issue
Block a user