@@ -42,7 +42,7 @@ export class UserPhoneService {
4242
4343 if ( await UserPhoneService . canSend ( safePhone ) ) {
4444 const exist = await userPhoneDAO . findOne ( this . DBTransaction , [ "user_uuid" ] , {
45- phone_number : safePhone ,
45+ phone_number : phone ,
4646 } ) ;
4747 if ( exist ) {
4848 throw new FError ( ErrorCode . SMSAlreadyExist ) ;
@@ -66,7 +66,7 @@ export class UserPhoneService {
6666
6767 if ( await UserPhoneService . canSend ( safePhone ) ) {
6868 const user = await userPhoneDAO . findOne ( this . DBTransaction , [ "user_uuid" ] , {
69- phone_number : safePhone ,
69+ phone_number : phone ,
7070 } ) ;
7171 if ( ! user ) {
7272 throw new FError ( ErrorCode . UserNotFound ) ;
@@ -97,7 +97,7 @@ export class UserPhoneService {
9797 await UserPhoneService . assertCodeCorrect ( safePhone , code ) ;
9898 await UserPhoneService . clearTryRegisterCount ( safePhone ) ;
9999
100- const userUUIDByPhone = await this . userUUIDByPhone ( safePhone ) ;
100+ const userUUIDByPhone = await this . userUUIDByPhone ( phone ) ;
101101 if ( userUUIDByPhone ) {
102102 this . logger . info ( "register phone already exist" , { userPhone : { phone } } ) ;
103103 throw new FError ( ErrorCode . SMSAlreadyExist ) ;
@@ -116,7 +116,7 @@ export class UserPhoneService {
116116 const createUserPhone = userPhoneDAO . insert ( this . DBTransaction , {
117117 user_name : userName ,
118118 user_uuid : userUUID ,
119- phone_number : safePhone ,
119+ phone_number : phone ,
120120 } ) ;
121121
122122 const setupGuidePPTX = this . setGuidePPTX ( userUUID ) ;
@@ -145,7 +145,7 @@ export class UserPhoneService {
145145 await UserPhoneService . assertCodeCorrect ( safePhone , code ) ;
146146 await UserPhoneService . clearTryRegisterCount ( safePhone ) ;
147147
148- const userUUIDByPhone = await this . userUUIDByPhone ( safePhone ) ;
148+ const userUUIDByPhone = await this . userUUIDByPhone ( phone ) ;
149149 if ( ! userUUIDByPhone ) {
150150 throw new FError ( ErrorCode . UserNotFound ) ;
151151 }
@@ -166,9 +166,7 @@ export class UserPhoneService {
166166 ) : Promise < PhoneLoginReturn > {
167167 password = hash ( password ) ;
168168
169- const safePhone = SMSUtils . safePhone ( phone ) ;
170-
171- const userUUIDByPhone = await this . userUUIDByPhone ( safePhone ) ;
169+ const userUUIDByPhone = await this . userUUIDByPhone ( phone ) ;
172170 if ( ! userUUIDByPhone ) {
173171 throw new FError ( ErrorCode . UserNotFound ) ;
174172 }
@@ -271,9 +269,9 @@ export class UserPhoneService {
271269 ] ) ;
272270 }
273271
274- private async userUUIDByPhone ( safePhone : string ) : Promise < string | null > {
272+ private async userUUIDByPhone ( phone : string ) : Promise < string | null > {
275273 const result = await userPhoneDAO . findOne ( this . DBTransaction , [ "user_uuid" ] , {
276- phone_number : safePhone ,
274+ phone_number : phone ,
277275 } ) ;
278276
279277 return result ? result . user_uuid : null ;
0 commit comments