Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦想橡皮擦
uni-starter
提交
fa9a5e40
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看板
提交
fa9a5e40
编写于
5月 28, 2021
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复拦截器在ios app端会报错:Unhandled promise...的问题
上级
2f4c9be8
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
161 addition
and
133 deletion
+161
-133
changelog.md
changelog.md
+4
-0
common/appInit.js
common/appInit.js
+3
-1
components/uni-quick-login/uni-quick-login.vue
components/uni-quick-login/uni-quick-login.vue
+1
-1
package.json
package.json
+2
-2
pages/ucenter/userinfo/userinfo.vue
pages/ucenter/userinfo/userinfo.vue
+38
-27
uniCloud-aliyun/database/uni-id-users.schema.json
uniCloud-aliyun/database/uni-id-users.schema.json
+5
-0
uni_modules/uni-file-picker/changelog.md
uni_modules/uni-file-picker/changelog.md
+11
-9
uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
...ile-picker/components/uni-file-picker/uni-file-picker.vue
+9
-10
uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
...ni-file-picker/components/uni-file-picker/upload-file.vue
+1
-1
uni_modules/uni-file-picker/package.json
uni_modules/uni-file-picker/package.json
+82
-82
uni_modules/uni-file-picker/readme.md
uni_modules/uni-file-picker/readme.md
+5
-0
未找到文件。
changelog.md
浏览文件 @
fa9a5e40
## 1.0.12(2021-05-28)
修复拦截器在ios app端会报错:Unhandled promise...的问题
## 1.0.10(2021-05-27)
新增callfunction的拦截器废除this.request的写法。为callFunction添加:请求失败是否断网判断并提示、恢复网络自动重新执行、自动处理响应体,目前处理了403为token过期自动跳转到登陆页面,今后会添加更多的自动行为、自动延续token过期时间
## 1.0.9(2021-05-23)
修复变量被重复定义的问题
## 1.0.8(2021-05-22)
...
...
common/appInit.js
浏览文件 @
fa9a5e40
...
...
@@ -155,6 +155,7 @@ export default function() {
list
.
forEach
(
item
=>
{
//用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器
uni
.
addInterceptor
(
item
,
{
invoke
(
e
)
{
// 调用前拦截
console
.
log
(
e
);
//获取用户的token
const
token
=
uni
.
getStorageSync
(
'
uni_id_token
'
)
//获取当前页面路径(即url去掉"?"和"?"后的参数)
...
...
@@ -180,9 +181,10 @@ export default function() {
title
:
'
请先登录
'
,
icon
:
'
none
'
})
return
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"
/pages/ucenter/login-page/index/index
"
})
return
false
}
}
},
...
...
components/uni-quick-login/uni-quick-login.vue
浏览文件 @
fa9a5e40
...
...
@@ -119,7 +119,7 @@
oauthServices
.
forEach
(({
id
})
=>
{
console
.
log
(
9527
,
id
);
//
console.log(9527,id);
if
(
this
.
config
[
id
].
isChecked
&&
this
.
loginConfig
.
includes
(
id
))
{
this
.
servicesList
.
push
({
...
this
.
config
[
id
],
...
...
package.json
浏览文件 @
fa9a5e40
{
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"1.0.
9
"
,
"version"
:
"1.0.
12
"
,
"description"
:
"云端一体应用快速开发模版"
,
"keywords"
:
[
"uni-starter"
,
...
...
@@ -12,7 +12,7 @@
],
"repository"
:
"https://codechina.csdn.net/dcloud/uni-starter.git"
,
"engines"
:
{
"HBuilderX"
:
"^3.1.1
4
"
"HBuilderX"
:
"^3.1.1
6
"
},
"dcloudext"
:
{
"category"
:
[
...
...
pages/ucenter/userinfo/userinfo.vue
浏览文件 @
fa9a5e40
<
template
>
<view>
<uni-list>
<uni-list-item
class=
"item"
@
click=
"setAvatar"
link
>
<uni-list-item
class=
"item"
link
>
<view
slot=
"body"
class=
"item"
>
<text>
头像
</text>
<image
class=
"avatarUrl"
:src=
"userInfo.avatar||nullAvatarUrl"
mode=
"widthFix"
></image>
<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>
-->
</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>
...
...
@@ -52,7 +58,7 @@
uni
.
preLogin
({
provider
:
'
univerify
'
,
success
:
this
.
univerify
(),
//预登录成功
fail
:
(
res
)
=>
{
// 预登录失败
fail
:
(
res
)
=>
{
// 预登录失败
// 不显示一键登录选项(或置灰)
console
.
log
(
res
)
this
.
bindMobileBySmsCode
()
...
...
@@ -90,17 +96,21 @@
// }
// )
uniCloud
.
callFunction
({
name
:
'
uni-id-cf
'
,
data
:
{
action
:
'
bind_mobile_by_univerify
'
,
params
:
e
.
authResult
,
name
:
'
uni-id-cf
'
,
data
:
{
action
:
'
bind_mobile_by_univerify
'
,
params
:
e
.
authResult
,
},
success
:
({
result
})
=>
{
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
,
...
...
@@ -114,7 +124,7 @@
},
fail
:
(
err
)
=>
{
console
.
log
(
err
);
if
(
err
.
code
==
'
30002
'
)
{
if
(
err
.
code
==
'
30002
'
)
{
this
.
bindMobileBySmsCode
()
}
}
...
...
@@ -122,11 +132,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
...
...
@@ -209,6 +219,7 @@
justify-content
:
space-between
;
align-items
:
center
;
}
.avatarUrl
{
width
:
50px
;
height
:
50px
;
...
...
uniCloud-aliyun/database/uni-id-users.schema.json
浏览文件 @
fa9a5e40
...
...
@@ -24,6 +24,11 @@
"title"
:
"头像地址"
,
"trim"
:
"both"
},
"avatar_file"
:
{
"bsonType"
:
"file"
,
"title"
:
"头像文件"
,
"description"
:
"用file类型方便使用uni-file-picker组件"
},
"comment"
:
{
"bsonType"
:
"string"
,
"description"
:
"备注"
,
...
...
uni_modules/uni-file-picker/changelog.md
浏览文件 @
fa9a5e40
## 0.0.7(2021-05-12)
-
新增 组件示例地址
## 0.0.6(2021-04-09)
-
修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
## 0.0.5(2021-04-09)
...
...
uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
浏览文件 @
fa9a5e40
...
...
@@ -40,10 +40,14 @@
</
template
>
<
script
>
import
{
chooseAndUploadFile
}
from
'
./choose-and-upload-file.js
'
import
uploadImage
from
'
./upload-image.vue
'
import
uploadFile
from
'
./upload-file.vue
'
let
fileInput
=
null
/**
* FilePicker
* FilePicker
文件选择上传
* @description 文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间
* @tutorial https://ext.dcloud.net.cn/plugin?id=
-1
* @tutorial https://ext.dcloud.net.cn/plugin?id=
4079
* @property {Object|Array} value 组件数据,通常用来回显 ,类型由return-type属性决定
* @property {Boolean} disabled=[true|false] 组件禁用
* @value true 禁用
...
...
@@ -81,11 +85,6 @@
* @event {Function} fail 上传失败触发
* @event {Function} delete 文件从列表移除时触发
*/
import
{
chooseAndUploadFile
}
from
'
./choose-and-upload-file.js
'
import
uploadImage
from
'
./upload-image.vue
'
import
uploadFile
from
'
./upload-file.vue
'
let
fileInput
=
null
export
default
{
name
:
'
uniFilePicker
'
,
components
:
{
...
...
uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue
浏览文件 @
fa9a5e40
...
...
@@ -234,7 +234,7 @@
margin-right
:
25px
;
/* #ifndef APP-NVUE */
word-break
:
break-all
;
word-wrap
:
break-word
word-wrap
:
break-word
;
/* #endif */
}
...
...
uni_modules/uni-file-picker/package.json
浏览文件 @
fa9a5e40
{
"id"
:
"uni-file-picker"
,
"displayName"
:
"
FilePicker 文件选择上传"
,
"version"
:
"0.0.
6"
,
"displayName"
:
"
uni-file-picker 文件选择上传"
,
"version"
:
"0.0.
7"
,
"description"
:
"文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间"
,
"keywords"
:
[
"uni-ui"
,
"uniui"
,
"图片上传"
,
"文件上传"
,
"uni-file-picker"
"文件上传"
],
"repository"
:
"https://github.com/dcloudio/uni-ui"
,
"engines"
:
{
...
...
uni_modules/uni-file-picker/readme.md
浏览文件 @
fa9a5e40
...
...
@@ -294,3 +294,8 @@ export default {
</uni-file-picker>
```
## 组件示例
点击查看:
[
https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker
](
https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker
)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录