# ks.addCommonUse

支持用户在游戏内将小游戏设为常用

请求 object

字段名 类型 描述 values
success function 接口调用成功的回调函数
fail function 接口调用失败的回调函数
complete function 接口调用结束的回调函数(调用成功、失败都会执行)

回调成功

字段名 类型 描述 values
code int 1 表示成功
msg string "addCommonUse:ok"

回调失败

字段名 类型 描述 values
code int 异常错误码
msg string "addCommonUse:fail"

example

ks.addCommonUse({
  success() {
    console.log("设为常用成功");
  },
  fail(err) {
    if (err.code === -10005) {
        console.log("暂不支持该功能");
    } else {
        console.log("设为常用失败", err.msg);
    }
  },
});