|
@@ -170,7 +170,7 @@ export default {
|
|
|
var self = this
|
|
var self = this
|
|
|
return (this.members || []).filter(function(m) {
|
|
return (this.members || []).filter(function(m) {
|
|
|
var isSelf = m.isSelf === true
|
|
var isSelf = m.isSelf === true
|
|
|
- if (!isSelf && m.userId && m.userId === self.userId) {
|
|
|
|
|
|
|
+ if (!isSelf && m.userId && String(m.userId) === String(self.userId)) {
|
|
|
isSelf = true
|
|
isSelf = true
|
|
|
}
|
|
}
|
|
|
return !isSelf
|
|
return !isSelf
|
|
@@ -281,7 +281,8 @@ export default {
|
|
|
this.familyId = data.familyId
|
|
this.familyId = data.familyId
|
|
|
this.familyName = data.familyName
|
|
this.familyName = data.familyName
|
|
|
this.creatorId = data.creatorId
|
|
this.creatorId = data.creatorId
|
|
|
- this.isAdmin = this.creatorId === this.userId
|
|
|
|
|
|
|
+ // creatorId 来自后端 JSON(数字),userId 来自 storage(可能为字符串),用 String 归一避免 === 恒 false 导致管理员按钮不显示
|
|
|
|
|
+ this.isAdmin = String(this.creatorId) === String(this.userId)
|
|
|
var arr = data.members
|
|
var arr = data.members
|
|
|
if (!(arr instanceof Array)) {
|
|
if (!(arr instanceof Array)) {
|
|
|
// 后端旧版本未返回 members 字段时的兼容:补一次无参请求
|
|
// 后端旧版本未返回 members 字段时的兼容:补一次无参请求
|