diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64a29fae..92128ae1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,12 @@ jobs: node-version: 16 - run: npm ci - run: npm test + env: + SERVER_URL: https://qvnm6ag2.api.lncldglobal.com + APPID: QvNM6AG2khJtBQo6WRMWqfLV-gzGzoHsz + APPKEY: be2YmUduiuEnCB2VR9bLRnnV + MASTERKEY: ${{ secrets.MASTER_KEY }} + HOOKKEY: ${{ secrets.HOOK_KEY }} - uses: codecov/codecov-action@v3 - run: npm run build - if: github.ref_name == 'master' diff --git a/changelog.md b/changelog.md index 9342fbc4..7aff8c67 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +## 4.15.3 (2024-07-01) + +### Bug Fixes + +- `resetPasswordBySmsCode` 和 `verifyMobilePhone` 支持传递 mobilePhoneNumber 参数。 + ## 4.15.2 (2023-10-11) ### Internal Changes diff --git a/package.json b/package.json index 200c91f7..cb93c89b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leancloud-storage", - "version": "4.15.2", + "version": "4.15.3", "main": "./dist/node/entry/index.js", "description": "LeanCloud JavaScript SDK.", "repository": { diff --git a/src/user.js b/src/user.js index 2e2d298c..4a78315d 100644 --- a/src/user.js +++ b/src/user.js @@ -1731,11 +1731,12 @@ module.exports = function(AV) { * The sms code is sent by AV.User.requestPasswordResetBySmsCode. * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode * @param {String} password The new password. + * @param {String} mobilePhoneNumber * @return {Promise} A promise that will be resolved with the result * of the function. */ - resetPasswordBySmsCode: function(code, password) { - var json = { password: password }; + resetPasswordBySmsCode: function(code, password, mobilePhoneNumber) { + var json = { password: password, mobilePhoneNumber: mobilePhoneNumber }; var request = AVRequest( 'resetPasswordBySmsCode', null, @@ -1750,11 +1751,13 @@ module.exports = function(AV) { * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode * If verify successfully,the user mobilePhoneVerified attribute will be true. * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode + * @param {String} mobilePhoneNumber * @return {Promise} A promise that will be resolved with the result * of the function. */ - verifyMobilePhone: function(code) { - var request = AVRequest('verifyMobilePhone', null, code, 'POST', null); + verifyMobilePhone: function(code, mobilePhoneNumber) { + var json = { mobilePhoneNumber: mobilePhoneNumber }; + var request = AVRequest('verifyMobilePhone', null, code, 'POST', json); return request; }, diff --git a/src/version.js b/src/version.js index 3a9761f4..03fa5442 100644 --- a/src/version.js +++ b/src/version.js @@ -1 +1 @@ -module.exports = '4.15.2'; +module.exports = '4.15.3'; diff --git a/storage.d.ts b/storage.d.ts index 6e0e92b3..a7191fa3 100644 --- a/storage.d.ts +++ b/storage.d.ts @@ -800,9 +800,14 @@ export class User extends Object { static resetPasswordBySmsCode( code: string, password: string, + mobilePhoneNumber: string, + options?: AuthOptions + ): Promise; + static verifyMobilePhone( + code: string, + mobilePhoneNumber: string, options?: AuthOptions ): Promise; - static verifyMobilePhone(code: string, options?: AuthOptions): Promise; static requestChangePhoneNumber( mobilePhoneNumber: string, ttl?: number, diff --git a/test/test.js b/test/test.js index 07ebccff..8380baf2 100644 --- a/test/test.js +++ b/test/test.js @@ -6,18 +6,11 @@ if (typeof require !== 'undefined') { global.AV = require('../src/entry'); } -// AV.init({ -// appId: 'Vpe1RqHgS5VGWBlhB6pdiiow-null', -// appKey: 'OxKVgM0izOIckMi9WiT0pBSf', -// masterKey: 'RCLNNJ6l51YJXzv7YG4fHA5v', -// serverURLs: 'https://cn-stg1.leancloud.cn', -// }); - AV.init({ - appId: process.env.APPID || '95TNUaOSUd8IpKNW0RSqSEOm-9Nh9j0Va', - appKey: process.env.APPKEY || 'gNAE1iHowdQvV7cqpfCMGaGN', - masterKey: process.env.MASTERKEY || 'ue9M9nqwD4MQNXD3oiN5rAOv', - hookKey: process.env.HOOKKEY || '2iCbUZDgEF0siKxmCn2kVQXV', - serverURLs: process.env.SERVER_URL || 'https://95tnuaos.lc-cn-e1-shared.com', + appId: process.env.APPID, + appKey: process.env.APPKEY, + masterKey: process.env.MASTERKEY, + hookKey: process.env.HOOKKEY, + serverURLs: process.env.SERVER_URL, }); AV.setProduction(true);