Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
德宏大魔王
uni-starter
提交
570948df
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看板
提交
570948df
编写于
5月 18, 2021
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
重大调整,原云函数名称:user-center改名叫uni-id-cf
上级
909a1803
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
70 addition
and
68 deletion
+70
-68
README.md
README.md
+2
-2
changelog.md
changelog.md
+3
-1
components/uni-quick-login/uni-quick-login.vue
components/uni-quick-login/uni-quick-login.vue
+1
-1
components/uni-send-sms-code/uni-send-sms-code.vue
components/uni-send-sms-code/uni-send-sms-code.vue
+1
-1
package.json
package.json
+2
-2
pages/ucenter/login-page/phone-code/phone-code.vue
pages/ucenter/login-page/phone-code/phone-code.vue
+1
-1
pages/ucenter/login-page/pwd-login/pwd-login.vue
pages/ucenter/login-page/pwd-login/pwd-login.vue
+43
-43
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue
+4
-4
pages/ucenter/login-page/register/register.vue
pages/ucenter/login-page/register/register.vue
+8
-8
pages/ucenter/userinfo/bind-mobile/bind-mobile.vue
pages/ucenter/userinfo/bind-mobile/bind-mobile.vue
+2
-2
pages/ucenter/userinfo/userinfo.vue
pages/ucenter/userinfo/userinfo.vue
+1
-1
uniCloud-aliyun/cloudfunctions/uni-id-cf/index.js
uniCloud-aliyun/cloudfunctions/uni-id-cf/index.js
+0
-0
uniCloud-aliyun/cloudfunctions/uni-id-cf/package-lock.json
uniCloud-aliyun/cloudfunctions/uni-id-cf/package-lock.json
+1
-1
uniCloud-aliyun/cloudfunctions/uni-id-cf/package.json
uniCloud-aliyun/cloudfunctions/uni-id-cf/package.json
+1
-1
未找到文件。
README.md
浏览文件 @
570948df
...
...
@@ -95,7 +95,7 @@ uni-starter + uniCloud admin,应用开发从未如此简单快捷!
-
短信登陆:
+
使用本功能需要在
[
DCloud开发者中心
](
https://dev.dcloud.net.cn/uniSms
)
开通并充值
+
教程参考
[
短信服务开通指南
](
https://ask.dcloud.net.cn/article/37534
)
+
修改短信注册/登陆发生验证码的模板id,在文件
`/uniCloud-aliyun/cloudfunctions/u
ser-center
/index.js`
搜索
`const templateId = '11753'`
替换为自己申请的模板id
+
修改短信注册/登陆发生验证码的模板id,在文件
`/uniCloud-aliyun/cloudfunctions/u
ni-id-cf
/index.js`
搜索
`const templateId = '11753'`
替换为自己申请的模板id
-
一键登录:
+
[
开通配置
](
https://dev.dcloud.net.cn/uniLogin
)
+
[
使用指南
](
https://uniapp.dcloud.io/univerify
)
...
...
@@ -301,7 +301,7 @@ uni-starter
│ │ | | └─file.cert uni-id依赖的配置文件,假如你使用微信发红包功能,需要的证书文件就是放到这里
│ | | └───uni-id uni-id用户体系
<a
target=
"_blank"
href=
"https://uniapp.dcloud.io/uniCloud/uni-id"
>
详情
</a>
│ | ├─uni-analyse-searchhot 云端一体搜索模板依赖的云函数
<a
target=
"_blank"
href=
"https://ext.dcloud.net.cn/plugin?id=3851"
>
详情
</a>
│ | └─u
ser-center
用户中心云函数,实现用户注册、修改密码、发送验证码、快捷登录(微信、短信、账户、一键登录)
│ | └─u
ni-id-cf
用户中心云函数,实现用户注册、修改密码、发送验证码、快捷登录(微信、短信、账户、一键登录)
│ └──database 云数据目录
│ ├─db_init.json db_init.json初始化数据库文件,其中不再包含schema
<a
target=
"_blank"
href=
"https://uniapp.dcloud.net.cn/uniCloud/hellodb?id=db-init"
>
详情
</a>
│ ├─opendb-app-versions.schema.json 应用版本,表结构文件
...
...
changelog.md
浏览文件 @
570948df
## 1.0.2(2021-05-17)
添加 uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json 文件
## 1.0.1(2021-05-17)
manifest.json 在小程序平台增加了一个配置项 betterScopedSlots,启用新的作用域插槽编译,用于支持作用域插槽内使用复杂表达式。
## 1.0.0(2021-05-17)
第一版
第一版
\ No newline at end of file
components/uni-quick-login/uni-quick-login.vue
浏览文件 @
570948df
...
...
@@ -265,7 +265,7 @@
params
,
type
});
this
.
request
(
'
u
ser-center
/login_by_
'
+
type
,
params
,
result
=>
{
this
.
request
(
'
u
ni-id-cf
/login_by_
'
+
type
,
params
,
result
=>
{
console
.
log
(
result
);
if
(
result
.
code
===
0
)
{
if
(
type
==
'
univerify
'
)
{
...
...
components/uni-send-sms-code/uni-send-sms-code.vue
浏览文件 @
570948df
...
...
@@ -75,7 +75,7 @@
icon
:
'
none
'
});
this
.
request
(
'
u
ser-center
/sendSmsCode
'
,
this
.
request
(
'
u
ni-id-cf
/sendSmsCode
'
,
{
"
mobile
"
:
this
.
phone
,
"
type
"
:
this
.
codeType
...
...
package.json
浏览文件 @
570948df
{
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"1.0.
1
"
,
"description"
:
"集成了商用项目开发常见功能的项目模板"
,
"version"
:
"1.0.
2
"
,
"description"
:
"
一个
集成了商用项目开发常见功能的项目模板"
,
"keywords"
:
[
"uni-starter"
,
"login"
,
...
...
pages/ucenter/login-page/phone-code/phone-code.vue
浏览文件 @
570948df
...
...
@@ -42,7 +42,7 @@
},
methods
:
{
submit
(){
//完成并提交
this
.
request
(
'
u
ser-center
/loginBySms
'
,
this
.
request
(
'
u
ni-id-cf
/loginBySms
'
,
{
"
mobile
"
:
this
.
phone
,
"
code
"
:
this
.
code
...
...
pages/ucenter/login-page/pwd-login/pwd-login.vue
浏览文件 @
570948df
...
...
@@ -5,10 +5,10 @@
<uni-agreements
@
setAgree=
"agree = $event"
></uni-agreements>
<input
class=
"input-box"
:inputBorder=
"false"
v-model=
"username"
placeholder=
"请输入手机号/用户名"
></input>
<input
type=
"password"
class=
"input-box"
:inputBorder=
"false"
v-model=
"password"
placeholder=
"请输入密码"
></input>
<view
class=
"captcha-box"
v-if=
"captchaBase64"
>
<image
class=
"captcha-img"
@
click=
"createCaptcha"
:src=
"captchaBase64"
mode=
"widthFix"
></image>
<input
type=
"text"
class=
"input-box captcha"
:inputBorder=
"false"
v-model=
"captcha"
placeholder=
"请输入验证码"
></input>
</view>
<view
class=
"captcha-box"
v-if=
"captchaBase64"
>
<image
class=
"captcha-img"
@
click=
"createCaptcha"
:src=
"captchaBase64"
mode=
"widthFix"
></image>
<input
type=
"text"
class=
"input-box captcha"
:inputBorder=
"false"
v-model=
"captcha"
placeholder=
"请输入验证码"
></input>
</view>
<button
class=
"send-btn"
:disabled=
"!canLogin"
:type=
"canLogin?'primary':'default'"
@
click=
"pwdLogin"
>
登录
</button>
<!-- 忘记密码 -->
...
...
@@ -28,8 +28,8 @@
return
{
"
password
"
:
""
,
"
username
"
:
""
,
"
agree
"
:
false
,
"
captchaBase64
"
:
""
,
"
agree
"
:
false
,
"
captchaBase64
"
:
""
,
"
captcha
"
:
""
}
},
...
...
@@ -63,9 +63,9 @@
});
}
// 下边是可以登录
this
.
request
(
'
u
ser-center
/login
'
,
{
this
.
request
(
'
u
ni-id-cf
/login
'
,
{
"
username
"
:
this
.
username
,
"
password
"
:
this
.
password
,
"
password
"
:
this
.
password
,
"
captcha
"
:
this
.
captcha
},
result
=>
{
console
.
log
(
result
);
...
...
@@ -73,32 +73,32 @@
this
.
loginSuccess
(
result
)
}
else
{
if
(
result
.
needCaptcha
)
{
uni
.
showToast
({
title
:
result
.
msg
,
icon
:
'
none
'
});
uni
.
showToast
({
title
:
result
.
msg
,
icon
:
'
none
'
});
this
.
createCaptcha
()
}
else
{
uni
.
showModal
({
title
:
'
错误
'
,
content
:
result
.
msg
,
showCancel
:
false
,
confirmText
:
'
知道了
'
});
}
else
{
uni
.
showModal
({
title
:
'
错误
'
,
content
:
result
.
msg
,
showCancel
:
false
,
confirmText
:
'
知道了
'
});
}
}
})
},
createCaptcha
(){
this
.
request
(
'
u
ser-center/createCaptcha
'
,
{
scene
:
"
login
"
},
result
=>
{
if
(
result
.
code
===
0
)
{
this
.
captchaBase64
=
result
.
captchaBase64
}
})
},
createCaptcha
(){
this
.
request
(
'
u
ni-id-cf/createCaptcha
'
,
{
scene
:
"
login
"
},
result
=>
{
if
(
result
.
code
===
0
)
{
this
.
captchaBase64
=
result
.
captchaBase64
}
})
},
/* 前往注册 */
toRegister
(
e
)
{
...
...
@@ -131,17 +131,17 @@
.toRegister
{
margin-top
:
80px
;
width
:
600
rpx
;
}
.captcha-box
{
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
flex-end
;
}
.captcha-img
{
margin
:
15px
15px
0
0
;
width
:
250
rpx
;
}
.captcha
{
width
:
350
rpx
;
}
</
style
>
.captcha-box
{
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
flex-end
;
}
.captcha-img
{
margin
:
15px
15px
0
0
;
width
:
250
rpx
;
}
.captcha
{
width
:
350
rpx
;
}
</
style
>
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue
浏览文件 @
570948df
...
...
@@ -95,7 +95,7 @@
}
]
}
}
}
}
},
computed
:
{
...
...
@@ -120,7 +120,7 @@
},
onLoad
(
event
)
{
if
(
event
&&
event
.
phoneNumber
)
{
this
.
formData
.
phone
=
event
.
phoneNumber
;
this
.
formData
.
phone
=
event
.
phoneNumber
;
}
},
onReady
()
{
...
...
@@ -135,7 +135,7 @@
submit
()
{
this
.
$refs
.
form
.
submit
()
.
then
(
res
=>
{
this
.
request
(
'
u
ser-center
/resetPwdBySmsCode
'
,
{
this
.
request
(
'
u
ni-id-cf
/resetPwdBySmsCode
'
,
{
"
mobile
"
:
this
.
formData
.
phone
,
"
code
"
:
this
.
formData
.
code
,
"
password
"
:
this
.
formData
.
pwd
...
...
@@ -159,6 +159,6 @@
@import
url("../common/login-page.css")
;
.content
{
padding-top
:
36
rpx
;
padding-top
:
36
rpx
;
}
</
style
>
pages/ucenter/login-page/register/register.vue
浏览文件 @
570948df
...
...
@@ -32,7 +32,7 @@ import mixin from '../common/login-page.mixin.js';
'
password
'
:
''
,
'
pwd2
'
:
''
},
rules
,
rules
,
agree
:
false
}
},
...
...
@@ -43,12 +43,12 @@ import mixin from '../common/login-page.mixin.js';
/**
* 触发表单提交
*/
submit
()
{
if
(
!
this
.
agree
){
return
uni
.
showToast
({
title
:
'
你未同意隐私政策协议
'
,
icon
:
'
none
'
});
submit
()
{
if
(
!
this
.
agree
){
return
uni
.
showToast
({
title
:
'
你未同意隐私政策协议
'
,
icon
:
'
none
'
});
}
uni
.
showLoading
({
mask
:
true
...
...
@@ -63,7 +63,7 @@ import mixin from '../common/login-page.mixin.js';
})
},
submitForm
(
value
)
{
this
.
request
(
'
u
ser-center
/register
'
,
value
,
result
=>
{
this
.
request
(
'
u
ni-id-cf
/register
'
,
value
,
result
=>
{
console
.
log
(
result
);
if
(
result
.
code
===
0
){
this
.
loginSuccess
(
result
)
...
...
pages/ucenter/userinfo/bind-mobile/bind-mobile.vue
浏览文件 @
570948df
...
...
@@ -48,7 +48,7 @@
*/
submit
()
{
console
.
log
(
this
.
formData
);
this
.
request
(
'
u
ser-center
/bind_mobile_by_sms
'
,
{
this
.
request
(
'
u
ni-id-cf
/bind_mobile_by_sms
'
,
{
"
mobile
"
:
this
.
formData
.
phone
,
"
code
"
:
this
.
formData
.
code
},
result
=>
{
...
...
@@ -79,7 +79,7 @@
height
:
50px
;
}
.input-box
{
.input-box
{
width
:
100%
;
margin-top
:
16px
;
background-color
:
#f9f9f9
;
...
...
pages/ucenter/userinfo/userinfo.vue
浏览文件 @
570948df
...
...
@@ -69,7 +69,7 @@
"
univerifyStyle
"
:
this
.
univerifyStyle
,
success
:
async
e
=>
{
console
.
log
(
e
.
authResult
);
this
.
request
(
'
u
ser-center
/bind_mobile_by_univerify
'
,
this
.
request
(
'
u
ni-id-cf
/bind_mobile_by_univerify
'
,
e
.
authResult
,
result
=>
{
...
...
uniCloud-aliyun/cloudfunctions/u
ser-center
/index.js
→
uniCloud-aliyun/cloudfunctions/u
ni-id-cf
/index.js
浏览文件 @
570948df
文件已移动
uniCloud-aliyun/cloudfunctions/u
ser-center
/package-lock.json
→
uniCloud-aliyun/cloudfunctions/u
ni-id-cf
/package-lock.json
浏览文件 @
570948df
{
"name"
:
"u
ser-center
"
,
"name"
:
"u
ni-id-cf
"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
...
...
uniCloud-aliyun/cloudfunctions/u
ser-center
/package.json
→
uniCloud-aliyun/cloudfunctions/u
ni-id-cf
/package.json
浏览文件 @
570948df
{
"name"
:
"u
ser-center
"
,
"name"
:
"u
ni-id-cf
"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录