检测小程序接口文档

1. 注册接口

POST http://check.lokimo.xyz/api/account/register

请求参数

参数名类型说明
mobilestring手机号
passwordstring密码(需包含字母、数字、符号等,6~20位)
password_confirmstring确认密码,需与 password 一致
clientint客户端:1-小程序,2-H5/公众号,3-iOS,4-Android,5-PC,6-H5;不传默认小程序
birthdaystring生日,格式 Y-m-d,如 1990-06-26
sexint性别:0-未知,1-男,2-女
heightint身高,单位 cm,范围 1~300
weightfloat体重,单位 kg,范围 1~500
occupationstring职业,最长 64 字符

请求入参 demo

{
  "mobile": "13800138000",
  "password": "Abc123!@#",
  "password_confirm": "Abc123!@#",
  "birthday": "1990-06-26",
  "sex": 1,
  "height": 175,
  "weight": 65.5,
  "occupation": "软件工程师",
  "client":1
}

响应示例

{
  "code": 1,
  "msg": "注册成功",
  "data": "登录令牌 token 字符串",
  "show": 0,
  "time": "0.125048"
}

2. 账号密码登录接口

POST http://check.lokimo.xyz/api/account/login

请求参数

参数名类型说明
accountstring账号或手机号
passwordstring密码
clientint客户端类型:2-H5/公众号,3-iOS,4-Android,5-PC,6-H5

请求入参 demo

{
  "account": "13800138000",
  "password": "Abc123!@#",
  "client": 6
}

响应示例

{
  "code": 1,
  "msg": "登录成功",
  "data": {
    "token": "登录令牌",
    "nickname": "用户昵称",
    "avatar": "头像 URL",
    "level": 0
  },
  "show": 0,
  "time": "0.775400"
}

3. 微信小程序登录接口

POST http://check.lokimo.xyz/api/account/mnplogin

请求参数

参数名类型说明
codestring小程序 wx.login 返回的 code

请求入参 demo

{
  "code": "081aBcDe0xYz1234yZAbCdE5xYz12"
}

响应示例

{
  "code": 1,
  "msg": "登录成功",
  "data": {
    "token": "登录令牌",
    "nickname": "用户昵称",
    "avatar": "头像 URL",
    "level": 0
  },
  "show": 0,
  "time": "0.775400"
}

4. 首页接口

GET http://check.lokimo.xyz/api/index/home

请求参数

参数名类型说明
tokenstring选填,请求头携带,登录后可返回当日打卡状态

返回参数(data)

参数名类型说明
adsarray广告列表,每项含 title、image
ads[].titlestring广告标题
ads[].imagestring广告图 URL
time_displayobject时间展示(公历、农历、节气、子午流注)
time_display.lunar_textstring农历文案,如「蛇年 · 农历 腊月 初二 大寒」
time_display.ziwuobject子午流注
time_display.ziwu.shichenstring时辰,如「午时」
time_display.ziwu.jingluostring经络,如「心经」
time_display.gregorianstring公历文案,如「2026年1月28日 星期三」
today_signint当日是否已打卡:0-未打卡,1-已打卡(需传 token)

响应示例

{
  "code": 1,
  "msg": "",
  "data": {
    "ads": [
      { "title": "首页轮播1", "image": "http://check.lokimo.xyz/uploads/images/xxx.jpg" }
    ],
    "time_display": {
      "lunar_text": "蛇年 · 农历 腊月 初二 大寒",
      "ziwu": { "shichen": "午时", "jingluo": "心经" },
      "gregorian": "2026年1月28日 星期三"
    },
    "today_sign": 0
  },
  "show": 0,
  "time": "0.052341"
}

5. 个人中心接口

GET http://check.lokimo.xyz/api/user/center

请求参数

参数名类型说明
tokenstring必填,请求头携带

返回参数(data)

参数名类型说明
idint用户 id
nicknamestring昵称
snstring用户编号(UID)
avatarstring头像 URL
mobilestring手机号
birthdaystring生日,格式 Y-m-d H:i:s,未设置为空
birthday_profileobject生日档案(有生日时有值,否则为空对象)
birthday_profile.birthday_gregorianstring公历生日,如 1982-05-14
birthday_profile.birthday_lunarstring农历生日(含干支年),如 1982年(壬戌年)四月廿一
birthday_profile.ageint周岁年龄
birthday_profile.zodiac_cnstring生肖,如 属狗
birthday_profile.constellationstring星座,如 金牛座
constellation_todayobject星座今日指数(有生日且星座有效时有值,按星座缓存 1 天)
constellation_today.allstring综合指数
constellation_today.lovestring爱情指数
constellation_today.moneystring财运指数
constellation_today.workstring工作指数
constellation_today.healthstring健康指数
constellation_today.colorstring幸运色
constellation_today.numberint幸运数字
constellation_today.QFriendstring速配星座
constellation_today.summarystring今日概述
hasPayPasswordint是否设置支付密码:0-否,1-是
next_level_tipsstring下一等级提示文案
user_moneystring用户余额
total_order_amountstring累计消费
total_recharge_amountstring累计充值
couponint优惠券数量
user_integralint积分
levelint等级
wait_payint待支付订单数
wait_takeint待收货订单数
wait_deliveryint待发货订单数
wait_commentint待评论数
after_saleint售后中数量
distribution_settingint分销开关
distribution_codestring分销邀请码
notice_numint未读消息数
is_new_userint是否新用户

响应示例

{
  "code": 1,
  "msg": "获取成功",
  "data": {
    "id": 1,
    "nickname": "魏文",
    "sn": "174034770",
    "avatar": "http://xxx/avatar.jpg",
    "mobile": "138****8000",
    "birthday": "1982-05-14 00:00:00",
    "birthday_profile": {
      "birthday_gregorian": "1982-05-14",
      "birthday_lunar": "1982年(壬戌年)四月廿一",
      "age": 43,
      "zodiac_cn": "属狗",
      "constellation": "金牛座"
    },
    "constellation_today": {
      "all": "89",
      "love": "80",
      "money": "84",
      "work": "80",
      "health": "95",
      "color": "古铜色",
      "number": 8,
      "QFriend": "处女座",
      "summary": "有些思考的小漩涡,可能让你忽然的放空..."
    },
    "hasPayPassword": 1,
    "next_level_tips": "",
    "user_money": "0.00",
    "total_order_amount": "0.00",
    "total_recharge_amount": "0.00",
    "coupon": 0,
    "user_integral": 0,
    "level": 0,
    "wait_pay": 0,
    "wait_take": 0,
    "wait_delivery": 0,
    "wait_comment": 0,
    "after_sale": 0,
    "distribution_setting": 1,
    "distribution_code": "xxx",
    "notice_num": 0,
    "is_new_user": 0
  },
  "show": 0,
  "time": "0.052341"
}

6. 获取进度数据(需登录)

GET http://check.lokimo.xyz/api/progress/detail

请求参数

参数名类型说明
typestringlife-人生进度,time-时间进度,默认 life
dimensionstring仅 type=time 时有效:day-年月日,month-年月,year-年,默认 day

返回参数(data,type=life 人生进度时)

参数名类型说明
typestring固定 "life"
percentnumber人生进度百分比(0~100)
life_monthsint人均寿命月数,900(75岁)
lived_monthsint已度过月数(从生日至今)
birthday_textstring文案,如「1982年5月至今 525个月」或「请设置生日」
birthdaystring生日展示,如「1982年5月」,未设置为空
birthday_ymdstring生日日期 Y-m-d,如「1990-06-26」,未设置为空(用于换日期回显)
has_birthdayboolean是否已设置生日
life_descstring人均寿命说明,如「中国现阶段人均寿命 900个月 (75岁)」

人生进度返回示例

{
  "type": "life",
  "percent": 41.67,
  "life_months": 900,
  "lived_months": 375,
  "birthday_text": "1982年5月至今 525个月",
  "birthday": "1982年5月",
  "birthday_ymd": "1982-05-01",
  "has_birthday": true,
  "life_desc": "中国现阶段人均寿命 900个月 (75岁)"
}

返回参数(data,type=time 时间进度)

参数名类型说明
typestring固定 "time"
percentnumber当前维度进度百分比(0~100)
dimensionstring维度:day-年月日,month-年月,year-年
date_textstring日期文案,如「2026年1月20日」「2026年1月」「2026年」
totalnumber维度总量:day 为 24(小时),month 为当月天数,year 为 12(月)
currentnumber当前进度值(与 total 同单位)
dimensionsarray可切换的维度列表
dimensions[].keystring维度 key:day / month / year
dimensions[].namestring维度名称:年月日 / 年月 / 年

时间进度返回示例

{
  "type": "time",
  "percent": 51.9149,
  "dimension": "day",
  "date_text": "2026年1月20日",
  "total": 24,
  "current": 12.46,
  "dimensions": [
    { "key": "day", "name": "年月日" },
    { "key": "month", "name": "年月" },
    { "key": "year", "name": "年" }
  ]
}

7. 设置/修改生日(需登录)

POST http://check.lokimo.xyz/api/progress/setBirthday

请求参数

参数名类型说明
birthdaystring格式 Y-m-d,如 1990-06-26,不能晚于今天

请求入参 demo

{
  "birthday": "1990-06-26"
}

8. 清除生日(需登录)

POST http://check.lokimo.xyz/api/progress/clearBirthday

9. 获取档案详情(编辑回显)

GET http://check.lokimo.xyz/api/user/getProfile

返回参数(data)

参数名类型说明
idint用户 id
nicknamestring昵称
sexint性别:0-未知,1-男,2-女
group_idint分类(关联用户 id)
birthdaystring出生日期,格式 Y-m-d H:i
birth_timezonestring出生时区
birth_placestring出生地(省,市,区县)
birth_place_lngfloat出生地经度
birth_place_latfloat出生地纬度
current_residencestring现居地(省,市,区县)
current_residence_lngfloat现居地经度
current_residence_latfloat现居地纬度
remarksstring备注
keywordsstring关键词

响应示例

{
  "code": 1,
  "msg": "获取成功",
  "data": {
    "id": 1,
    "nickname": "魏",
    "sex": 1,
    "group_id": 1,
    "birthday": "1982-05-14 06:30",
    "birth_timezone": "东8区",
    "birth_place": "内蒙古,通辽,奈曼旗",
    "birth_place_lng": 120.67,
    "birth_place_lat": 42.85,
    "current_residence": "黑龙江,哈尔滨,南岗",
    "current_residence_lng": 126.67,
    "current_residence_lat": 45.77,
    "remarks": "",
    "keywords": ""
  },
  "show": 0,
  "time": "0.032156"
}

10. 完善/保存档案

POST http://check.lokimo.xyz/api/user/completeProfile

请求参数

参数名类型说明
nicknamestring必填,昵称 1-32 字符
sexint必填,性别:0-未知,1-男,2-女
group_idint选填,分类(来自 categoryList 的 id)
birthdaystring/int必填,出生日期,支持时间戳或 Y-m-d / Y-m-d H:i
birth_timezonestring选填,出生时区
birth_placestring选填,出生地(省,市,区县)
birth_place_lngfloat选填,出生地经度
birth_place_latfloat选填,出生地纬度
current_residencestring选填,现居地(省,市,区县)
current_residence_lngfloat选填,现居地经度
current_residence_latfloat选填,现居地纬度
remarksstring选填,备注 0-500 字
keywordsstring选填,关键词 0-80 字

请求入参 demo

{
  "nickname": "魏",
  "sex": 1,
  "group_id": 1,
  "birthday": "1982-05-14 06:30",
  "birth_timezone": "东8区",
  "birth_place": "内蒙古,通辽,奈曼旗",
  "birth_place_lng": 120.67,
  "birth_place_lat": 42.85,
  "current_residence": "黑龙江,哈尔滨,南岗",
  "current_residence_lng": 126.67,
  "current_residence_lat": 45.77,
  "remarks": "",
  "keywords": ""
}

11. 时区列表(出生时区下拉)

GET http://check.lokimo.xyz/api/user/timezoneList

返回参数(data)

参数名类型说明
data[]array时区列表,东12区~东1区、东0区、西1区~西12区
data[].valuestring时区值,如「东8区」
data[].labelstring时区显示文案,如「东8区」

响应示例

{
  "code": 1,
  "msg": "获取成功",
  "data": [
    { "value": "东8区", "label": "东8区" },
    { "value": "东7区", "label": "东7区" },
    { "value": "东0区", "label": "东0区" },
    { "value": "西1区", "label": "西1区" }
  ],
  "show": 0,
  "time": "0.021045"
}

12. 分类列表(档案分类下拉)

GET http://check.lokimo.xyz/api/user/categoryList

返回参数(data)

参数名类型说明
data[]array用户列表
data[].idint用户 id,保存档案时作为 group_id 传入
data[].nicknamestring昵称
data[].is_selfint是否当前用户:0-否,1-是(可显示为「自己」)

响应示例

{
  "code": 1,
  "msg": "获取成功",
  "data": [
    { "id": 1, "nickname": "魏", "is_self": 1 },
    { "id": 5, "nickname": "张三", "is_self": 0 }
  ],
  "show": 0,
  "time": "0.031256"
}

13. 邀请(需登录)

POST http://check.lokimo.xyz/api/user_relation/invite

请求参数

参数名类型说明
mobilestring对方手机号

请求入参 demo

{
  "mobile": "13800138001"
}

响应示例

{
  "code": 1,
  "msg": "邀请成功",
  "data": [],
  "show": 0,
  "time": "0.032156"
}

14. 关系列表(需登录)

GET http://check.lokimo.xyz/api/user_relation/relationList

请求参数

参数名类型说明
tokenstring必填,请求头携带
page_noint页码,默认 1
page_sizeint每页条数,默认 15

返回参数(data)

参数名类型说明
listsarray关系列表
lists[].idint关系记录 id
lists[].uidint发起人 uid
lists[].to_uidint接收人 uid
lists[].nicknamestring对方昵称(关联 ls_user)
lists[].statusint0-待确认 1-已确认
lists[].status_textstring待确认 / 已关联
lists[].is_inviterint是否本人发起:0-否 1-是
lists[].create_timestring创建时间
countint总条数

响应示例

{
  "code": 1,
  "msg": "",
  "data": {
    "lists": [
      {
        "id": 1,
        "uid": 1,
        "to_uid": 2,
        "nickname": "张三",
        "status": 0,
        "status_text": "待确认",
        "is_inviter": 1,
        "create_time": "2026-02-10 12:00:00"
      }
    ],
    "count": 1
  },
  "show": 0,
  "time": "0.028341"
}

15. 确认/拒绝(需登录)

POST http://check.lokimo.xyz/api/user_relation/confirm

请求参数

参数名类型说明
idint关系记录 id(来自关系列表)
statusint1-确认(更新为已关联) 2-拒绝(删除该条)

请求入参 demo

{
  "id": 1,
  "status": 1
}

响应示例

{
  "code": 1,
  "msg": "已确认",
  "data": [],
  "show": 0,
  "time": "0.021045"
}