Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
萌新之路
uni-starter
提交
68317205
U
uni-starter
项目概览
萌新之路
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
68317205
编写于
4月 22, 2021
作者:
芊
芊里
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户信息丢失
上级
81133883
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
24 deletion
+13
-24
pages/ucenter/ucenter.vue
pages/ucenter/ucenter.vue
+2
-17
uni_modules/uni-id-users/pages/uni-id-users/edit.vue
uni_modules/uni-id-users/pages/uni-id-users/edit.vue
+11
-7
未找到文件。
pages/ucenter/ucenter.vue
浏览文件 @
68317205
...
@@ -110,9 +110,6 @@
...
@@ -110,9 +110,6 @@
// #endif
// #endif
},
},
methods
:
{
methods
:
{
...
mapMutations
({
logout
:
'
user/logout
'
}),
toSettings
()
{
toSettings
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"
/pages/ucenter/settings/settings
"
url
:
"
/pages/ucenter/settings/settings
"
...
@@ -130,20 +127,8 @@
...
@@ -130,20 +127,8 @@
console
.
log
(
await
callCheckVersion
());
console
.
log
(
await
callCheckVersion
());
checkUpdate
()
checkUpdate
()
},
},
goLogin
()
{
tapGrid
(
index
)
{
if
(
!
this
.
login
)
{
console
.
log
(
this
.
userInfo
);
console
.
log
(
'
点击前往登录
'
);
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-login-page/pages/index/index
'
});
}
else
{
console
.
log
(
'
点击编辑信息
'
);
uni
.
navigateTo
({
url
:
'
./edit/edit
'
})
}
},
tapGrid
(
index
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'
你点击了,第
'
+
(
index
+
1
)
+
'
个
'
,
title
:
'
你点击了,第
'
+
(
index
+
1
)
+
'
个
'
,
icon
:
'
none
'
icon
:
'
none
'
...
...
uni_modules/uni-id-users/pages/uni-id-users/edit.vue
浏览文件 @
68317205
<
template
>
<
template
>
<view
class=
"uni-container"
>
<view
class=
"uni-container"
>
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
validate-trigger=
"submit"
err-show-type=
"toast"
>
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
validate-trigger=
"submit"
err-show-type=
"toast"
>
<uni-
list-item
>
<uni-
forms-item
name=
"avatar"
>
<template
v-slot:body
>
<template>
<view
class=
"avatar-box"
>
<view
class=
"avatar-box"
>
<image
class=
"avatar-img"
:src=
"formData.avatar || '/static/uni-center/logo.png'"
@
click=
"chooseImg"
mode=
"aspectFill"
></image>
<image
class=
"avatar-img"
:src=
"formData.avatar || '/static/uni-center/logo.png'"
@
click=
"chooseImg"
mode=
"aspectFill"
></image>
</view>
</view>
</
template
>
</
template
>
</uni-
list
-item>
</uni-
forms
-item>
<uni-forms-item
name=
"gender"
label=
"性别"
required
>
<uni-forms-item
name=
"gender"
label=
"性别"
required
>
<uni-data-checkbox
v-model=
"formData.gender"
:localdata=
"formOptions.gender_localdata"
/>
<uni-data-checkbox
v-model=
"formData.gender"
:localdata=
"formOptions.gender_localdata"
/>
</uni-forms-item>
</uni-forms-item>
...
@@ -29,7 +29,8 @@
...
@@ -29,7 +29,8 @@
validator
validator
}
from
'
../../js_sdk/validator/uni-id-users.js
'
;
}
from
'
../../js_sdk/validator/uni-id-users.js
'
;
import
{
import
{
mapMutations
mapMutations
,
mapGetters
}
from
'
vuex
'
;
}
from
'
vuex
'
;
const
db
=
uniCloud
.
database
();
const
db
=
uniCloud
.
database
();
const
dbCollectionName
=
'
uni-id-users
'
;
const
dbCollectionName
=
'
uni-id-users
'
;
...
@@ -71,10 +72,14 @@
...
@@ -71,10 +72,14 @@
...
getValidator
([
"
avatar
"
,
"
gender
"
,
"
nickname
"
])
...
getValidator
([
"
avatar
"
,
"
gender
"
,
"
nickname
"
])
}
}
}
}
},
computed
:{
...
mapGetters
({
userInfo
:
'
user/info
'
})
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
let
id
=
"
60795c140983f8000192f235
"
;
let
id
=
uni
.
getStorageSync
(
'
uni_id_uid
'
)
||
this
.
userInfo
.
_id
;
id
=
uni
.
getStorageSync
(
'
uni_id_uid
'
);
this
.
formDataId
=
id
this
.
formDataId
=
id
this
.
getDetail
(
id
)
this
.
getDetail
(
id
)
},
},
...
@@ -138,7 +143,6 @@
...
@@ -138,7 +143,6 @@
title
:
'
修改成功
'
title
:
'
修改成功
'
})
})
this
.
setUserInfo
(
value
);
this
.
setUserInfo
(
value
);
// this.getOpenerEventChannel().emit('refreshData')
setTimeout
(()
=>
uni
.
navigateBack
(),
500
)
setTimeout
(()
=>
uni
.
navigateBack
(),
500
)
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
uni
.
showModal
({
uni
.
showModal
({
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录