0
Follow
0
View

Wechat cloud development transfer value judgment problem

dutefei 注册会员
2023-02-28 00:17

This is indeed a unique query condition of the user account, obviously not good, the wechat cloud development interface is even if can not find will return a length of 0 array,

csby2011 注册会员
2023-02-28 00:17

Debugging based on Monster groups and GPTS:
Errors in this code may be related to the results of database queries, especially if no errors are reported between accounts.

The query condition in the

code is:

db.collection('userAccounts').where({
    user: vm.login.userInfo.user
}).get({
    ...
})


This means that the query succeeds and results are returned only if the user account entered matches the user account in the database.

Therefore, if two different accounts have the same user account, this code may cause an error. Because whichever account queries will return the first result that matches that user's account, regardless of which account it actually belongs to. This can cause the code to produce inconsistent results across different accounts, as they may use the wrong password to authenticate the user.

To solve this problem, you can use more unique query criteria, such as user account and user ID. This ensures that the query results belong only to that user and avoids confusion with results from other accounts.

About the Author

Question Info

Publish Time
2023-02-28 00:17
Update Time
2023-02-28 00:17

Related Question

用了unicloud开发平台可以在小程序里设置后台吗?

在IDELL Shell 3.11上运行wordcloud是出现问题

将pcd文件转换为pointcloud2

Azure数据执行失败- CLOUD_PROVIDER_LAUNCH_FAILURE

这样算是下载好python的wordcloud库了吗?

当连接到Cloud时使用net/rpc

Cloudfront缓存行为通配符

在Autodesk Construction Cloud中使用Forge获取默认属性“Description”的值

cloudsim判断虚拟机何时迁移

Oracle Cloud: Permission denied(publickey, gsapi -keyex, gsapi -with-mic)