fix(auth): 注册验证码页面显示完整手机号
验证码页面不再隐藏手机号中间数字,改为完整显示 格式: 138 1234 5678 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
1d6cbf9335
commit
bc34907a84
|
|
@ -2,7 +2,10 @@ import { Module } from '@nestjs/common';
|
|||
import { PlantingOrderController } from './controllers/planting-order.controller';
|
||||
import { PlantingPositionController } from './controllers/planting-position.controller';
|
||||
import { HealthController } from './controllers/health.controller';
|
||||
import { ContractSigningController } from './controllers/contract-signing.controller';
|
||||
import {
|
||||
ContractSigningController,
|
||||
ContractSigningConfigController,
|
||||
} from './controllers/contract-signing.controller';
|
||||
import { ApplicationModule } from '../application/application.module';
|
||||
import { JwtAuthGuard } from './guards/jwt-auth.guard';
|
||||
|
||||
|
|
@ -13,6 +16,7 @@ import { JwtAuthGuard } from './guards/jwt-auth.guard';
|
|||
PlantingPositionController,
|
||||
HealthController,
|
||||
ContractSigningController,
|
||||
ContractSigningConfigController,
|
||||
],
|
||||
providers: [JwtAuthGuard],
|
||||
})
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
HttpStatus,
|
||||
Logger,
|
||||
} from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { JwtAuthGuard } from '../guards/jwt-auth.guard';
|
||||
import { ContractSigningService } from '../../application/services/contract-signing.service';
|
||||
|
||||
|
|
@ -31,6 +32,34 @@ interface SignContractDto {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同签署配置控制器(公开接口,不需要认证)
|
||||
*/
|
||||
@Controller('planting/contract-signing')
|
||||
export class ContractSigningConfigController {
|
||||
private readonly contractSigningEnabled: boolean;
|
||||
|
||||
constructor(private readonly configService: ConfigService) {
|
||||
// 默认启用合同签署功能
|
||||
this.contractSigningEnabled =
|
||||
this.configService.get<string>('CONTRACT_SIGNING_ENABLED', 'true') === 'true';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同签署配置(公开接口)
|
||||
* 用于前端判断是否需要在认种前检查实名认证
|
||||
*/
|
||||
@Get('config')
|
||||
getConfig() {
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
contractSigningEnabled: this.contractSigningEnabled,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同签署控制器
|
||||
*
|
||||
|
|
|
|||
|
|
@ -131,6 +131,22 @@ class ContractTemplate {
|
|||
}
|
||||
}
|
||||
|
||||
/// 合同签署配置
|
||||
class ContractSigningConfig {
|
||||
/// 合同签署功能是否启用
|
||||
final bool contractSigningEnabled;
|
||||
|
||||
ContractSigningConfig({
|
||||
required this.contractSigningEnabled,
|
||||
});
|
||||
|
||||
factory ContractSigningConfig.fromJson(Map<String, dynamic> json) {
|
||||
return ContractSigningConfig(
|
||||
contractSigningEnabled: json['contractSigningEnabled'] ?? true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 合同签署服务
|
||||
class ContractSigningService {
|
||||
final ApiClient _apiClient;
|
||||
|
|
|
|||
|
|
@ -508,7 +508,8 @@ class _SmsVerifyPageState extends ConsumerState<SmsVerifyPage> {
|
|||
|
||||
String _formatPhoneNumber(String phone) {
|
||||
if (phone.length != 11) return phone;
|
||||
return '${phone.substring(0, 3)} **** ${phone.substring(7)}';
|
||||
// 显示完整手机号,用空格分隔便于阅读
|
||||
return '${phone.substring(0, 3)} ${phone.substring(3, 7)} ${phone.substring(7)}';
|
||||
}
|
||||
|
||||
String _maskPhoneNumber(String phone) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue