# 云函数查询当前登录用户信息

# 简要描述

  • 云函数查询当前登录用户信息
  • 注意:该接口需要请求头传入 apiUserToken,用于获取当前用户信息

# 方法名称

potato.findCurrentUserInfo()
1

# 参数说明

无参数

# 调用实例

// 获取当前登录用户信息
var res = potato.findCurrentUserInfo();
console.log("用户信息:", res);
return res;
1
2
3
4

# 返回示例

{
    "id": "1050211863321223168",
    "createdDate": "2025-02-14 10:53:50",
    "modifiedDate": "2025-02-14 10:53:50",
    "status": 1,
    "ip": "127.0.0.1",
    "userNumber": "1234",
    "balance": 0,
    "appId": "998434085727113216",
    "managementId": "698119193918787584",
    "vipState": 0,
    "integral": 0,
    "state": 1,
    "userName": "1234",
    "registerFrom": 1
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# 返回参数说明

参数 类型 说明
id String 用户ID
createdDate String 创建时间
modifiedDate String 修改时间
status Integer 状态
ip String 最后登录IP
userNumber String 用户账号
balance Double 余额
appId String 当前应用ID
managementId String 商户ID
vipState Integer 会员状态
integral Integer 积分数量
state Integer 状态:0禁用,1正常
userName String 用户名称
registerFrom Integer 注册来源

# API调用参数

参数 必选 类型 说明
name 是 String 函数名称
params 否 Object 调用参数

# API调用请求头

参数 必选 类型 说明
Content-Type 是 String application/json
askKey 是 String 验证app的令牌
apiUserToken 是 String 用户令牌(必传)
sign 否 String 开启验签时必传
time 否 String 开启验签时必传
nonce 否 String 开启V3验签必传

# API返回示例

{
    "code": "200",
    "message": "",
    "status": true,
    "data": {
        "id": "1050211863321223168",
        "userName": "1234",
        "balance": 0,
        "vipState": 0
    },
    "pc": null,
    "time": null,
    "nonce": null,
    "sign": null,
    "reqSign": null
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# 异常处理

try {
    var userInfo = potato.findCurrentUserInfo();
    console.log("用户名:", userInfo.userName);
    console.log("余额:", userInfo.balance);
} catch (e) {
    console.error("获取用户信息失败:", e.message);
}
1
2
3
4
5
6
7

# 备注

lastUpdate: 8/18/2026, 9:57:51 PM