1107
This commit is contained in:
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
+1
File diff suppressed because one or more lines are too long
Generated
Vendored
+1
File diff suppressed because one or more lines are too long
Generated
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "uni-config-center",
|
||||
"version": "0.0.3",
|
||||
"description": "配置中心",
|
||||
"main": "index.js",
|
||||
"keywords": [],
|
||||
"author": "DCloud",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
Generated
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"passwordSecret": "passwordSecret-demo",
|
||||
"tokenSecret": "tokenSecret-demo",
|
||||
"tokenExpiresIn": 604800,
|
||||
"tokenExpiresThreshold": 259200,
|
||||
"tokenMaxLimit": 10,
|
||||
"passwordErrorLimit": 6,
|
||||
"bindTokenToDevice": false,
|
||||
"passwordErrorRetryTime": 3600,
|
||||
"autoSetInviteCode": true,
|
||||
"forceInviteCode": false,
|
||||
"preferedAppPlatform": "app-plus",
|
||||
"preferedWebPlatform": "h5",
|
||||
"removeDcloudAppid": false,
|
||||
"app-plus": {
|
||||
"tokenExpiresIn": 604800,
|
||||
"oauth": {
|
||||
"weixin": {
|
||||
"appid": "",
|
||||
"appsecret": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-weixin": {
|
||||
"oauth": {
|
||||
"weixin": {
|
||||
"appid": "",
|
||||
"appsecret": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"h5-weixin": {
|
||||
"oauth": {
|
||||
"weixin": {
|
||||
"appid": "",
|
||||
"appsecret": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-alipay": {
|
||||
"oauth": {
|
||||
"alipay": {
|
||||
"appid": "",
|
||||
"privateKey": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-qq": {
|
||||
"oauth": {
|
||||
"qq": {
|
||||
"appid": "",
|
||||
"appsecret": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"service": {
|
||||
"sms": {
|
||||
"name": "重要",
|
||||
"codeExpiresIn": 180,
|
||||
"smsKey": "",
|
||||
"smsSecret": "",
|
||||
"templateId": ""
|
||||
},
|
||||
"univerify": {
|
||||
"appid": "",
|
||||
"apiKey": "",
|
||||
"apiSecret": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
证书内容
|
||||
-----END CERTIFICATE-----
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
证书内容
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
证书内容
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
证书内容
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
证书内容
|
||||
-----END CERTIFICATE-----
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
证书内容
|
||||
-----END CERTIFICATE-----
|
||||
Generated
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
### 文件名:
|
||||
#### 1、`alipayCertPublicKey_RSA2.crt`
|
||||
#### 2、`alipayRootCert.crt`
|
||||
#### 3、`appCertPublicKey.crt`
|
||||

|
||||
Generated
Vendored
+128
@@ -0,0 +1,128 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
module.exports = {
|
||||
/**
|
||||
* 统一支付回调地址,格式为 "服务空间SpaceID":"URL化完整地址"
|
||||
* 这里的本地开发并不是指 http://localhost:8080/ 的地址,而是另外一个服务空间的ULR化地址(如果你本地开发和线上环境共用同一个服务空间则只需要填线上环境的即可)
|
||||
* 回调的云函数地址,建议填 /http/vk-pay,因为vk-pay云函数已经写好了回调处理的逻辑,否则你需要自己写全部的回调逻辑。
|
||||
* 其中vk-pay是可以改名的,只需要修改 uniCloud/cloudfunctions/vk-pay/package.json 文件中的 "path": "/http/vk-pay", 把 /http/vk-pay 改成 /http/xxxx 即可(需要重新上传云函数vk-pay)。
|
||||
*/
|
||||
"notifyUrl": {
|
||||
// 本地开发环境,如果你本地开发和线上环境共用同一个服务空间则只需要填线上环境的即可
|
||||
"mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5": "https://mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.bspapp.com/http/vk-pay",
|
||||
// 线上正式环境
|
||||
"mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5": "https://fc-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/http/vk-pay"
|
||||
},
|
||||
/**
|
||||
* 微信
|
||||
* 公共参数说明
|
||||
* appId 微信后台的appId
|
||||
* secret 微信后台的secret
|
||||
* mchId 微信支付的商户id
|
||||
* key 微信支付的api密钥(V2版本)
|
||||
* pfx 微信支付的p12证书(退款需要)
|
||||
*/
|
||||
"wxpay": {
|
||||
// 微信 - 小程序支付(微信支付申请JSAPI支付)
|
||||
"mp-weixin": {
|
||||
"appId": "",
|
||||
"secret": "",
|
||||
"mchId": "",
|
||||
"key": "",
|
||||
"pfx": fs.readFileSync(__dirname + '/wxpay/wxpay.p12')
|
||||
},
|
||||
// 微信 - APP支付(微信支付申请APP支付)
|
||||
"app-plus": {
|
||||
"appId": "",
|
||||
"secret": "",
|
||||
"mchId": "",
|
||||
"key": "",
|
||||
"pfx": fs.readFileSync(__dirname + '/wxpay/wxpay.p12')
|
||||
},
|
||||
// 微信 - H5电脑网站二维码支付(微信支付申请Native支付)
|
||||
"h5": {
|
||||
"appId": "",
|
||||
"secret": "",
|
||||
"mchId": "",
|
||||
"key": "",
|
||||
"pfx": fs.readFileSync(__dirname + '/wxpay/wxpay.p12')
|
||||
},
|
||||
// 微信 - 公众号支付(微信支付申请JSAPI支付)
|
||||
"h5-weixin": {
|
||||
"appId": "",
|
||||
"secret": "",
|
||||
"mchId": "",
|
||||
"key": "",
|
||||
"pfx": fs.readFileSync(__dirname + '/wxpay/wxpay.p12')
|
||||
},
|
||||
// 微信 - 手机外部浏览器H5支付(微信支付申请H5支付)
|
||||
"mweb": {
|
||||
"appId": "",
|
||||
"secret": "",
|
||||
"mchId": "",
|
||||
"key": "",
|
||||
"pfx": fs.readFileSync(__dirname + '/wxpay/wxpay.p12'),
|
||||
// 场景信息,必填
|
||||
"sceneInfo": {
|
||||
"h5_info": {
|
||||
"type": "Wap", // 此值固定Wap
|
||||
"wap_url": "https://www.xxxxxx.com", // 你的H5首页地址,必须和你发起支付的页面的域名一致。
|
||||
"wap_name": "网站名称", // 你的H5网站名称
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 支付宝(证书记得选java版本)
|
||||
* 公共参数说明
|
||||
* mchId 支付宝商户id 2088开头的那个(此参数可以去除)
|
||||
* appId 支付宝开放平台的应用appId
|
||||
* secret 支付宝开放平台的应用secret
|
||||
* privateKey 应用私钥
|
||||
* alipayPublicCertPath 支付宝公钥证书路径地址 与之对应的 alipayPublicCertContent 为支付宝公钥证书内容(值可以是字符串也可以是Buffer)
|
||||
* alipayRootCertPath 支付宝根证书路径地址 与之对应的 alipayRootCertContent 为支付宝根证书内容(值可以是字符串也可以是Buffer)
|
||||
* appCertPath 应用证书路径地址 与之对应的 appCertPathContent 为应用证书内容(值可以是字符串也可以是Buffer)
|
||||
* sandbox 是否沙箱模式 true 沙箱模式 false 正常模式
|
||||
*/
|
||||
"alipay": {
|
||||
// 支付宝 - 小程序支付配置
|
||||
"mp-alipay": {
|
||||
"mchId": "",
|
||||
"appId": "",
|
||||
"privateKey": "",
|
||||
"alipayPublicCertPath": path.join(__dirname, 'alipay/alipayCertPublicKey_RSA2.crt'),
|
||||
"alipayRootCertPath": path.join(__dirname, 'alipay/alipayRootCert.crt'),
|
||||
"appCertPath": path.join(__dirname, 'alipay/appCertPublicKey.crt'),
|
||||
"sandbox": false
|
||||
},
|
||||
// 支付宝 - APP支付配置
|
||||
"app-plus": {
|
||||
"mchId": "",
|
||||
"appId": "",
|
||||
"privateKey": "",
|
||||
"alipayPublicCertPath": path.join(__dirname, 'alipay/alipayCertPublicKey_RSA2.crt'),
|
||||
"alipayRootCertPath": path.join(__dirname, 'alipay/alipayRootCert.crt'),
|
||||
"appCertPath": path.join(__dirname, 'alipay/appCertPublicKey.crt'),
|
||||
"sandbox": false
|
||||
},
|
||||
// 支付宝 - H5支付配置(包含:网站二维码、手机H5,需申请支付宝当面付接口权限)
|
||||
"h5": {
|
||||
"mchId": "",
|
||||
"appId": "",
|
||||
"privateKey": "",
|
||||
"alipayPublicCertPath": path.join(__dirname, 'alipay/alipayCertPublicKey_RSA2.crt'),
|
||||
"alipayRootCertPath": path.join(__dirname, 'alipay/alipayRootCert.crt'),
|
||||
"appCertPath": path.join(__dirname, 'alipay/appCertPublicKey.crt'),
|
||||
"sandbox": false
|
||||
},
|
||||
// 支付宝 - 转账到支付宝等资金转出接口,其中 appCertSn 和 alipayRootCertSn 通过工具获取
|
||||
"transfer": {
|
||||
"mchId": "",
|
||||
"appId": "",
|
||||
"privateKey": "",
|
||||
"appCertSn": "", // 应用证书的序列号
|
||||
"alipayRootCertSn": "", // 支付宝根证书的序列号
|
||||
"sandbox": false
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
Vendored
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
### 文件名:
|
||||
#### 1、`wxpay.p12`
|
||||

|
||||
Generated
Vendored
+141
@@ -0,0 +1,141 @@
|
||||
var uniIdConfig;
|
||||
var uniPayConfig;
|
||||
try {
|
||||
uniIdConfig = require('../uni-id/config.json');
|
||||
} catch(err) {
|
||||
console.error("配置文件:uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json 编译错误,请检查!↓↓↓请查看下方的错误提示↓↓↓", err.name, err.message, err);
|
||||
throw new Error("配置文件:uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json 编译错误,请检查!↑↑↑请查看上方的错误提示↑↑↑");
|
||||
}
|
||||
|
||||
try {
|
||||
uniPayConfig = require('../uni-pay/config.js');
|
||||
} catch(err) {
|
||||
console.error("配置文件:uniCloud/cloudfunctions/common/uni-config-center/uni-pay/config.js 编译错误,请检查!↓↓↓请查看下方的错误提示↓↓↓", err.name, err.message, err);
|
||||
throw new Error("配置文件:uniCloud/cloudfunctions/common/uni-config-center/uni-pay/config.js 编译错误,请检查!↑↑↑请查看上方的错误提示↑↑↑");
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
"uni": uniIdConfig,
|
||||
"uni-pay": uniPayConfig,
|
||||
"vk": {
|
||||
"system": {
|
||||
// 若serviceShutdow:true,则所有云函数无法访问(适用于需要临时关闭后端服务的情况,如迁移数据)
|
||||
// 注意:本地调试时,需要重新启动本地服务才能生效。
|
||||
"serviceShutdown": false,
|
||||
"serviceShutdownDescription": "系统维护中,预计2小时恢复!",
|
||||
// 云函数默认时区(中国为8)
|
||||
"targetTimezone": 8
|
||||
},
|
||||
// 加密的密钥
|
||||
"crypto": {
|
||||
"aes": "dad4c0cb88c7d005bc5e844b8e79a9f0dad4c0cb88c7d005bc5e844b8e79a9f0", // 对称加密的密钥,建议长度在64位-128位(此处建议修改成自己的密钥)
|
||||
},
|
||||
// 当 context 内的下面值为空时,赋予默认的值(主要用于解决云函数 URL 后的默认 APPID 问题。
|
||||
"context": {
|
||||
"APPID": "", // 默认 dcloud_appid
|
||||
"PLATFORM": "h5", // 可选项 h5、mp-weixin、app-plus、mp-alipay
|
||||
"LOCALE": "zh-Hans", // 默认语言
|
||||
"CLIENTIP":"127.0.0.1", // 默认客户端IP(主要用于解决本地调试无ip的问题)
|
||||
},
|
||||
"service": {
|
||||
// 邮箱发送服务
|
||||
"email": {
|
||||
"codeExpiresIn": 180, // 邮件验证码有效期(单位秒)
|
||||
// qq邮箱参数配置
|
||||
"qq": {
|
||||
"host": "smtp.qq.com",
|
||||
"port": 465,
|
||||
"secure": true,
|
||||
"auth": {
|
||||
"user": "你的邮箱@qq.com",
|
||||
"pass": "邮箱授权码"
|
||||
}
|
||||
},
|
||||
// 163邮箱配置
|
||||
"163":{
|
||||
"host": "smtp.163.com",
|
||||
"port": 465,
|
||||
"secure": true,
|
||||
"auth": {
|
||||
"user": "",
|
||||
"pass": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
// 日志服务
|
||||
"log": {
|
||||
// 用户登录日志
|
||||
"login": {
|
||||
"status": true // 是否开启用户登录日志
|
||||
}
|
||||
},
|
||||
// 短信服务
|
||||
"sms": {
|
||||
// 阿里云短信服务
|
||||
"aliyun": {
|
||||
"enable": true, // 是否使用阿里云短信代替unicloud短信发送短信验证码
|
||||
"accessKeyId": "LTAI4FyY6A493kVYn5ezyAw6", // 短信密钥key
|
||||
"accessKeySecret": "776MyYZfRb8cQHTe5ji0jBVu1rHfa9", // 短信密钥secret
|
||||
"signName": "亿利通", // 默认签名
|
||||
"templateCode": {
|
||||
"verifyCode": "SMS_210078693" // 验证码短信模板 - 配合uni-id需要
|
||||
}
|
||||
}
|
||||
},
|
||||
// 开放平台api
|
||||
"openapi": {
|
||||
// 百度开放平台 (主要用于身份证识别,营业执照识别等API)
|
||||
// API Key申请地址:https://cloud.baidu.com/doc/OCR/s/rk3h7xzck 点击右上角注册
|
||||
"baidu": {
|
||||
"appid": "", // 对应的API Key
|
||||
"appsecret": "" // 对应的Secret Key
|
||||
}
|
||||
}
|
||||
},
|
||||
"db": {
|
||||
"unicloud": {
|
||||
"maxLimit": 1000, // 最大limit限制(目前腾讯云最大1000,阿里云最大1000)
|
||||
"cancelAddTime": false, // 取消 vk.baseDao.add 时自动生成 _add_time 和 _add_time_str
|
||||
"cancelAddTimeStr": false, // 仅取消 vk.baseDao.add 时自动生成的 _add_time_str,若已设置 cancelAddTime 为true,则 cancelAddTimeStr 也会强制为true
|
||||
"getTableData": {
|
||||
"sortArr": [{ "name": "_add_time", "type": "desc" }], // vk.baseDao.getTableData 默认排序规则 vk.db.unicloud.getTableData.sortArr
|
||||
}
|
||||
}
|
||||
},
|
||||
// 其他小程序的密钥 当需要多个小程序绑定同一服务空间,并调用小程序服务端API时需要填写 暂只支持微信小程序
|
||||
"oauth": {
|
||||
// 微信小程序
|
||||
"weixin": {
|
||||
// 密钥列表
|
||||
"list": [
|
||||
{ "appid": "", "appsecret": "" },
|
||||
{ "appid": "", "appsecret": "" }
|
||||
]
|
||||
},
|
||||
// 支付宝
|
||||
"alipay": {
|
||||
// 密钥列表
|
||||
"list": [
|
||||
{ "appid": "", "privateKey": "" },
|
||||
{ "appid": "", "privateKey": "" }
|
||||
]
|
||||
},
|
||||
// qq
|
||||
"qq": {
|
||||
// 密钥列表
|
||||
"list": [
|
||||
{ "appid": "", "appsecret": "" },
|
||||
{ "appid": "", "appsecret": "" }
|
||||
]
|
||||
},
|
||||
// 抖音
|
||||
"toutiao": {
|
||||
// 密钥列表
|
||||
"list": [
|
||||
{ "appid": "", "appsecret": "" },
|
||||
{ "appid": "", "appsecret": "" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Generated
Vendored
+73
@@ -0,0 +1,73 @@
|
||||
## 重要说明
|
||||
|
||||
#### 框架目前的配置(不含`uni-id`)在 `cloudfunctions/common/uni-config-center/vk-unicloud/index.js` 中配置
|
||||
|
||||
#### `uni-id` 的配置是在 `cloudfunctions/common/uni-config-center/uni-id/config.json` 中配置
|
||||
|
||||
#### 每次修改完 配置 中的内容后如果不生效,则尝试以下操作。
|
||||
```
|
||||
1. 上传 uni-config-center 公共模块
|
||||
2. 重新上传 router 云函数
|
||||
|
||||
如果是连接本地云函数,则需要重启本地服务才会生效。(hbx的原因)
|
||||
```
|
||||
|
||||
|
||||
### 由于`uni-id`配置无法打注释,故下方为`uni-id`配置的介绍
|
||||
```js
|
||||
{
|
||||
"passwordSecret": "passwordSecret-demo",// 加密密码所用的密钥,修改会导致所用户之前的密码失效。如一定要修改,请查看https://uniapp.dcloud.io/uniCloud/uni-id?id=modifysecret
|
||||
"tokenSecret": "tokenSecret-demo", // 生成token所用的密钥,修改会导致所有用户之前的token失效。
|
||||
"tokenExpiresIn": 604800, // 全平台token过期时间,未指定过期时间的平台会使用此值,604800代表7天
|
||||
"tokenExpiresThreshold": 3600, // 新增于uni-id 1.1.7版本,checkToken时如果token有效期小于此值则自动获取新token,如果不配置此参数则不开启自动获取新token功能
|
||||
"passwordErrorLimit": 6, // 密码错误最大重试次数
|
||||
"bindTokenToDevice": false, // 是否将token和设备绑定,设置为true会进行ua校验
|
||||
"passwordErrorRetryTime": 3600, // 密码错误重试次数超限之后的冻结时间
|
||||
"autoSetInviteCode": true, // 是否在用户注册时自动设置邀请码
|
||||
"forceInviteCode": false, // 是否强制用户注册时必填邀请码,默认为false(需要注意的是目前只有短信验证码注册才可以填写邀请码)
|
||||
"app-plus": {
|
||||
"tokenExpiresIn": 604800, // app端 token过期时间
|
||||
"oauth" : {
|
||||
// App微信登录所用到的appid、appsecret需要在微信开放平台获取,注意:不是公众平台而是开放平台
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"appsecret" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-weixin": {
|
||||
"oauth" : {
|
||||
// 微信小程序登录所用的appid、appsecret需要在对应的小程序管理控制台获取
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"appsecret" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-alipay": {
|
||||
"oauth" : {
|
||||
// 支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr
|
||||
"alipay" : {
|
||||
"appid" : "",
|
||||
"privateKey" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"service": {
|
||||
// unicloud短信
|
||||
"sms": {
|
||||
"name": "重要", // 应用名称,对应短信模版的name
|
||||
"codeExpiresIn": 180, // 验证码过期时间,单位为秒,注意一定要是60的整数倍
|
||||
"smsKey": "你的smsKey", // 短信密钥key,开通短信服务处可以看到 https://dev.dcloud.net.cn/uniSms
|
||||
"smsSecret": "你的smsSecret", // 短信密钥secret,开通短信服务处可以看到 https://dev.dcloud.net.cn/uniSms
|
||||
"templateId":"你的短信模板ID" // 短信模板ID
|
||||
},
|
||||
// 一键登录
|
||||
"univerify": {
|
||||
"appid":"your appid", // uniapp的appid
|
||||
"apiKey": "your apiKey", // 一键登录的apiKey
|
||||
"apiSecret": "your apiSecret" // 一键登录的apiSecret
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "uni-id",
|
||||
"version": "3.3.28",
|
||||
"description": "uni-id for uniCloud",
|
||||
"main": "index.js",
|
||||
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitee.com/dcloud/uni-id.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user