提交 9c4a2b70 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修改错别字

## 1.0.12(2021-05-28)
修复拦截器在ios app端会报错:Unhandled promise...的问题
## 1.0.10(2021-05-27)
新增callfunction的拦截器废除this.request的写法。为callFunction添加:请求失败是否断网判断并提示、恢复网络自动重新执行、自动处理响应体,目前处理了403为token过期自动跳转到登陆页面,今后会添加更多的自动行为、自动延续token过期时间
新增callfunction的拦截器废除this.request的写法。为callFunction添加:请求失败是否断网判断并提示、恢复网络自动重新执行、自动处理响应体:token过期自动跳转到登陆页面、token自动续期
## 1.0.9(2021-05-23)
修复变量被重复定义的问题
## 1.0.8(2021-05-22)
......
{
"name": "uni-starter",
"appid": "",
"description": "云端一体应用快速开发模版",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
"app-plus": {
"privacy": {
"prompt": "template",
"template": {
"title": "服务协议和隐私政策",
"message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept": "同意",
"buttonRefuse": "暂不同意"
}
},
"compatible": {
"ignoreVersion": true
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {
"Fingerprint": {},
"Share": {},
"Push": {},
"OAuth": {}
},
"distribute": {
"android": {
"permissions": ["<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"]
},
"ios": {},
"sdkConfigs": {
"oauth": {
"univerify": {},
"apple": {}
},
"ad": {},
"share": {},
"geolocation": {},
"push": {
"unipush": {}
},
"payment": {}
}
},
"nvueLaunchMode": ""
},
"quickapp": {},
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"es6": false
},
"usingComponents": true,
"betterScopedSlots": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"h5": {
"template": ""
}
{
"name" : "uni-starter",
"appid" : "__UNI__E5373F7",
"description" : "云端一体应用快速开发模版",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"privacy" : {
"prompt" : "template",
"template" : {
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ask.dcloud.net.cn/protocol.html\">《服务协议》</a>和<a href=\"https://ask.dcloud.net.cn/protocol.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意",
"buttonRefuse" : "暂不同意"
}
},
"compatible" : {
"ignoreVersion" : true
},
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"modules" : {
"Fingerprint" : {},
"Share" : {},
"Push" : {},
"OAuth" : {}
},
"distribute" : {
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {},
"sdkConfigs" : {
"oauth" : {
"univerify" : {},
"apple" : {},
"weixin" : {
"appid" : "32234",
"appsecret" : "3223",
"UniversalLinks" : ""
}
},
"ad" : {},
"share" : {},
"geolocation" : {},
"push" : {
"unipush" : {}
},
"payment" : {}
}
},
"nvueLaunchMode" : ""
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx81dbb061d2258234",
"setting" : {
"urlCheck" : false,
"es6" : false
},
"usingComponents" : true,
"betterScopedSlots" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"h5" : {
"template" : ""
}
}
......@@ -4,26 +4,41 @@
<text class="title">登录后即可展示自己</text>
<uni-agreements @setAgree="agree = $event"></uni-agreements>
<!-- 登录框 -->
<input type="number" class="input-box" :inputBorder="false" v-model="phone" maxlength="11" placeholder="请输入手机号"/>
<input type="number" class="input-box" :inputBorder="false" v-model="phone" maxlength="11"
placeholder="请输入手机号" />
<button class="get-code" :class="{isPhone}" :disabled="!isPhone" :type="isPhone?'primary':'default'"
@click="sendShortMsg">获取短信验证码</button>
<text class="tip">未注册的手机号验证通过后将自动注册</text>
<text class="tip">未注册的手机号验证通过后将自动注册</text>
<!-- 登录按钮弹窗 -->
<uni-quick-login :agree="agree" ref="uniQuickLogin"></uni-quick-login>
<uni-quick-login :univerifyStyle="univerifyStyle" :agree="agree" ref="uniQuickLogin"></uni-quick-login>
</view>
</template>
<script>
var univerify_first,currentWebview;//是否一键登录优先
var univerify_first, currentWebview; //是否一键登录优先
export default {
data() {
return {
phone:"",
agree:false
phone: "",
agree: false,
univerifyStyle: {
"fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。
"backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff
"buttons": { // 自定义登陆按钮
"iconWidth": "45px", // 图标宽度(高度等比例缩放) 默认值:45px
"list": [{
"iconPath": "/static/apple.png" // 图标路径仅支持本地图片
},
{
"iconPath": "/static/wechat.png" // 图标路径仅支持本地图片
}
]
}
}
}
},
computed: {
isPhone(){
isPhone() {
return /^1\d{10}$/.test(this.phone);
}
},
......@@ -31,31 +46,31 @@ var univerify_first,currentWebview;//是否一键登录优先
//是否优先启动一键登录。即:页面一加载就启动一键登录
univerify_first = e.univerify_first
//#ifdef APP-PLUS
if(univerify_first){
if (univerify_first) {
const pages = getCurrentPages();
currentWebview = pages[pages.length - 1].$getAppWebview();
currentWebview.setStyle({
"top":"2000px" //隐藏当前页面窗体
"top": "2000px" //隐藏当前页面窗体
})
}
//#endif
},
onReady() {
//#ifdef APP-PLUS
if(univerify_first){
if (univerify_first) {
console.log('开始一键登录');
setTimeout(()=>{
setTimeout(() => {
this.$refs.uniQuickLogin.login('univerify')
},100)
}, 100)
setTimeout(() => {
currentWebview.setStyle({
titleNView:{
autoBackButton:true,
backgroundColor:"#FFFFFF"
titleNView: {
autoBackButton: true,
backgroundColor: "#FFFFFF"
}
})
currentWebview.setStyle({
"top":"0"
"top": "0"
})
}, 1500);
}
......@@ -63,7 +78,7 @@ var univerify_first,currentWebview;//是否一键登录优先
},
methods: {
sendShortMsg() {
if(!this.agree){
if (!this.agree) {
return uni.showToast({
title: '你未同意隐私政策协议',
icon: 'none'
......@@ -90,4 +105,4 @@ var univerify_first,currentWebview;//是否一键登录优先
<style lang="scss">
@import url("../common/login-page.css");
</style>
</style>
......@@ -30,7 +30,7 @@ export default {
filePath:url
})
.then(res=>{
//console.log(res);
console.log(res);
callback(res.fileID)
uni.hideLoading()
})
......
<template>
<view>
<uni-list>
<uni-list-item class="item" link>
<uni-list-item class="item" @click="setAvatar" link>
<view slot="body" class="item">
<text>头像</text>
<uni-file-picker file-mediatype="image" return-type="object" v-model="userInfo.avatar" />
<!-- <uni-file-picke disable-preview :del-icon="false" return-type="object" fileMediatype="image" /> -->
<!-- <image class="avatarUrl" :src="userInfo.avatar||nullAvatarUrl" mode="widthFix"></image> -->
<text>头像</text>
<image class="avatarUrl" :src="userInfo.avatar||nullAvatarUrl" mode="widthFix"></image>
</view>
</uni-list-item>
<uni-list-item class="item" @click="setNickname('')" title="昵称" :rightText="userInfo.nickname||'未设置'" link>
</uni-list-item>
<uni-list-item class="item" @click="bindMobile" title="手机号" :rightText="userInfo.mobile||'未绑定'" link>
</uni-list-item>
<uni-list-item class="item" @click="setNickname('')" title="昵称" :rightText="userInfo.nickname||'未设置'" link></uni-list-item>
<uni-list-item class="item" @click="bindMobile" title="手机号" :rightText="userInfo.mobile||'未绑定'" link></uni-list-item>
</uni-list>
<uni-popup ref="dialog" type="dialog">
<uni-popup-dialog mode="input" :value="userInfo.nickname" @confirm="setNickname" title="设置昵称"
placeholder="请输入要设置的昵称">
<uni-popup-dialog mode="input" :value="userInfo.nickname" @confirm="setNickname" title="设置昵称" placeholder="请输入要设置的昵称">
</uni-popup-dialog>
</uni-popup>
</view>
......@@ -58,16 +52,16 @@
uni.preLogin({
provider: 'univerify',
success: this.univerify(), //预登录成功
fail: (res) => { // 预登录失败
fail:(res)=> { // 预登录失败
// 不显示一键登录选项(或置灰)
console.log(res)
console.log(res)
this.bindMobileBySmsCode()
}
})
// #endif
// #ifndef APP-PLUS
this.bindMobileBySmsCode()
//...去用验证码绑定
this.bindMobileBySmsCode()
//...去用验证码绑定
// #endif
},
univerify() {
......@@ -94,23 +88,19 @@
// });
// }
// }
// )
uniCloud.callFunction({
name: 'uni-id-cf',
data: {
action: 'bind_mobile_by_univerify',
params: e.authResult,
},
success: ({
result
}) => {
// )
uniCloud.callFunction({
name:'uni-id-cf',
data:{
action:'bind_mobile_by_univerify',
params:e.authResult,
},
success: ({result}) => {
console.log(result);
if (result.code === 0) {
this.setUserInfo({
"mobile": result.mobile
})
if(result.code===0){
this.setUserInfo({"mobile":result.mobile})
uni.closeAuthView()
} else {
}else{
uni.showModal({
content: JSON.stringify(result.msg),
showCancel: false,
......@@ -118,13 +108,13 @@
uni.closeAuthView()
}
});
}
}
}
}
})
},
fail: (err) => {
console.log(err);
if (err.code == '30002') {
if(err.code=='30002'){
this.bindMobileBySmsCode()
}
}
......@@ -132,11 +122,11 @@
},
bindMobileBySmsCode() {
uni.navigateTo({
url: '/pages/ucenter/userinfo/bind-mobile/bind-mobile'
url:'/pages/ucenter/userinfo/bind-mobile/bind-mobile'
})
},
setNickname(nickname) {
console.log(9527, nickname);
console.log(9527,nickname);
if (nickname) {
usersTable.where('_id==$env.uid').update({
nickname
......@@ -219,10 +209,9 @@
justify-content: space-between;
align-items: center;
}
.avatarUrl {
width: 50px;
height: 50px;
border-radius: 6px;
}
</style>
</style>
/*
重要的事情说三遍:
本文件不能有任何注释,删除后才能正常使用
本文件不能有任何注释,删除后才能正常使用
本文件不能有任何注释,删除后才能正常使用
*/
{
"passwordSecret": "passwordSecret-demo", // 数据库中password字段是加密存储的,这里的passwordSecret即为加密密码所用的密钥,注意修改为自己的密钥,使用一个较长的字符串即可
"tokenSecret": "tokenSecret-demo", // 生成token所用的密钥,注意修改为自己的,使用一个较长的字符串即可
"tokenExpiresIn": 7200, // 全平台token过期时间,未指定过期时间的平台会使用此值
"tokenExpiresThreshold": 600, // 新增于uni-id 1.1.7版本,checkToken时如果token有效期小于此值则自动获取新token,请注意将新token返回给前端保存,如果不配置此参数则不开启自动获取新token功能
"bindTokenToDevice": false, // 是否将token和设备绑定,设置为true会进行ua校验,uni-id 3.0.12前默认为true3.0.12及以后版本默认调整为false
"passwordErrorLimit": 6, // 密码错误最大重试次数
"passwordErrorRetryTime": 3600, // 密码错误重试次数超限之后的冻结时间
"autoSetInviteCode": false, // 是否在用户注册时自动设置邀请码,默认不自动设置
"forceInviteCode": false, // 是否强制用户注册时必填邀请码,默认为false(需要注意的是目前只有短信验证码注册才可以填写邀请码),设置为true时需要在loginBySms时指定type为register来使用注册,登录时也要传入type为login
"removePermissionAndRoleFromToken": false, // 新增于uni-id 3.0.0版本,如果配置为false则自动缓存用户的角色、权限到token中,默认值为false。详细说明见https://uniapp.dcloud.io/uniCloud/uni-id?id=cachepermissionintoken
"app-plus": {
"tokenExpiresIn": 2592000,
"oauth": {
// App微信登录所用到的appid、appsecret需要在微信开放平台获取,注意:不是公众平台而是开放平台
"weixin": {
"appid": "weixin appid",
"appsecret": "weixin appsecret"
},
"apple": { // 使用苹果登录时需要
"bundleId": "your bundleId"
}
}
},
"mp-weixin": {
"tokenExpiresIn": 259200,
"oauth": {
// 微信小程序登录所用的appid、appsecret需要在对应的小程序管理控制台获取
"weixin": {
"appid": "weixin appid",
"appsecret": "weixin appsecret"
}
}
},
"mp-alipay": {
"tokenExpiresIn": 259200,
"oauth": {
// 支付宝小程序登录用到的appid、privateKey请参考支付宝小程序的文档进行设置或者获取,https://opendocs.alipay.com/open/291/105971#LDsXr
"alipay": {
"appid": "alipay appid",
"privateKey": "alipay privateKey", // 私钥
"keyType": "PKCS8" // 私钥类型,如果私钥类型不是PKCS8,需要填写此字段,否则会出现“error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag”错误
}
}
},
"service": {
"sms": {
"name": "your app name", // 应用名称,对应短信模版的name
"codeExpiresIn": 180, // 验证码过期时间,单位为秒,注意一定要是60的整数倍
"smsKey": "your sms key", // 短信密钥key,开通短信服务处可以看到
"smsSecret": "your sms secret" // 短信密钥secret,开通短信服务处可以看到
},
"univerify": {
"appid": "your appid", // 当前应用的appid,使用云函数URL化,此项必须配置
"apiKey": "your apiKey",// apiKey apiSecret 在开发者中心获取,开发者中心:https://dev.dcloud.net.cn/uniLogin/index?type=0,文档:https://ask.dcloud.net.cn/article/37965
"apiSecret": "your apiSecret"
}
}
{
"passwordSecret": "passwordSecret-demo",
"tokenSecret": "tokenSecret-demo",
"tokenExpiresIn": 7200,
"tokenExpiresThreshold": 600,
"passwordErrorLimit": 6,
"bindTokenToDevice": true,
"passwordErrorRetryTime": 3600,
"autoSetInviteCode": false,
"forceInviteCode": false,
"app-plus": {
"tokenExpiresIn": 2592000,
"oauth": {
"weixin": {
"appid": "wxffdd8fa6ec4ef2a0",
"appsecret": "6c9119430d7be0a147bcbbb73ef33acf"
},
"apple": {
"bundleId": "io.dcloud.hellouniapp"
}
}
},
"mp-weixin": {
"oauth": {
"weixin": {
"appid": "wx81dbb061d2258234",
"appsecret": "73be6e8b8b31b7b0783fe448cc1fe820"
}
}
},
"mp-alipay": {
"oauth": {
"alipay": {
"appid": "alipay appid",
"privateKey": "alipay privateKey"
}
}
},
"service": {
"sms": {
"name": "DCloud",
"codeExpiresIn": 300,
"smsKey": "71a19f38c954f7d768d68a050486bf15",
"smsSecret": "d6c424b702d73baa3b6e1a1452469213"
},
"univerify": {
"appid": "__UNI__03B096E",
"apiKey": "3fc28519d90d74173bcecf2daf4ffcc4",
"apiSecret": "dd793e5bc4b372ce932f35bbb4c5d61b"
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册