新增云函数
This commit is contained in:
37
uniCloud-aliyun/cloudfunctions/AhChainPhone/index.js
Normal file
37
uniCloud-aliyun/cloudfunctions/AhChainPhone/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
exports.main = async (event) => {
|
||||
const secret = 'AhChain2021.'
|
||||
const hmac = crypto.createHmac('sha256', secret);
|
||||
|
||||
let params = event.queryStringParameters
|
||||
const sign = params.sign
|
||||
delete params.sign
|
||||
|
||||
const signStr = Object.keys(params).sort().map(key => {
|
||||
return `${key}=${params[key]}`
|
||||
}).join('&')
|
||||
|
||||
hmac.update(signStr);
|
||||
|
||||
if (sign !== hmac.digest('hex')) {
|
||||
throw new Error('非法访问')
|
||||
}
|
||||
|
||||
const {
|
||||
access_token,
|
||||
openid
|
||||
} = params
|
||||
|
||||
return await uniCloud.getPhoneNumber({
|
||||
appid: '__UNI__1F65101',
|
||||
provider: 'univerify',
|
||||
apiKey: '16fa20236696596869759d3a81541901',
|
||||
apiSecret: 'fca97287360c2e8f8259d8877a601887',
|
||||
access_token: access_token,
|
||||
openid: openid,
|
||||
})
|
||||
};
|
||||
8
uniCloud-aliyun/cloudfunctions/AhChainPhone/package.json
Normal file
8
uniCloud-aliyun/cloudfunctions/AhChainPhone/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"cloudfunction-config": {
|
||||
"memorySize": 128,
|
||||
"timeout": 5,
|
||||
"triggers": [],
|
||||
"path": "/ah-chain/phone-login"
|
||||
}
|
||||
}
|
||||
37
uniCloud-aliyun/cloudfunctions/ZhHealthPhone/index.js
Normal file
37
uniCloud-aliyun/cloudfunctions/ZhHealthPhone/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
exports.main = async (event) => {
|
||||
const secret = 'zhhealth2022.'
|
||||
const hmac = crypto.createHmac('sha256', secret);
|
||||
|
||||
let params = event.queryStringParameters
|
||||
const sign = params.sign
|
||||
delete params.sign
|
||||
|
||||
const signStr = Object.keys(params).sort().map(key => {
|
||||
return `${key}=${params[key]}`
|
||||
}).join('&')
|
||||
|
||||
hmac.update(signStr);
|
||||
|
||||
if (sign !== hmac.digest('hex')) {
|
||||
throw new Error('非法访问')
|
||||
}
|
||||
|
||||
const {
|
||||
access_token,
|
||||
openid
|
||||
} = params
|
||||
|
||||
return await uniCloud.getPhoneNumber({
|
||||
appid: '__UNI__C29473D',
|
||||
provider: 'univerify',
|
||||
apiKey: '16fa20236696596869759d3a81541901',
|
||||
apiSecret: 'fca97287360c2e8f8259d8877a601887',
|
||||
access_token: access_token,
|
||||
openid: openid,
|
||||
})
|
||||
};
|
||||
37
uniCloud-aliyun/cloudfunctions/phone-login/index.js
Normal file
37
uniCloud-aliyun/cloudfunctions/phone-login/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
exports.main = async (event) => {
|
||||
const secret = 'Yuzhankeji2021.'
|
||||
const hmac = crypto.createHmac('sha256', secret);
|
||||
|
||||
let params = event.queryStringParameters
|
||||
const sign = params.sign
|
||||
delete params.sign
|
||||
|
||||
const signStr = Object.keys(params).sort().map(key => {
|
||||
return `${key}=${params[key]}`
|
||||
}).join('&')
|
||||
|
||||
hmac.update(signStr);
|
||||
|
||||
if (sign !== hmac.digest('hex')) {
|
||||
throw new Error('非法访问')
|
||||
}
|
||||
|
||||
const {
|
||||
access_token,
|
||||
openid
|
||||
} = params
|
||||
|
||||
return await uniCloud.getPhoneNumber({
|
||||
appid: '__UNI__CD19AAD',
|
||||
provider: 'univerify',
|
||||
apiKey: '16fa20236696596869759d3a81541901',
|
||||
apiSecret: 'fca97287360c2e8f8259d8877a601887',
|
||||
access_token: access_token,
|
||||
openid: openid,
|
||||
})
|
||||
};
|
||||
8
uniCloud-aliyun/cloudfunctions/phone-login/package.json
Normal file
8
uniCloud-aliyun/cloudfunctions/phone-login/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"cloudfunction-config": {
|
||||
"memorySize": 128,
|
||||
"timeout": 5,
|
||||
"triggers": [],
|
||||
"path": "/http/phone-login"
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "uni-captcha",
|
||||
"version": "0.1.1",
|
||||
"description": "uni-captcha",
|
||||
"main": "index.js",
|
||||
"homepage": "https://ext.dcloud.net.cn/plugin?id=4048",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitee.com/dcloud/uni-captcha"
|
||||
},
|
||||
"author": "DCloud",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
4
uni_modules/uni-config-center/changelog.md
Normal file
4
uni_modules/uni-config-center/changelog.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## 0.0.2(2021-04-16)
|
||||
- 修改插件package信息
|
||||
## 0.0.1(2021-03-15)
|
||||
- 初始化项目
|
||||
80
uni_modules/uni-config-center/package.json
Normal file
80
uni_modules/uni-config-center/package.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"id": "uni-config-center",
|
||||
"displayName": "uni-config-center",
|
||||
"version": "0.0.2",
|
||||
"description": "uniCloud 配置中心",
|
||||
"keywords": [
|
||||
"配置",
|
||||
"配置中心"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"uniCloud",
|
||||
"云函数模板"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"directories": {
|
||||
"example": "../../../scripts/dist"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "u",
|
||||
"app-nvue": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "u",
|
||||
"Android Browser": "u",
|
||||
"微信浏览器(Android)": "u",
|
||||
"QQ浏览器(Android)": "u"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "u",
|
||||
"IE": "u",
|
||||
"Edge": "u",
|
||||
"Firefox": "u",
|
||||
"Safari": "u"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "u",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
93
uni_modules/uni-config-center/readme.md
Normal file
93
uni_modules/uni-config-center/readme.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# 为什么使用uni-config-center
|
||||
|
||||
实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
|
||||
|
||||
```bash
|
||||
cloudfunctions
|
||||
└─────common 公共模块
|
||||
├─plugin-a // 插件A对应的目录
|
||||
│ ├─index.js
|
||||
│ ├─config.json // plugin-a对应的配置文件
|
||||
│ └─other-file.cert // plugin-a依赖的其他文件
|
||||
└─plugin-b // plugin-b对应的目录
|
||||
├─index.js
|
||||
└─config.json // plugin-b对应的配置文件
|
||||
```
|
||||
|
||||
假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
|
||||
|
||||
uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下
|
||||
|
||||
```bash
|
||||
cloudfunctions
|
||||
└─────common 公共模块
|
||||
├─plugin-a // 插件A对应的目录
|
||||
│ └─index.js
|
||||
├─plugin-b // plugin-b对应的目录
|
||||
│ └─index.js
|
||||
└─uni-config-center
|
||||
├─index.js // config-center入口文件
|
||||
├─plugin-a
|
||||
│ ├─config.json // plugin-a对应的配置文件
|
||||
│ └─other-file.cert // plugin-a依赖的其他文件
|
||||
└─plugin-b
|
||||
└─config.json // plugin-b对应的配置文件
|
||||
```
|
||||
|
||||
使用uni-config-center后的优势
|
||||
|
||||
- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
|
||||
- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持)
|
||||
|
||||
# 用法
|
||||
|
||||
在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
|
||||
|
||||
```js
|
||||
const createConfig = require('uni-config-center')
|
||||
|
||||
const uniIdConfig = createConfig({
|
||||
pluginId: 'uni-id', // 插件id
|
||||
defaultConfig: { // 默认配置
|
||||
tokenExpiresIn: 7200,
|
||||
tokenExpiresThreshold: 600,
|
||||
},
|
||||
customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
|
||||
// defaudltConfig 默认配置
|
||||
// userConfig 用户配置
|
||||
return Object.assign(defaultConfig, userConfig)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 以如下配置为例
|
||||
// {
|
||||
// "tokenExpiresIn": 7200,
|
||||
// "passwordErrorLimit": 6,
|
||||
// "bindTokenToDevice": false,
|
||||
// "passwordErrorRetryTime": 3600,
|
||||
// "app-plus": {
|
||||
// "tokenExpiresIn": 2592000
|
||||
// },
|
||||
// "service": {
|
||||
// "sms": {
|
||||
// "codeExpiresIn": 300
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 获取配置
|
||||
uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象
|
||||
uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200
|
||||
uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300
|
||||
uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600
|
||||
|
||||
// 获取文件绝对路径
|
||||
uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
|
||||
|
||||
// 引用文件(require)
|
||||
uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。
|
||||
|
||||
// 判断是否包含某文件
|
||||
uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在
|
||||
```
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "uni-config-center",
|
||||
"version": "0.0.2",
|
||||
"description": "配置中心",
|
||||
"main": "index.js",
|
||||
"keywords": [],
|
||||
"author": "DCloud",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"passwordSecret": "passwordSecret-demo",
|
||||
"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": "应用名称,对应短信模版的name",
|
||||
"codeExpiresIn": 300,
|
||||
"smsKey": "短信密钥key,开通短信服务处可以看到",
|
||||
"smsSecret": "短信密钥secret,开通短信服务处可以看到"
|
||||
},
|
||||
"univerify": {
|
||||
"appid": "当前应用的appid,使用云函数URL化,此项必须配置",
|
||||
"apiKey": "apiKey 和 apiSecret 在开发者中心获取,开发者中心:https://dev.dcloud.net.cn/uniLogin/index?type=0,文档:https://ask.dcloud.net.cn/article/37965",
|
||||
"apiSecret": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
503
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
Normal file
503
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js
Normal file
@@ -0,0 +1,503 @@
|
||||
'use strict';
|
||||
let uniID = require('uni-id')
|
||||
const uniCaptcha = require('uni-captcha')
|
||||
const createConfig = require('uni-config-center')
|
||||
const uniIdConfig = createConfig({
|
||||
pluginId: 'uni-id'
|
||||
}).config()
|
||||
const db = uniCloud.database()
|
||||
const dbCmd = db.command
|
||||
const usersDB = db.collection('uni-id-users')
|
||||
exports.main = async (event, context) => {
|
||||
//UNI_WYQ:这里的uniID换成新的,保证多人访问不会冲突
|
||||
uniID = uniID.createInstance({
|
||||
context
|
||||
})
|
||||
console.log('event : ' + JSON.stringify(event))
|
||||
/*
|
||||
1.event为客户端 uniCloud.callFunction填写的data的值,这里介绍一下其中的属性
|
||||
action:表示要执行的任务名称、比如:登陆login、退出登陆 logout等
|
||||
params:业务数据内容
|
||||
uniIdToken:系统自动传递的token,数据来源客户端的 uni.getStorageSync('uni_id_token')
|
||||
*/
|
||||
const {
|
||||
action,
|
||||
uniIdToken,
|
||||
inviteCode
|
||||
} = event;
|
||||
const deviceInfo = event.deviceInfo || {};
|
||||
let params = event.params || {};
|
||||
/*
|
||||
2.在某些操作之前我们要对用户对身份进行校验(也就是要检查用户的token)再将得到的uid写入params.uid
|
||||
校验用到的方法是uniID.checkToken 详情:https://uniapp.dcloud.io/uniCloud/uni-id?id=checktoken
|
||||
|
||||
讨论,我们假设一个这样的场景,代码如下。
|
||||
如:
|
||||
uniCloud.callFunction({
|
||||
name:"xxx",
|
||||
data:{
|
||||
"params":{
|
||||
uid:"通过某种方式获取来的别人的uid"
|
||||
}
|
||||
}
|
||||
})
|
||||
用户就这样轻易地伪造了他人的uid传递给服务端,有一句话叫:前端从来的数据是不可信任的
|
||||
所以这里我们需要将uniID.checkToken返回的uid写入到params.uid
|
||||
*/
|
||||
let noCheckAction = ['register', 'checkToken', 'login', 'logout', 'sendSmsCode', 'createCaptcha',
|
||||
'verifyCaptcha', 'refreshCaptcha', 'inviteLogin', 'loginByWeixin', 'loginByUniverify',
|
||||
'loginByApple', 'loginBySms', 'resetPwdBySmsCode', 'registerAdmin'
|
||||
]
|
||||
if (!noCheckAction.includes(action)) {
|
||||
if (!uniIdToken) {
|
||||
return {
|
||||
code: 403,
|
||||
msg: '缺少token'
|
||||
}
|
||||
}
|
||||
let payload = await uniID.checkToken(uniIdToken)
|
||||
if (payload.code && payload.code > 0) {
|
||||
return payload
|
||||
}
|
||||
params.uid = payload.uid
|
||||
}
|
||||
|
||||
//禁止前台用户传递角色
|
||||
if (action.slice(0, 7) == "loginBy") {
|
||||
if (params.role) {
|
||||
return {
|
||||
code: 403,
|
||||
msg: '禁止前台用户传递角色'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//3.注册成功后创建新用户的积分表方法
|
||||
async function registerSuccess(uid) {
|
||||
//用户接受邀请
|
||||
if (inviteCode) {
|
||||
await uniID.acceptInvite({
|
||||
inviteCode,
|
||||
uid
|
||||
});
|
||||
}
|
||||
//添加当前用户设备信息
|
||||
await db.collection('uni-id-device').add({
|
||||
...deviceInfo,
|
||||
user_id: uid
|
||||
})
|
||||
await db.collection('uni-id-scores').add({
|
||||
user_id: uid,
|
||||
score: 1,
|
||||
type: 1,
|
||||
balance: 1,
|
||||
comment: "",
|
||||
create_date: Date.now()
|
||||
})
|
||||
}
|
||||
//4.记录成功登录的日志方法
|
||||
const loginLog = async (res = {}) => {
|
||||
const now = Date.now()
|
||||
const uniIdLogCollection = db.collection('uni-id-log')
|
||||
let logData = {
|
||||
deviceId: params.deviceId || context.DEVICEID,
|
||||
ip: params.ip || context.CLIENTIP,
|
||||
type: res.type,
|
||||
ua: context.CLIENTUA,
|
||||
create_date: now
|
||||
};
|
||||
|
||||
Object.assign(logData,
|
||||
res.code === 0 ? {
|
||||
user_id: res.uid,
|
||||
state: 1
|
||||
} : {
|
||||
state: 0
|
||||
})
|
||||
if (res.type == 'register') {
|
||||
await registerSuccess(res.uid)
|
||||
} else {
|
||||
if (Object.keys(deviceInfo).length) {
|
||||
console.log(979797, {
|
||||
deviceInfo,
|
||||
user_id: res
|
||||
});
|
||||
//更新当前用户设备信息
|
||||
await db.collection('uni-id-device').where({
|
||||
user_id: res.uid
|
||||
}).update(deviceInfo)
|
||||
}
|
||||
}
|
||||
return await uniIdLogCollection.add(logData)
|
||||
}
|
||||
|
||||
let res = {}
|
||||
switch (action) { //根据action的值执行对应的操作
|
||||
case 'bindMobileByUniverify':
|
||||
let {
|
||||
appid, apiKey, apiSecret
|
||||
} = uniIdConfig.service.univerify
|
||||
let univerifyRes = await uniCloud.getPhoneNumber({
|
||||
provider: 'univerify',
|
||||
appid,
|
||||
apiKey,
|
||||
apiSecret,
|
||||
access_token: params.access_token,
|
||||
openid: params.openid
|
||||
})
|
||||
if (univerifyRes.code === 0) {
|
||||
res = await uniID.bindMobile({
|
||||
uid: params.uid,
|
||||
mobile: univerifyRes.phoneNumber
|
||||
})
|
||||
res.mobile = univerifyRes.phoneNumber
|
||||
}
|
||||
break;
|
||||
case 'bindMobileBySms':
|
||||
// console.log({
|
||||
// uid: params.uid,
|
||||
// mobile: params.mobile,
|
||||
// code: params.code
|
||||
// });
|
||||
res = await uniID.bindMobile({
|
||||
uid: params.uid,
|
||||
mobile: params.mobile,
|
||||
code: params.code
|
||||
})
|
||||
// console.log(res);
|
||||
break;
|
||||
case 'register':
|
||||
var {
|
||||
username, password, nickname
|
||||
} = params
|
||||
if (/^1\d{10}$/.test(username)) {
|
||||
return {
|
||||
code: 401,
|
||||
msg: '用户名不能是手机号'
|
||||
}
|
||||
};
|
||||
if (/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(username)) {
|
||||
return {
|
||||
code: 401,
|
||||
msg: '用户名不能是邮箱'
|
||||
}
|
||||
}
|
||||
res = await uniID.register({
|
||||
username,
|
||||
password,
|
||||
nickname,
|
||||
inviteCode
|
||||
});
|
||||
if (res.code === 0) {
|
||||
await registerSuccess(res.uid)
|
||||
}
|
||||
break;
|
||||
case 'login':
|
||||
//防止黑客恶意破解登录,连续登录失败一定次数后,需要用户提供验证码
|
||||
const getNeedCaptcha = async () => {
|
||||
//当用户最近“2小时内(recordDate)”登录失败达到2次(recordSize)时。要求用户提交验证码
|
||||
const now = Date.now(),
|
||||
recordDate = 120 * 60 * 1000,
|
||||
recordSize = 2;
|
||||
const uniIdLogCollection = db.collection('uni-id-log')
|
||||
let recentRecord = await uniIdLogCollection.where({
|
||||
deviceId: params.deviceId || context.DEVICEID,
|
||||
create_date: dbCmd.gt(now - recordDate),
|
||||
type: 'login'
|
||||
})
|
||||
.orderBy('create_date', 'desc')
|
||||
.limit(recordSize)
|
||||
.get();
|
||||
return recentRecord.data.filter(item => item.state === 0).length === recordSize;
|
||||
}
|
||||
|
||||
let passed = false;
|
||||
let needCaptcha = await getNeedCaptcha();
|
||||
console.log('needCaptcha', needCaptcha);
|
||||
if (needCaptcha) {
|
||||
res = await uniCaptcha.verify({
|
||||
...params,
|
||||
scene: 'login'
|
||||
})
|
||||
if (res.code === 0) passed = true;
|
||||
}
|
||||
|
||||
if (!needCaptcha || passed) {
|
||||
res = await uniID.login({
|
||||
...params,
|
||||
queryField: ['username', 'email', 'mobile']
|
||||
});
|
||||
res.type = 'login'
|
||||
await loginLog(res);
|
||||
needCaptcha = await getNeedCaptcha();
|
||||
}
|
||||
|
||||
res.needCaptcha = needCaptcha;
|
||||
break;
|
||||
case 'loginByWeixin':
|
||||
res = await uniID.loginByWeixin(params);
|
||||
await uniID.updateUser({
|
||||
uid: res.uid,
|
||||
username: "微信用户"
|
||||
});
|
||||
res.userInfo.username = "微信用户"
|
||||
await loginLog(res)
|
||||
break;
|
||||
case 'loginByUniverify':
|
||||
res = await uniID.loginByUniverify(params)
|
||||
await loginLog(res)
|
||||
break;
|
||||
case 'loginByApple':
|
||||
res = await uniID.loginByApple(params)
|
||||
await loginLog(res)
|
||||
break;
|
||||
case 'checkToken':
|
||||
res = await uniID.checkToken(uniIdToken);
|
||||
break;
|
||||
case 'logout':
|
||||
res = await uniID.logout(uniIdToken)
|
||||
break;
|
||||
case 'sendSmsCode':
|
||||
/* -开始- 测试期间,为节约资源。统一虚拟短信验证码为: 123456;开启以下代码块即可 */
|
||||
// return uniID.setVerifyCode({
|
||||
// mobile: params.mobile,
|
||||
// code: '123456',
|
||||
// type: params.type
|
||||
// })
|
||||
/* -结束- */
|
||||
|
||||
// 简单限制一下客户端调用频率
|
||||
const ipLimit = await db.collection('opendb-verify-codes').where({
|
||||
ip: context.CLIENTIP,
|
||||
created_at: dbCmd.gt(Date.now() - 60000)
|
||||
}).get()
|
||||
if (ipLimit.data.length > 0) {
|
||||
return {
|
||||
code: 429,
|
||||
msg: '请求过于频繁'
|
||||
}
|
||||
}
|
||||
const templateId = '11753' // 替换为自己申请的模板id
|
||||
if (!templateId) {
|
||||
return {
|
||||
code: 500,
|
||||
msg: 'sendSmsCode需要传入自己的templateId,参考https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=sendsmscode'
|
||||
}
|
||||
}
|
||||
const randomStr = '00000' + Math.floor(Math.random() * 1000000)
|
||||
const code = randomStr.substring(randomStr.length - 6)
|
||||
res = await uniID.sendSmsCode({
|
||||
mobile: params.mobile,
|
||||
code,
|
||||
type: params.type,
|
||||
templateId
|
||||
})
|
||||
break;
|
||||
case 'loginBySms':
|
||||
if (!params.code) {
|
||||
return {
|
||||
code: 500,
|
||||
msg: '请填写验证码'
|
||||
}
|
||||
}
|
||||
if (!/^1\d{10}$/.test(params.mobile)) {
|
||||
return {
|
||||
code: 500,
|
||||
msg: '手机号码填写错误'
|
||||
}
|
||||
}
|
||||
res = await uniID.loginBySms(params)
|
||||
await loginLog(res)
|
||||
break;
|
||||
case 'resetPwdBySmsCode':
|
||||
if (!params.code) {
|
||||
return {
|
||||
code: 500,
|
||||
msg: '请填写验证码'
|
||||
}
|
||||
}
|
||||
if (!/^1\d{10}$/.test(params.mobile)) {
|
||||
return {
|
||||
code: 500,
|
||||
msg: '手机号码填写错误'
|
||||
}
|
||||
}
|
||||
params.type = 'login'
|
||||
let loginBySmsRes = await uniID.loginBySms(params)
|
||||
// console.log(loginBySmsRes);
|
||||
if (loginBySmsRes.code === 0) {
|
||||
res = await uniID.resetPwd({
|
||||
password: params.password,
|
||||
"uid": loginBySmsRes.uid
|
||||
})
|
||||
} else {
|
||||
return loginBySmsRes
|
||||
}
|
||||
break;
|
||||
case 'getInviteCode':
|
||||
res = await uniID.getUserInfo({
|
||||
uid: params.uid,
|
||||
field: ['my_invite_code']
|
||||
})
|
||||
if (res.code === 0) {
|
||||
res.myInviteCode = res.userInfo.my_invite_code
|
||||
delete res.userInfo
|
||||
}
|
||||
break;
|
||||
case 'getInvitedUser':
|
||||
res = await uniID.getInvitedUser(params)
|
||||
break;
|
||||
case 'updatePwd':
|
||||
res = await uniID.updatePwd(params)
|
||||
break;
|
||||
case 'createCaptcha':
|
||||
res = await uniCaptcha.create(params)
|
||||
break;
|
||||
case 'refreshCaptcha':
|
||||
res = await uniCaptcha.refresh(params)
|
||||
break;
|
||||
case 'getUserInviteCode':
|
||||
res = await uniID.getUserInfo({
|
||||
uid: params.uid,
|
||||
field: ['my_invite_code']
|
||||
})
|
||||
if (!res.userInfo.my_invite_code) {
|
||||
res = await uniID.setUserInviteCode({
|
||||
uid: params.uid
|
||||
})
|
||||
}
|
||||
break;
|
||||
|
||||
// =========================== admin api start =========================
|
||||
case 'registerAdmin': {
|
||||
var {
|
||||
username,
|
||||
password
|
||||
} = params
|
||||
let {
|
||||
total
|
||||
} = await db.collection('uni-id-users').where({
|
||||
role: 'admin'
|
||||
}).count()
|
||||
if (total) {
|
||||
return {
|
||||
code: 10001,
|
||||
message: '超级管理员已存在,请登录...'
|
||||
}
|
||||
}
|
||||
const appid = params.appid
|
||||
const appName = params.appName
|
||||
delete params.appid
|
||||
delete params.appName
|
||||
res = await uniID.register({
|
||||
username,
|
||||
password,
|
||||
role: ["admin"]
|
||||
})
|
||||
if (res.code === 0) {
|
||||
const app = await db.collection('opendb-app-list').where({
|
||||
appid
|
||||
}).count()
|
||||
if (!app.total) {
|
||||
await db.collection('opendb-app-list').add({
|
||||
appid,
|
||||
name: appName,
|
||||
description: "admin 管理后台",
|
||||
create_date: Date.now()
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'registerUser':
|
||||
const {
|
||||
userInfo
|
||||
} = await uniID.getUserInfo({
|
||||
uid: params.uid
|
||||
})
|
||||
if (userInfo.role.indexOf('admin') === -1) {
|
||||
res = {
|
||||
code: 403,
|
||||
message: '非法访问, 无权限注册超级管理员',
|
||||
}
|
||||
} else {
|
||||
// 过滤 dcloud_appid,注册用户成功后再提交
|
||||
const dcloudAppidList = params.dcloud_appid
|
||||
delete params.dcloud_appid
|
||||
res = await uniID.register({
|
||||
autoSetDcloudAppid: false,
|
||||
...params
|
||||
})
|
||||
if (res.code === 0) {
|
||||
delete res.token
|
||||
delete res.tokenExpired
|
||||
await uniID.setAuthorizedAppLogin({
|
||||
uid: res.uid,
|
||||
dcloudAppidList
|
||||
})
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'updateUser': {
|
||||
const {
|
||||
userInfo
|
||||
} = await uniID.getUserInfo({
|
||||
uid: params.uid
|
||||
})
|
||||
if (userInfo.role.indexOf('admin') === -1) {
|
||||
res = {
|
||||
code: 403,
|
||||
message: '非法访问, 无权限注册超级管理员',
|
||||
}
|
||||
} else {
|
||||
// 过滤 dcloud_appid,注册用户成功后再提交
|
||||
const dcloudAppidList = params.dcloud_appid
|
||||
delete params.dcloud_appid
|
||||
|
||||
// 过滤 password,注册用户成功后再提交
|
||||
const password = params.password
|
||||
delete params.password
|
||||
|
||||
// 过滤 uid、id
|
||||
const id = params.id
|
||||
delete params.id
|
||||
delete params.uid
|
||||
|
||||
|
||||
res = await uniID.updateUser({
|
||||
uid: id,
|
||||
...params
|
||||
})
|
||||
if (res.code === 0) {
|
||||
if (password) {
|
||||
await uniID.resetPwd({
|
||||
uid: id,
|
||||
password
|
||||
})
|
||||
}
|
||||
await uniID.setAuthorizedAppLogin({
|
||||
uid: id,
|
||||
dcloudAppidList
|
||||
})
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'getCurrentUserInfo':
|
||||
res = await uniID.getUserInfo({
|
||||
uid: params.uid,
|
||||
...params
|
||||
})
|
||||
break;
|
||||
// =========================== admin api end =========================
|
||||
default:
|
||||
res = {
|
||||
code: 403,
|
||||
msg: '非法访问'
|
||||
}
|
||||
break;
|
||||
}
|
||||
//返回数据给客户端
|
||||
return res
|
||||
}
|
||||
5
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package-lock.json
generated
Normal file
5
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package-lock.json
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "uni-id-cf",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "uni-id-cf",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
|
||||
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
|
||||
"uni-id": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id"
|
||||
}
|
||||
}
|
||||
62
uni_modules/uni-id/changelog.md
Normal file
62
uni_modules/uni-id/changelog.md
Normal file
@@ -0,0 +1,62 @@
|
||||
## 3.3.9(2021-11-09)
|
||||
- 去除重复的context.xxx未找到的提示语
|
||||
## 3.3.8(2021-10-28)
|
||||
- 新增 用户账户封禁接口 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=ban-account)
|
||||
- 新增 用户账户注销接口 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=close-account)
|
||||
- 修复 未传appid时用户重复注册的Bug
|
||||
## 3.3.7(2021-10-08)
|
||||
- 移除部分接口的废弃提示
|
||||
## 3.3.6(2021-09-08)
|
||||
- 修复 邀请码可能重复的Bug
|
||||
## 3.3.5(2021-08-10)
|
||||
- 修复版本号错误
|
||||
## 3.3.4(2021-08-10)
|
||||
- 微信、QQ、支付宝登录新增type参数用于指定当前是登录还是注册
|
||||
## 3.3.3(2021-08-04)
|
||||
- 修复使用数组形式的配置文件报错的Bug
|
||||
## 3.3.2(2021-08-03)
|
||||
- 修复上3.3.0版本引出的createInstance接口传入配置不生效的Bug 感谢[hmh](https://gitee.com/hmh)
|
||||
## 3.3.1(2021-07-30)
|
||||
- 修复 将设置用户允许登录的应用列表时传入空数组报错的Bug
|
||||
## 3.3.0(2021-07-30)
|
||||
- 新增 不同端应用配置隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config)
|
||||
- 新增 不同端用户隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user)
|
||||
+ 此版本升级需要开发者处理一下用户数据,请参考 [补齐用户dcloud_appid字段](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=makeup-dcloud-appid)
|
||||
- 新增 QQ登录、注册相关功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=qq)
|
||||
- 调整 不再支持绑定手机、邮箱时不填验证码直接绑定
|
||||
## 3.2.1(2021-07-09)
|
||||
- 撤销3.2.0版本所做的调整
|
||||
## 3.2.0(2021-07-09)
|
||||
- 【重要】支持不同端(管理端、用户端等)用户隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user)
|
||||
- 支持不同端(管理端、用户端等)配置文件隔离 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config)
|
||||
## 3.1.3(2021-07-08)
|
||||
- 移除插件内误传的node_modules
|
||||
## 3.1.2(2021-07-08)
|
||||
- 修复 微信小程序绑定微信账号时报错的Bug
|
||||
## 3.1.1(2021-07-01)
|
||||
- 使用新的错误码规范,兼容旧版 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=errcode)
|
||||
- 修复微信登录、绑定时未返回用户accessToken的Bug
|
||||
## 3.1.0(2021-04-19)
|
||||
- 增加对用户名、邮箱、密码字段的两端去空格
|
||||
- 默认忽略用户名、邮箱的大小写 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=case-sensitive)
|
||||
- 修复 customToken导出async方法报错的Bug
|
||||
## 3.0.12(2021-04-13)
|
||||
- 调整bindTokenToDevice默认值为false
|
||||
## 3.0.11(2021-04-12)
|
||||
- 修复3.0.7版本引出的多个用户访问时可能出现30201报错的Bug
|
||||
## 3.0.10(2021-04-08)
|
||||
- 优化错误提示
|
||||
## 3.0.9(2021-04-08)
|
||||
- bindMobile接口支持通过一键登录的方式绑定
|
||||
- 优化错误提示
|
||||
## 3.0.8(2021-03-19)
|
||||
- 修复 3.0.7版本某些情况下生成token报错的Bug
|
||||
## 3.0.7(2021-03-19)
|
||||
- 新增 支持uni-config-center,更新uni-id无须再担心配置被覆盖 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=uni-config-center)
|
||||
- 新增 自定义token内容,可以缓存角色权限之外的更多信息到客户端 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=custom-token)
|
||||
- 新增 支持传入context获取uni-id实例,防止单实例多并发时全局context混乱 [详情](https://uniapp.dcloud.io/uniCloud/uni-id?id=create-instance)
|
||||
## 3.0.6(2021-03-05)
|
||||
- 新增[uniID.wxBizDataCrypt](https://uniapp.dcloud.io/uniCloud/uni-id?id=%e5%be%ae%e4%bf%a1%e6%95%b0%e6%8d%ae%e8%a7%a3%e5%af%86)方法
|
||||
- 优化loginByApple方法,提高接口响应速度
|
||||
## 3.0.5(2021-02-03)
|
||||
- 调整为uni_modules目录规范
|
||||
84
uni_modules/uni-id/package.json
Normal file
84
uni_modules/uni-id/package.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"id": "uni-id",
|
||||
"displayName": "uni-id",
|
||||
"version": "3.3.9",
|
||||
"description": "简单、统一、可扩展的用户中心",
|
||||
"keywords": [
|
||||
"uniid",
|
||||
"uni-id",
|
||||
"用户管理",
|
||||
"用户中心",
|
||||
"短信验证码"
|
||||
],
|
||||
"repository": "https://gitee.com/dcloud/uni-id.git",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"uniCloud",
|
||||
"云函数模板"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": ["uni-config-center"],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "u",
|
||||
"app-nvue": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "u",
|
||||
"Android Browser": "u",
|
||||
"微信浏览器(Android)": "u",
|
||||
"QQ浏览器(Android)": "u"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "u",
|
||||
"IE": "u",
|
||||
"Edge": "u",
|
||||
"Firefox": "u",
|
||||
"Safari": "u"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "u",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
uni_modules/uni-id/readme.md
Normal file
33
uni_modules/uni-id/readme.md
Normal file
@@ -0,0 +1,33 @@
|
||||
**文档已移至[uni-id文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id)**
|
||||
|
||||
> 一般uni-id升级大版本时为不兼容更新,从低版本迁移到高版本请参考:[uni-id迁移指南](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=migration)
|
||||
|
||||
## 重要升级说明
|
||||
|
||||
**uni-id 3.x版本,搭配的uniCloud admin版本需大于1.2.10。**
|
||||
|
||||
### 缓存角色权限
|
||||
|
||||
自`uni-id 3.0.0`起,支持在token内缓存用户的角色权限,默认开启此功能,各登录接口的needPermission参数不再生效。如需关闭请在config内配置`"removePermissionAndRoleFromToken": true`。
|
||||
|
||||
为什么要缓存角色权限?要知道云数据库是按照读写次数来收取费用的,并且读写数据库会拖慢接口响应速度。未配置`"removePermissionAndRoleFromToken": true`的情况下,可以在调用checkToken接口时不查询数据库获取用户角色权限。
|
||||
|
||||
详细checkToken流程如下:
|
||||
|
||||

|
||||
|
||||
可以看出,旧版token(removePermissionAndRoleFromToken为true时生成的)在checkToken时如需返回权限需要进行两次数据库查询。新版token不需要查库即可返回权限信息。
|
||||
|
||||
**注意**
|
||||
|
||||
- 由于角色权限缓存在token内,可能会存在权限已经更新但是用户token未过期之前依然是旧版角色权限的情况。可以调短一些token过期时间来减少这种情况的影响。
|
||||
- admin角色token内不包含permission,如需自行判断用户是否有某个权限,要注意admin角色需要额外判断一下,写法如下
|
||||
```js
|
||||
const {
|
||||
role,
|
||||
permission
|
||||
} = await uniID.checkToken(event.uniIdToken)
|
||||
if(role.includes('admin') || permission.includes('your permission id')) {
|
||||
// 当前角色拥有'your permission id'对应的权限
|
||||
}
|
||||
```
|
||||
@@ -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.
|
||||
File diff suppressed because one or more lines are too long
5
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/package-lock.json
generated
Normal file
5
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/package-lock.json
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "uni-id",
|
||||
"version": "3.3.5",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "uni-id",
|
||||
"version": "3.3.5",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
exports.main = async (event, context) => {
|
||||
//event为客户端上传的参数
|
||||
console.log('event : ', event)
|
||||
|
||||
let res = {};
|
||||
let data = event.data;
|
||||
|
||||
switch (event.action) {
|
||||
case 'deleteFile':
|
||||
res = await uniCloud.deleteFile({
|
||||
fileList: data.fileList
|
||||
})
|
||||
break;
|
||||
}
|
||||
|
||||
//返回数据给客户端
|
||||
return res
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
var isReady=false;var onReadyCallbacks=[];
|
||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
||||
var __uniConfig = {"pages":["pages/index/index","pages/record/index","pages/store/index","pages/user/index","pages/auth/auth","pages/store/goods","pages/store/buy","pages/order/index","pages/order/details","pages/address/index","pages/address/edit","pages/pay/pay"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"ZH健康","navigationBarBackgroundColor":"#F3F6FB","backgroundColorTop":"#F3F6FB","backgroundColorBottom":"#F3F6FB"},"tabBar":{"borderStyle":"white","selectedColor":"#34CE98","list":[{"iconPath":"static/tabBar/tabBar_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png","pagePath":"pages/index/index","text":"发现"},{"iconPath":"static/tabBar/tabBar_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png","pagePath":"pages/record/index","text":"记录"},{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/store/index","text":"商城"},{"iconPath":"static/tabBar/tabBar_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png","pagePath":"pages/user/index","text":"我的"}]},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"健康监测","compilerVersion":"3.3.5","entryPagePath":"pages/pay/pay","entryPageQuery":"","realEntryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniConfig = {"pages":["pages/index/index","pages/record/index","pages/store/index","pages/user/index","pages/auth/auth","pages/store/goods","pages/store/buy","pages/order/index","pages/order/details","pages/address/index","pages/address/edit","pages/pay/pay"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"ZH健康","navigationBarBackgroundColor":"#F3F6FB","backgroundColorTop":"#F3F6FB","backgroundColorBottom":"#F3F6FB"},"tabBar":{"borderStyle":"white","selectedColor":"#34CE98","list":[{"iconPath":"static/tabBar/tabBar_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png","pagePath":"pages/index/index","text":"发现"},{"iconPath":"static/tabBar/tabBar_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png","pagePath":"pages/record/index","text":"记录"},{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/store/index","text":"商城"},{"iconPath":"static/tabBar/tabBar_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png","pagePath":"pages/user/index","text":"我的"}]},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"健康监测","compilerVersion":"3.3.5","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"发现","navigationStyle":"custom"}},{"path":"/pages/record/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"记录","navigationStyle":"custom"}},{"path":"/pages/store/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"健康生活","titleNView":{"backgroundColor":"#FFFFFF","titleSize":"16","buttons":[{"float":"left","text":"","fontSrc":"/static/iconfont.ttf","color":"#666","fontSize":"20px"},{"float":"right","text":"","fontSrc":"/static/iconfont.ttf","color":"#666","fontSize":"20px"}]}}},{"path":"/pages/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","navigationStyle":"custom"}},{"path":"/pages/auth/auth","meta":{},"window":{"navigationBarTitleText":"登录"}},{"path":"/pages/store/goods","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"详情","titleNView":{"backgroundColor":"#FFFFFF","type":"transparent"}}},{"path":"/pages/store/buy","meta":{},"window":{"navigationBarTitleText":"确认订单","enablePullDownRefresh":false}},{"path":"/pages/order/index","meta":{},"window":{"navigationBarTitleText":"订单","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/order/details","meta":{},"window":{"navigationBarTitleText":"订单详情","enablePullDownRefresh":false}},{"path":"/pages/address/index","meta":{},"window":{"navigationBarTitleText":"地址","titleNView":{"backgroundColor":"#FFFFFF","titleSize":"16","buttons":[{"float":"right","text":"新增","color":"#34CE98","fontSize":"14px"}]}}},{"path":"/pages/address/edit","meta":{},"window":{"navigationBarTitleText":"编辑","enablePullDownRefresh":false}},{"path":"/pages/pay/pay","meta":{},"window":{"navigationBarTitleText":"收银台","navigationBarBackgroundColor":"#FFFFFF"}}];
|
||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
|
||||
24
unpackage/dist/dev/app-plus/app-service.js
vendored
24
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/dev/app-plus/manifest.json
vendored
2
unpackage/dist/dev/app-plus/manifest.json
vendored
@@ -1 +1 @@
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__C29473D","name":"健康监测","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F3F6FB"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["\u003cuses-permission android:name\u003d\"android.permission.CHANGE_NETWORK_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.VIBRATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.READ_LOGS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.ACCESS_WIFI_STATE\"/\u003e","\u003cuses-feature android:name\u003d\"android.hardware.camera.autofocus\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.ACCESS_NETWORK_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.CAMERA\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.GET_ACCOUNTS\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.READ_PHONE_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.CHANGE_WIFI_STATE\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.WAKE_LOCK\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.FLASHLIGHT\"/\u003e","\u003cuses-feature android:name\u003d\"android.hardware.camera\"/\u003e","\u003cuses-permission android:name\u003d\"android.permission.WRITE_SETTINGS\"/\u003e"]},"apple":{},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#FFFFFF","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.3.5","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(255,255,255,0.4)","selectedColor":"#34CE98","list":[{"iconPath":"static/tabBar/tabBar_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png","pagePath":"pages/index/index","text":"发现"},{"iconPath":"static/tabBar/tabBar_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png","pagePath":"pages/record/index","text":"记录"},{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/store/index","text":"商城"},{"iconPath":"static/tabBar/tabBar_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png","pagePath":"pages/user/index","text":"我的"}],"height":"50px"},"launch_path":"__uniappview.html","arguments":"{\"pathName\":\"pages/pay/pay\",\"query\":\"\"}"}}
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__C29473D","name":"健康监测","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F3F6FB"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#FFFFFF","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.3.5","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(255,255,255,0.4)","selectedColor":"#34CE98","list":[{"iconPath":"static/tabBar/tabBar_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png","pagePath":"pages/index/index","text":"发现"},{"iconPath":"static/tabBar/tabBar_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png","pagePath":"pages/record/index","text":"记录"},{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/store/index","text":"商城"},{"iconPath":"static/tabBar/tabBar_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png","pagePath":"pages/user/index","text":"我的"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}
|
||||
Reference in New Issue
Block a user