lrf 2 년 전
부모
커밋
7f95db850b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/service/user/user.js

+ 1 - 1
app/service/user/user.js

@@ -115,7 +115,7 @@ class UserService extends CrudService {
   async toBindPhone({ id, phone }) {
     const code = _.random(100000, 999999);
     const value = `${phone}${this.conenctCode}${code}`;
-    await this.redis.set(`${this.bindPhoneKey}${id}`, value); // , 'EX', 300
+    await this.redis.set(`${this.bindPhoneKey}${id}`, value, 'EX', 300);
     // 发短信
     const data = { config: this.smsServiceConfig, template: 'bind', phone, params: { code } };
     const url = `${this.smsServiceUrl}/sendMessage`;