5***@qq.com
5***@qq.com
  • 发布:2022-07-07 16:42
  • 更新:2023-01-10 13:52
  • 阅读:2902

未能获取当前用户信息:当前用户为匿名身份

分类:uniCloud

报错代码:

<scroll-view scroll-y="true" class="scroll-right">  
        <unicloud-db v-slot:default="{data, loading, error, options}" collection="opendb-mall-goods">  
            <view v-if="error">{{error.message}}</view>  
            <view v-else>qq  
            </view>  
        </unicloud-db>  
    </scroll-view>

成功代码:

<unicloud-db v-slot:default="{data, loading, error, options}" collection="opendb-mall-categories"  
            :where="categoriesWhere" orderby="is_hot_show desc" @load="handleLoad">  
            <view v-if="error">{{error.message}}</view>  
            <view v-else class="categories" :class="{'activity': activity==index}" v-for="(menu,index) in list"  
                @click="handlerClickMenu(menu, index)">  
                <uni-icons v-if="menu.is_hot_show" color="$uni-primary" type="fire-filled"></uni-icons>  
                {{menu.name}}  
            </view>  
        </unicloud-db>

在获取opendb-mall-goods表信息时提示:未能获取当前用户信息:当前用户为匿名身份。
但获取opendb-mall-categories表成功,两者的度权限全部为true,请问下,哪个知道为啥会报错???在云对象中调用可以正常返回数据。

2022-07-07 16:42 负责人:DCloud_uniAD_HDX 分享
已邀请:
5***@qq.com

5***@qq.com (作者)

项目本地的permission下的read也是true

DCloud_uniAD_HDX

DCloud_uniAD_HDX

  1. 如果不指定字段名,默认会查询所有字段
  2. 检查字段 seller_note 的读取权限是否为 false, 字段的权限优先级高于表
"seller_note": {  
    "bsonType": "string",  
    "description": "商家备注,仅商家可见",  
    "trim": "both",  
    "permission": {  
        "read": false  
    }  
}
1***@qq.com

1***@qq.com

跟我一样问题, 商家备注权限改了还是不行

a***@aluo.cn

a***@aluo.cn

也遇到了类似问题,全为true 还是不行!

5***@qq.com

5***@qq.com

"permission": {
"read": "auth.uid == null",
"create": true,

read验证添加uid为空,匿名也可以获取。

  • b***@sina.com

    这个有用,非常感谢! 感谢对uniapp生态圈的奉献!

    2023-06-30 13:58

2***@qq.com

2***@qq.com

右键上传DB schema

要回复问题请先登录注册