Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦想橡皮擦
uni-starter
提交
7e4d083c
U
uni-starter
项目概览
梦想橡皮擦
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7e4d083c
编写于
5月 06, 2021
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增微信小程序登陆
上级
c292898a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
61 addition
and
21 deletion
+61
-21
baseapp.config.js
baseapp.config.js
+2
-5
common/appInit.js
common/appInit.js
+0
-2
components/uni-agreements/uni-agreements.vue
components/uni-agreements/uni-agreements.vue
+5
-2
components/uni-quick-login/uni-quick-login.vue
components/uni-quick-login/uni-quick-login.vue
+49
-7
pages.json
pages.json
+1
-1
pages/ucenter/settings/settings.vue
pages/ucenter/settings/settings.vue
+2
-2
uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json
...loudfunctions/common/uni-config-center/uni-id/config.json
+2
-2
未找到文件。
baseapp.config.js
浏览文件 @
7e4d083c
...
...
@@ -25,13 +25,10 @@ module.exports = {
"
/uni_modules/uni-news-favorite/pages/uni-news-favorite/list
"
,
"
/pages/ucenter/userinfo/uploadCutImageToUnicloud
"
],
"
login
"
:
[
"
smsCode
"
,
"
uniVerify
"
,
"
username
"
,
"
weixin
"
,
"
apple
"
],
/*
"
login
"
:
[
"
smsCode
"
,
"
uniVerify
"
,
"
username
"
,
"
weixin
"
,
"
apple
"
],
/*
根据数组的第0项,决定登陆方式的第一优先级。
未列举到的,或设备环境不支持的选项,将被隐藏。
快捷登陆按钮,在任意一页面都存在。
所以只有三种情况:
一键登录(uniVerify)、账号(username)、验证码登陆(其他值为第一项都为验证码登陆)
如果你需要在不同平台有不同的配置,直接用条件编译即可
*/
},
...
...
common/appInit.js
浏览文件 @
7e4d083c
...
...
@@ -55,8 +55,6 @@ export default function() {
e
.
url
+=
"
univerify_first=true
"
}
else
if
(
login
[
0
]
==
'
username
'
)
{
e
.
url
=
"
/pages/ucenter/login-page/pwd-login/pwd-login
"
}
else
{
//默认即是
}
}
return
true
...
...
components/uni-agreements/uni-agreements.vue
浏览文件 @
7e4d083c
...
...
@@ -3,7 +3,7 @@
<text>
登陆即表示同意
</text>
<template
v-for=
"(agreement,index) in agreements"
>
<text
class=
"agreement"
@
click=
"navigateTo(agreement)"
>
{{
agreement
.
title
}}
</text>
<text
class=
"hint"
v-if=
"
agreements.length-1>index
"
>
和
</text>
<text
class=
"hint"
v-if=
"
hasAnd(agreements,index)
"
>
和
</text>
</
template
>
</view>
</template>
...
...
@@ -13,7 +13,7 @@
name
:
"
uni-agreements
"
,
computed
:{
agreements
(){
return
getApp
().
globalData
.
config
.
about
.
agreements
return
getApp
().
globalData
.
config
.
about
.
agreements
||
[]
}
},
methods
:{
...
...
@@ -24,6 +24,9 @@
fail
:
()
=>
{},
complete
:
()
=>
{}
});
},
hasAnd
(
agreements
,
index
){
return
agreements
.
length
-
1
>
index
}
},
data
()
{
...
...
components/uni-quick-login/uni-quick-login.vue
浏览文件 @
7e4d083c
...
...
@@ -5,6 +5,9 @@
<image
class=
"logo"
:src=
"item.logo"
mode=
"widthFix"
></image>
<text
class=
"login-title"
>
{{
item
.
text
}}
</text>
</view>
<!-- #ifdef MP -->
<!-- #endif -->
</view>
</
template
>
<
script
>
...
...
@@ -15,19 +18,27 @@
//前一个窗口的页面地址。控制点击切换快捷登陆方式是创建还是返回
import
loginSuccess
from
'
@/pages/ucenter/login-page/common/loginSuccess.js
'
;
export
default
{
computed
:
{
loginConfig
()
{
return
getApp
().
globalData
.
config
.
router
.
login
}
},
data
()
{
return
{
servicesList
:
[{
"
id
"
:
"
username
"
,
"
text
"
:
"
账号登陆
"
,
"
logo
"
:
"
/static/uni-quick-login/user.png
"
,
"
path
"
:
"
/pages/ucenter/login-page/pwd-login/pwd-login
"
},
{
"
id
"
:
"
smsCode
"
,
"
text
"
:
"
短信验证码
"
,
"
logo
"
:
"
/static/uni-quick-login/sms.png
"
,
"
path
"
:
"
/pages/ucenter/login-page/index/index
"
}
]
],
oauthServices
:
[]
}
},
props
:
{
...
...
@@ -79,6 +90,8 @@
},
},
created
()
{
console
.
log
(
'
loginConfig
'
,
this
.
loginConfig
);
console
.
log
(
'
this.getRoute(1)
'
,
this
.
getRoute
(
1
));
let
servicesList
=
this
.
servicesList
//去掉当前页面对应的登陆选项
for
(
var
i
=
0
;
i
<
servicesList
.
length
;
i
++
)
{
...
...
@@ -86,6 +99,14 @@
servicesList
.
splice
(
i
,
1
)
}
}
//去掉配置项中不存在的项
for
(
var
i
=
0
;
i
<
servicesList
.
length
;
i
++
)
{
if
(
!
this
.
loginConfig
.
includes
(
servicesList
[
i
].
id
))
{
console
.
log
(
servicesList
[
i
].
id
);
servicesList
.
splice
(
i
,
1
)
}
}
console
.
log
(
'
servicesList
'
,
servicesList
);
},
mounted
()
{
//获取当前环境能用的快捷登陆方式
...
...
@@ -113,6 +134,15 @@
console
.
error
(
'
获取服务供应商失败:
'
+
JSON
.
stringify
(
err
));
})
// #endif
// #ifdef MP-WEIXIN
let
id
=
'
weixin
'
if
(
this
.
loginConfig
.
includes
(
id
))
{
this
.
servicesList
.
push
({
...
this
.
config
[
id
],
id
})
}
// #endif
},
methods
:
{
...
mapMutations
({
...
...
@@ -138,7 +168,6 @@
},
login_before
(
type
,
navigateBack
=
true
)
{
console
.
log
(
arguments
);
console
.
log
(
'
services
'
,
services
);
let
oauthService
=
this
.
oauthServices
.
find
((
service
)
=>
service
.
id
==
type
)
console
.
log
(
type
);
...
...
@@ -163,6 +192,9 @@
uni
.
login
({
"
provider
"
:
type
,
"
univerifyStyle
"
:
this
.
univerifyStyle
,
complete
:
(
e
)
=>
{
console
.
log
(
9527
,
e
);
},
success
:
async
e
=>
{
console
.
log
(
e
);
if
(
type
==
'
apple
'
)
{
...
...
@@ -171,6 +203,13 @@
})
Object
.
assign
(
e
.
authResult
,
res
.
userInfo
)
}
// #ifdef MP-WEIXIN
if
(
type
==
'
weixin
'
)
{
return
this
.
login
({
code
:
e
.
code
},
type
)
}
// #endif
this
.
login
(
e
.
authResult
,
type
)
},
fail
:
(
err
)
=>
{
...
...
@@ -210,7 +249,10 @@
})
},
login
(
params
,
type
)
{
//联网验证登陆
console
.
log
(
params
,
type
);
console
.
log
({
params
,
type
});
this
.
request
(
'
user-center/login_by_
'
+
type
,
params
,
result
=>
{
console
.
log
(
result
);
if
(
result
.
code
===
0
)
{
...
...
@@ -251,9 +293,9 @@
.quick-login-box
{
flex-direction
:
row
;
width
:
750
rpx
;
justify-content
:
space-around
;
position
:
fixed
;
bottom
:
10
rpx
;
justify-content
:
space-around
;
position
:
fixed
;
bottom
:
10
rpx
;
left
:
0
;
}
...
...
@@ -269,7 +311,7 @@
height
:
60
rpx
;
}
.login-title
{
.login-title
{
margin-top
:
4px
;
font-size
:
26
rpx
;
}
...
...
pages.json
浏览文件 @
7e4d083c
...
...
@@ -205,7 +205,7 @@
"path"
:
"pages/ucenter/settings/settings"
}
],
"current"
:
0
"current"
:
1
},
"tabBar"
:
{
"color"
:
"#7A7E83"
,
...
...
pages/ucenter/settings/settings.vue
浏览文件 @
7e4d083c
<
template
>
<view
class=
"content"
>
<!-- 功能列表 -->
<uni-list
class=
"mt10"
>
<uni-list
class=
"mt10"
:border=
"false"
>
<uni-list-item
title=
"个人资料"
to=
"/pages/ucenter/userinfo/userinfo"
link=
"navigateTo"
></uni-list-item>
<uni-list-item
v-if=
"userInfo.mobile"
title=
"修改密码"
:to=
"'/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve?phoneNumber='+ userInfo.mobile"
link=
"navigateTo"
></uni-list-item>
</uni-list>
<!-- #ifndef H5 -->
<uni-list
class=
"mt10"
>
<uni-list
class=
"mt10"
:border=
"false"
>
<!-- #ifdef APP-PLUS -->
<!-- 检查push过程未结束不显示,push设置项 -->
<uni-list-item
title=
"清理缓存"
@
click=
"clearTmp"
link
></uni-list-item>
...
...
uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json
浏览文件 @
7e4d083c
...
...
@@ -23,8 +23,8 @@
"mp-weixin"
:
{
"oauth"
:
{
"weixin"
:
{
"appid"
:
"wx
999bf02c8e05dfc9
"
,
"appsecret"
:
"
b5f608afd332b2c0ded7e6b98ca4ccd3
"
"appid"
:
"wx
81dbb061d2258234
"
,
"appsecret"
:
"
73be6e8b8b31b7b0783fe448cc1fe820
"
}
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录