Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
言程序plus
uni-starter
提交
675f1da3
U
uni-starter
项目概览
言程序plus
/
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看板
提交
675f1da3
编写于
11月 16, 2022
作者:
study夏羽
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除多余文件
上级
721bf925
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
0 addition
and
535 deletion
+0
-535
components/uni-agreements/uni-agreements.vue
components/uni-agreements/uni-agreements.vue
+0
-79
pages/ucenter/login-page/index/index.test.js
pages/ucenter/login-page/index/index.test.js
+0
-55
pages/ucenter/login-page/phone-code/phone-code.test1.js
pages/ucenter/login-page/phone-code/phone-code.test1.js
+0
-37
pages/ucenter/login-page/pwd-login/pwd-login.test.js
pages/ucenter/login-page/pwd-login/pwd-login.test.js
+0
-83
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.test.js
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.test.js
+0
-62
pages/ucenter/login-page/register/register.test.js
pages/ucenter/login-page/register/register.test.js
+0
-67
uni_modules/uni-id-cf/changelog.md
uni_modules/uni-id-cf/changelog.md
+0
-39
uni_modules/uni-id-cf/package.json
uni_modules/uni-id-cf/package.json
+0
-81
uni_modules/uni-id-cf/readme.md
uni_modules/uni-id-cf/readme.md
+0
-7
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package-lock.json
...id-cf/uniCloud/cloudfunctions/uni-id-cf/package-lock.json
+0
-25
未找到文件。
components/uni-agreements/uni-agreements.vue
已删除
100644 → 0
浏览文件 @
721bf925
<
template
>
<view
class=
"root"
>
<checkbox-group
@
change=
"setAgree"
class=
"checkbox-group"
>
<checkbox
:checked=
"isAgree"
style=
"transform: scale(0.7);"
/>
<text>
{{
$t
(
'
common.agree
'
)
}}
</text>
</checkbox-group>
<view
class=
"item"
v-for=
"(agreement,index) in agreements"
:key=
"index"
>
<text
class=
"agreement"
@
click=
"navigateTo(agreement)"
>
{{
agreement
.
title
}}
</text>
<text
class=
"hint"
v-if=
"hasAnd(agreements,index)"
>
&
</text>
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
"
uni-agreements
"
,
computed
:{
agreements
(){
return
getApp
().
globalData
.
config
.
about
.
agreements
||
[]
}
},
methods
:{
navigateTo
({
url
,
title
}){
uni
.
navigateTo
({
url
:
'
/pages/common/webview/webview?url=
'
+
url
+
'
&title=
'
+
title
,
success
:
res
=>
{},
fail
:
()
=>
{},
complete
:
()
=>
{}
});
},
hasAnd
(
agreements
,
index
){
return
agreements
.
length
-
1
>
index
},
setAgree
(
e
){
this
.
isAgree
=
!
this
.
isAgree
this
.
$emit
(
'
setAgree
'
,
this
.
isAgree
)
}
},
created
()
{
uni
.
$on
(
'
setAgreementsAgree
'
,
state
=>
{
console
.
log
(
'
setAgreementsAgree
'
,
state
);
this
.
isAgree
=
state
this
.
$emit
(
'
setAgree
'
,
state
)
})
},
data
()
{
return
{
isAgree
:
false
};
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
/* #ifndef APP-NVUE */
view
{
display
:
flex
;
box-sizing
:
border-box
;
flex-direction
:
column
;
}
/* #endif */
.root
{
flex-direction
:
row
;
align-items
:
center
;
font-size
:
28rpx
;
color
:
#8a8f8b
;
}
.checkbox-group
{
align-items
:
center
;
display
:
flex
;
flex-direction
:
row
;
}
.item
{
flex-direction
:
row
;
}
.agreement
{
color
:
#04498c
;
}
</
style
>
pages/ucenter/login-page/index/index.test.js
已删除
100644 → 0
浏览文件 @
721bf925
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/ucenter/login-page/index/index.vue
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
try
{
page
=
await
program
.
navigateTo
(
'
/pages/ucenter/login-page/index/index?type=smsCode
'
)
await
page
.
waitFor
(
500
)
console
.
log
(
"
await program.pageStack():
"
,
await
program
.
pageStack
());
}
catch
(
e
)
{
console
.
log
(
"
e:
"
,
e
);
}
})
it
(
'
smsCode-login
'
,
async
()
=>
{
const
perPage
=
await
page
.
$
(
'
.content
'
)
const
getTitle
=
await
perPage
.
$
(
'
.title
'
)
// console.log(await getTitle.text());
if
((
await
program
.
currentPage
()).
path
==
'
pages/ucenter/login-page/index/index
'
)
{
console
.
log
(
await
getTitle
.
text
(),
"
1-------------
"
);
// expect(await getTitle.text()).toBe('登录后即可展示自己')
const
setInput
=
await
page
.
setData
({
"
phone
"
:
'
17769516019
'
,
"
agree
"
:
true
,
// "type":"smsCode"
})
await
page
.
waitFor
(
300
)
console
.
log
(
await
page
.
data
(
'
phone
'
),
"
phone----------
"
);
console
.
log
(
await
page
.
data
(
'
agree
'
),
"
agree-----------
"
);
console
.
log
(
await
page
.
data
(
'
type
'
),
"
type----------
"
);
const
agreeTrue
=
await
page
.
waitFor
(
async
()
=>
{
return
await
page
.
data
(
'
agree
'
)
})
await
page
.
callMethod
(
'
sendShortMsg
'
)
await
page
.
waitFor
(
300
)
//pages/ucenter/login-page/phone-code/phone-code
}
if
((
await
program
.
currentPage
()).
path
==
'
pages/ucenter/login-page/pwd-login/pwd-login
'
)
{
console
.
log
(
await
getTitle
.
text
(),
"
2-------------
"
);
// expect(await getTitle.text()).toBe('用户名密码登录')
}
console
.
log
(
"
currentPage:----------
"
,
await
program
.
currentPage
());
})
})
pages/ucenter/login-page/phone-code/phone-code.test1.js
已删除
100644 → 0
浏览文件 @
721bf925
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/ucenter/login-page/phone-code/phone-code.vue
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
'
/pages/ucenter/login-page/phone-code/phone-code
'
)
await
page
.
waitFor
(
500
)
})
// ?phoneNumber=17769516019
it
(
'
获取短信验证码
'
,
async
()
=>
{
const
initClickRes
=
await
page
.
callMethod
(
'
initClick
'
)
console
.
log
(
"
initClickRes:
"
,
initClickRes
);
console
.
log
(
await
page
.
data
(
'
count
'
));
await
page
.
waitFor
(
500
)
await
page
.
setData
({
"
code
"
:
"
123456
"
})
expect
(
await
page
.
data
(
'
code
'
).
length
).
toBe
(
6
)
const
submitRes
=
await
page
.
callMethod
(
'
submit
'
)
console
.
log
(
"
submitRes:
"
,
submitRes
);
// expect(submitRes.msg).toBe('注册成功')
console
.
log
(
await
program
.
currentPage
());
// 登录成功后,/pages/ucenter/settings/settings
})
})
pages/ucenter/login-page/pwd-login/pwd-login.test.js
已删除
100644 → 0
浏览文件 @
721bf925
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/ucenter/login-page/pwd-login/pwd-login.vue
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
'
/pages/ucenter/login-page/pwd-login/pwd-login
'
)
await
page
.
waitFor
(
500
)
console
.
log
(
"
program.pageStack:
"
,
await
program
.
pageStack
());
})
it
(
'
前往注册页
'
,
async
()
=>
{
// expect.assertions(2);
const
resReg
=
await
page
.
callMethod
(
'
toRegister
'
)
await
page
.
waitFor
(
300
)
// expect((await program.currentPage()).path).toBe(
// 'pages/ucenter/login-page/register/register')
await
program
.
navigateBack
()
// await page.waitFor(500)
// 执行 navigateBack 验证是否返回navigateTo
// expect((await program.navigateBack()).path).toBe(
// 'pages/ucenter/login-page/pwd-login/pwd-login')
// console.log(await program.currentPage(),"22222222222");
})
it
(
'
用户名密码登录
'
,
async
()
=>
{
// expect.assertions(1);
const
setForm
=
await
page
.
setData
({
"
username
"
:
"
数字天堂
"
,
"
password
"
:
"
111111
"
,
// "captcha":"test",
"
agree
"
:
true
})
const
needCaptcha
=
await
page
.
data
(
'
needCaptcha
'
)
console
.
log
(
"
needCaptcha---1: :
"
,
needCaptcha
);
if
(
needCaptcha
){
await
page
.
setData
({
"
captcha
"
:
"
test
"
})
console
.
log
(
"
needCaptcha---2:
"
,
await
page
.
data
(
'
needCaptcha
'
));
}
const
resLogin
=
await
page
.
callMethod
(
'
pwdLogin
'
)
console
.
log
(
"
resLogin:
"
,
resLogin
.
code
);
switch
(
resLogin
.
code
){
case
0
:
console
.
log
(
'
登录成功
'
)
expect
(
resLogin
.
uid
).
toHaveLength
(
24
);
console
.
log
(
await
program
.
currentPage
(),
"
currentPage---------
"
);
break
;
case
10102
:
expect
(
resLogin
.
msg
).
toBe
(
"
密码错误
"
);
await
page
.
setData
({
"
username
"
:
"
数字天堂
"
,
"
password
"
:
"
222222
"
,
"
agree
"
:
true
,
})
await
page
.
callMethod
(
'
pwdLogin
'
)
break
;
case
10103
:
expect
(
resLogin
.
msg
).
toBe
(
"
密码错误次数过多
"
);
break
;
case
10002
:
expect
(
resLogin
.
msg
).
toBe
(
"
验证码不可为空
"
);
break
;
case
"
SYS_ERR
"
:
console
.
log
(
"
未知错误---SYS_ERR
"
,
resLogin
)
break
;
default
:
// console.log(await program.currentPage(),"22222222222");
break
;
}
})
})
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.test.js
已删除
100644 → 0
浏览文件 @
721bf925
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue
'
,
()
=>
{
let
page
,
abled
;
beforeAll
(
async
()
=>
{
try
{
page
=
await
program
.
navigateTo
(
'
/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve?phoneNumber=17769516019
'
)
await
page
.
waitFor
(
500
)
console
.
log
(
"
await program.pageStack():
"
,
await
program
.
pageStack
());
}
catch
(
e
)
{
console
.
log
(
"
e:
"
,
e
);
}
})
it
(
'
重置密码之前
'
,
async
()
=>
{
const
element
=
await
page
.
$
(
'
.send-btn-box
'
)
abled
=
await
element
.
attribute
(
'
disabled
'
)
await
page
.
setData
({
formData
:
{
"
phone
"
:
"
17769516019
"
,
'
code
'
:
'
123456
'
,
'
pwd
'
:
'
222222
'
,
'
pwd2
'
:
'
222222
'
,
}
})
});
it
(
'
重置密码
'
,
async
()
=>
{
if
(
abled
){
const
submitRes
=
await
page
.
callMethod
(
'
submit
'
)
console
.
log
(
"
submitRes:
"
,
submitRes
);
if
(
submitRes
)
{
switch
(
submitRes
.
code
)
{
case
0
:
console
.
log
(
"
密码重置成功
"
)
expect
(
submitRes
.
errCode
).
toBe
(
0
)
// expect(submitRes.errMsg).toBe('密码重置成功')
break
;
case
10202
:
expect
(
submitRes
.
errMsg
).
toBe
(
'
此账号尚未注册
'
)
break
;
case
50202
:
expect
(
submitRes
.
errCode
).
toBe
(
"
uni-id-invalid-verify-code
"
)
expect
(
submitRes
.
errMsg
).
toBe
(
"
短信验证码错误或已失效
"
)
console
.
log
(
"
process.env.UNI_PLATFORM
"
,
process
.
env
.
UNI_PLATFORM
)
break
;
default
:
break
;
}
}
else
{
console
.
log
(
"
err
"
)
}
}
})
})
pages/ucenter/login-page/register/register.test.js
已删除
100644 → 0
浏览文件 @
721bf925
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe
(
'
pages/ucenter/login-page/register/register.vue
'
,
()
=>
{
let
page
beforeAll
(
async
()
=>
{
page
=
await
program
.
redirectTo
(
'
/pages/ucenter/login-page/register/register
'
)
await
page
.
waitFor
(
500
)
console
.
log
(
"
program.pageStack:
"
,
await
program
.
pageStack
());
})
it
(
'
注册账号
'
,
async
()
=>
{
let
username
=
"
数字天堂
"
let
nickname
=
"
DCloud
"
let
password
=
"
111111
"
let
pwd2
=
"
111111
"
const
setInput
=
await
page
.
setData
({
formData
:
{
"
username
"
:
username
,
"
nickname
"
:
nickname
,
'
password
'
:
password
,
'
pwd2
'
:
pwd2
,
"
captcha
"
:
"
1234
"
},
})
console
.
log
(
await
page
.
data
(
'
formData
'
),
"
setData----formData
"
);
expect
(
username
).
toMatch
(
/^.
{3,20}
$/
);
expect
(
password
).
toMatch
(
/^.
{6,20}
$/
);
expect
(
pwd2
).
toMatch
(
/^.
{6,20}
$/
);
expect
(
pwd2
).
toEqual
(
password
);
await
page
.
setData
({
agree
:
true
})
const
resRegister
=
await
page
.
waitFor
(
async
()
=>
{
return
await
page
.
callMethod
(
'
submit
'
)
})
console
.
log
(
"
resRegister:
"
,
resRegister
);
switch
(
resRegister
.
code
){
case
0
:
console
.
log
(
'
注册成功
'
)
// expect(resRegister.userInfo.username).toBe("数字天堂");
// await program.navigateTo('/pages/ucenter/settings/settings')
break
;
case
20102
:
expect
(
resRegister
.
errMsg
).
toBe
(
"
此账号已注册
"
);
// expect(getUid.msg).toBe("此用户名已注册");
// expect(getUid.msg).toBe("Account exists");
// await program.navigateTo('/pages/ucenter/login-page/pwd-login/pwd-login')
break
;
default
:
break
;
}
})
})
uni_modules/uni-id-cf/changelog.md
已删除
100644 → 0
浏览文件 @
721bf925
## 1.0.15(2022-05-11)
-
loginBySms、bindMobileBySms新增防刷机制(当短信验证码输入错误2次以上,弹出图形验证码进行人机校验)
-
更改loginLog为uniIdLog 记录各类uni-id操作,并新增action字段记录操作的行为名称
-
register新增校验图形验证码逻辑
## 1.0.14(2022-01-26)
-
修复 uni-admin 的 'registerUser' 接口,注册用户含有多余字段 uid
## 1.0.13(2022-01-26)
-
新增逻辑:调用logout接口后刷新设备信息中token的有效期
## 1.0.12(2022-01-24)
-
优化设备信息存储逻辑
-
新增刷新设备信息token有效期的API
`renewDeviceTokenExpired`
## 1.0.11(2022-01-19)
-
新增 getNeedCaptcha 接口
-
优化 调整 login 接口的代码结构
## 1.0.10(2022-01-08)
-
修复 限制只有 admin 用户可管理用户标签(不支持非 admin 用户操作managerMultiTag 接口)
## 1.0.9(2021-12-01)
-
新增 uni-admin 用户标签管理接口 managerTags
## 1.0.8(2021-11-29)
新增
`closeAccount`
注销账号
## 1.0.7(2021-10-20)
新增bindMobileByMpWeixin,一键获取微信绑定的手机号
## 1.0.6(2021-09-23)
修复微信登录成功后没有添加日志的问题
## 1.0.5(2021-08-10)
-
修复登录成功后响应体包含userInfo.password的问题
-
新增微信登录成功后,自动获取用户的微信昵称和头像完善用户个人资料
## 1.0.4(2021-07-31)
-
修复 登录日志在登录失败时不写入记录的 bug
-
修复 写入记录登录是未传递 type 参数的 bug
## 1.0.3(2021-07-02)
-
框架设定非 admin 不能创建用户, 用户可自定义
## 1.0.2(2021-07-01)
-
发送短信验证码api,默认注释掉:虚拟发送短信验证码的代码块。
-
统一action名称为驼峰法
## 1.0.1(2021-06-28)
修复resetPwdBySmsCode接口,未注册过的用户也能调用的问题
## 1.0.0(2021-06-21)
1.
0.0版发布
\ No newline at end of file
uni_modules/uni-id-cf/package.json
已删除
100644 → 0
浏览文件 @
721bf925
{
"id"
:
"uni-id-cf"
,
"displayName"
:
"uni-id-cf"
,
"version"
:
"1.0.14"
,
"description"
:
"封装uni-id常用接口的云函数,快速实现简单、统一、可扩展的用户管理功能"
,
"keywords"
:
[
"uni-id-cf"
,
"uni-id的云函数"
],
"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"
:
""
},
"uni_modules"
:
{
"dependencies"
:
[
"uni-config-center"
,
"uni-captcha"
,
"uni-id"
],
"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"
}
}
}
}
}
uni_modules/uni-id-cf/readme.md
已删除
100644 → 0
浏览文件 @
721bf925
#### uni-id-cf是uni-id-uniCloudFunction的缩写。
#### 直接调用他内置的云函数,即可直接使用uni-id的各类api。
含:登录注册(含用户名密码登录、手机号验证码登录、app一键登录、微信登录、Apple登录、微信小程序登录)、修改密码、忘记密码、退出登录等
> 详细的使用方式见[uni-starter](https://ext.dcloud.net.cn/plugin?id=5057)
\ No newline at end of file
uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package-lock.json
已删除
100644 → 0
浏览文件 @
721bf925
{
"name"
:
"uni-id-cf"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
"uni-captcha"
:
{
"version"
:
"file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha"
},
"uni-config-center"
:
{
"version"
:
"file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"uni-id"
:
{
"version"
:
"file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id"
,
"requires"
:
{
"uni-config-center"
:
"file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"dependencies"
:
{
"uni-config-center"
:
{
"version"
:
"file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录