Skip to content
本页目录

dx-func-user

公共用户模块的云函数

注意事项

云函数无法直接运行,需搭配以下依赖:

安装

从插件市场的右上角,点击 使用HBuilderX导入插件

dx-func-user

如图:在项目里右键单击云函数

dx-func-user

如下图:需要依赖以下公共模块

dx-func-user

uni-id 配置示例

json
{
 "passwordSecret": [{
  "type": "hmac-sha256",
  "version": 1
 }],
 "tokenSecret": "tokenSecret-demo",
 "tokenExpiresIn": 7200,
 "tokenExpiresThreshold": 600,
 "passwordErrorLimit": 6,
 "bindTokenToDevice": false,
 "passwordErrorRetryTime": 3600,
 "autoSetInviteCode": false,
 "forceInviteCode": false,
 "app-plus": {
  "tokenExpiresIn": 2592000,
  "oauth": {
   "weixin": {
    "appid": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appid",
    "appsecret": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appsecret"
   },
   "apple": {
    "bundleId": "苹果开发者后台获取的bundleId"
   }
  }
 },
 "mp-weixin": {
  "oauth": {
   "weixin": {
    "appid": "微信小程序登录所用的appid、appsecret需要在对应的小程序管理控制台获取",
    "appsecret": "微信小程序后台获取的appsecret"
   }
  }
 },
 "mp-alipay": {
  "oauth": {
   "alipay": {
    "appid": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr",
    "privateKey": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr"
   }
  }
 },
 "service": {
  "sms": {
   "name": "用户登录",
   "codeExpiresIn": 600,
   "smsKey": "",
   "smsSecret": "",
   "templateId": ""
  },
  "univerify": {
   "appid": "",
   "apiKey": "",
   "apiSecret": ""
  }
 }
}

{
 "passwordSecret": [{
  "type": "hmac-sha256",
  "version": 1
 }],
 "tokenSecret": "tokenSecret-demo",
 "tokenExpiresIn": 7200,
 "tokenExpiresThreshold": 600,
 "passwordErrorLimit": 6,
 "bindTokenToDevice": false,
 "passwordErrorRetryTime": 3600,
 "autoSetInviteCode": false,
 "forceInviteCode": false,
 "app-plus": {
  "tokenExpiresIn": 2592000,
  "oauth": {
   "weixin": {
    "appid": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appid",
    "appsecret": "填写来源微信开放平台https://open.weixin.qq.com/创建的应用的appsecret"
   },
   "apple": {
    "bundleId": "苹果开发者后台获取的bundleId"
   }
  }
 },
 "mp-weixin": {
  "oauth": {
   "weixin": {
    "appid": "微信小程序登录所用的appid、appsecret需要在对应的小程序管理控制台获取",
    "appsecret": "微信小程序后台获取的appsecret"
   }
  }
 },
 "mp-alipay": {
  "oauth": {
   "alipay": {
    "appid": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr",
    "privateKey": "支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr"
   }
  }
 },
 "service": {
  "sms": {
   "name": "用户登录",
   "codeExpiresIn": 600,
   "smsKey": "",
   "smsSecret": "",
   "templateId": ""
  },
  "univerify": {
   "appid": "",
   "apiKey": "",
   "apiSecret": ""
  }
 }
}