Content-Length: 504385 | pFad | http://github.com/leancloud/javascript-sdk/commit/e4241f94613247185f84b5b3ec78ec00bb53006f

E3 Merge pull request #680 from leancloud/feat/require-phone · leancloud/javascript-sdk@e4241f9 · GitHub
Skip to content

Commit e4241f9

Browse files
authored
Merge pull request #680 from leancloud/feat/require-phone
feat: require mobilePhoneNumber
2 parents b88f4ea + a93320e commit e4241f9

File tree

7 files changed

+32
-19
lines changed

7 files changed

+32
-19
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ jobs:
1414
node-version: 16
1515
- run: npm ci
1616
- run: npm test
17+
env:
18+
SERVER_URL: https://qvnm6ag2.api.lncldglobal.com
19+
APPID: QvNM6AG2khJtBQo6WRMWqfLV-gzGzoHsz
20+
APPKEY: be2YmUduiuEnCB2VR9bLRnnV
21+
MASTERKEY: ${{ secrets.MASTER_KEY }}
22+
HOOKKEY: ${{ secrets.HOOK_KEY }}
1723
- uses: codecov/codecov-action@v3
1824
- run: npm run build
1925
- if: github.ref_name == 'master'

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 4.15.3 (2024-07-01)
2+
3+
### Bug Fixes
4+
5+
- `resetPasswordBySmsCode``verifyMobilePhone` 支持传递 mobilePhoneNumber 参数。
6+
17
## 4.15.2 (2023-10-11)
28

39
### Internal Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "leancloud-storage",
3-
"version": "4.15.2",
3+
"version": "4.15.3",
44
"main": "./dist/node/entry/index.js",
55
"description": "LeanCloud JavaScript SDK.",
66
"repository": {

src/user.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,11 +1731,12 @@ module.exports = function(AV) {
17311731
* The sms code is sent by AV.User.requestPasswordResetBySmsCode.
17321732
* @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
17331733
* @param {String} password The new password.
1734+
* @param {String} mobilePhoneNumber
17341735
* @return {Promise} A promise that will be resolved with the result
17351736
* of the function.
17361737
*/
1737-
resetPasswordBySmsCode: function(code, password) {
1738-
var json = { password: password };
1738+
resetPasswordBySmsCode: function(code, password, mobilePhoneNumber) {
1739+
var json = { password: password, mobilePhoneNumber: mobilePhoneNumber };
17391740
var request = AVRequest(
17401741
'resetPasswordBySmsCode',
17411742
null,
@@ -1750,11 +1751,13 @@ module.exports = function(AV) {
17501751
* Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
17511752
* If verify successfully,the user mobilePhoneVerified attribute will be true.
17521753
* @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
1754+
* @param {String} mobilePhoneNumber
17531755
* @return {Promise} A promise that will be resolved with the result
17541756
* of the function.
17551757
*/
1756-
verifyMobilePhone: function(code) {
1757-
var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
1758+
verifyMobilePhone: function(code, mobilePhoneNumber) {
1759+
var json = { mobilePhoneNumber: mobilePhoneNumber };
1760+
var request = AVRequest('verifyMobilePhone', null, code, 'POST', json);
17581761
return request;
17591762
},
17601763

src/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = '4.15.2';
1+
module.exports = '4.15.3';

storage.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,9 +800,14 @@ export class User extends Object {
800800
static resetPasswordBySmsCode(
801801
code: string,
802802
password: string,
803+
mobilePhoneNumber: string,
804+
options?: AuthOptions
805+
): Promise<User>;
806+
static verifyMobilePhone(
807+
code: string,
808+
mobilePhoneNumber: string,
803809
options?: AuthOptions
804810
): Promise<User>;
805-
static verifyMobilePhone(code: string, options?: AuthOptions): Promise<User>;
806811
static requestChangePhoneNumber(
807812
mobilePhoneNumber: string,
808813
ttl?: number,

test/test.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,11 @@ if (typeof require !== 'undefined') {
66
global.AV = require('../src/entry');
77
}
88

9-
// AV.init({
10-
// appId: 'Vpe1RqHgS5VGWBlhB6pdiiow-null',
11-
// appKey: 'OxKVgM0izOIckMi9WiT0pBSf',
12-
// masterKey: 'RCLNNJ6l51YJXzv7YG4fHA5v',
13-
// serverURLs: 'https://cn-stg1.leancloud.cn',
14-
// });
15-
169
AV.init({
17-
appId: process.env.APPID || '95TNUaOSUd8IpKNW0RSqSEOm-9Nh9j0Va',
18-
appKey: process.env.APPKEY || 'gNAE1iHowdQvV7cqpfCMGaGN',
19-
masterKey: process.env.MASTERKEY || 'ue9M9nqwD4MQNXD3oiN5rAOv',
20-
hookKey: process.env.HOOKKEY || '2iCbUZDgEF0siKxmCn2kVQXV',
21-
serverURLs: process.env.SERVER_URL || 'https://95tnuaos.lc-cn-e1-shared.com',
10+
appId: process.env.APPID,
11+
appKey: process.env.APPKEY,
12+
masterKey: process.env.MASTERKEY,
13+
hookKey: process.env.HOOKKEY,
14+
serverURLs: process.env.SERVER_URL,
2215
});
2316
AV.setProduction(true);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/leancloud/javascript-sdk/commit/e4241f94613247185f84b5b3ec78ec00bb53006f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy