Files
im/api/login.js
T

117 lines
2.6 KiB
JavaScript
Raw Normal View History

2025-11-07 09:56:20 +08:00
// 登录
2025-11-23 01:01:52 +08:00
export const businessConfig = (params) =>
uni.$u?.http.post("/common/init", JSON.stringify(params));
2025-11-25 05:36:02 +08:00
// 验证是否升级
export const checkUpgrade = (params) =>
uni.$u?.http.post("/common/checkUpgrade", JSON.stringify(params));
2025-11-07 09:56:20 +08:00
export const businessLogin = (params) =>
2025-11-23 01:01:52 +08:00
uni.$u?.http.post("/common/login", JSON.stringify(params));
2025-11-07 09:56:20 +08:00
export const businessSendSms = (params) =>
2025-11-23 01:01:52 +08:00
uni.$u?.http.post("/common/captcha", JSON.stringify(params));
2025-11-07 09:56:20 +08:00
export const businessVerifyCode = (params) =>
2025-11-23 01:01:52 +08:00
uni.$u?.http.post("/common/verify_captcha", JSON.stringify(params));
2025-11-07 09:56:20 +08:00
export const businessRegister = (params) =>
2025-11-23 01:01:52 +08:00
uni.$u?.http.post("/common/register", JSON.stringify(params));
2025-11-07 09:56:20 +08:00
export const businessReset = (params) =>
2025-11-23 01:01:52 +08:00
uni.$u?.http.post("/common/resetpwd", JSON.stringify(params));
2025-11-07 09:56:20 +08:00
export const businessModify = (params) =>
uni.$u?.http.post(
2025-11-23 01:01:52 +08:00
"/user/change_password",
2025-11-07 09:56:20 +08:00
JSON.stringify({
...params,
}), {
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
);
// 用户信息
export const businessInfoUpdate = (params) =>
uni.$u?.http.post(
2025-11-23 01:01:52 +08:00
"/user/profile",
2025-11-25 05:36:02 +08:00
JSON.stringify({ ...params, }),
{
2025-11-07 09:56:20 +08:00
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
);
export const businessGetUserInfo = (userID) =>
uni.$u?.http.post(
2025-11-23 01:01:52 +08:00
"/user/find",
2025-11-25 05:36:02 +08:00
JSON.stringify({ userIDs: [userID], }),
{
2025-11-07 09:56:20 +08:00
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
);
2025-11-23 07:58:47 +08:00
export const businessSearchUserInfo = (keyword,searchtype) =>
2025-11-07 09:56:20 +08:00
uni.$u?.http.post(
2025-11-23 01:01:52 +08:00
"/user/search",
2025-11-07 09:56:20 +08:00
JSON.stringify({
keyword,
2025-11-23 07:58:47 +08:00
searchtype:(searchtype? searchtype : 'id'),
page: 1,
limit: 10
2025-11-07 09:56:20 +08:00
}), {
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
);
2025-11-23 07:58:47 +08:00
export const businessSearchUser = (keyword,searchtype) =>
2025-11-07 09:56:20 +08:00
uni.$u?.http.post(
"/friend/search",
JSON.stringify({
keyword,
2025-11-23 07:58:47 +08:00
searchtype:(searchtype? searchtype : 'id'),
page: 1,
limit: 99,
2025-11-07 09:56:20 +08:00
}), {
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
2025-11-25 05:36:02 +08:00
);
export const getArticle = (id,type) =>
uni.$u?.http.post(
"/article/detail",
JSON.stringify({
id,
type:(type? type : 'id')
}), {
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
);
export const getFriendCircle = (page=1,limit=10) =>{
uni.$u?.http.get(
"/friend_circle/list",
JSON.stringify({
limit:limit,
page:page
}),
{
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
);
}
export const getFriendCircleNewcount = () =>{
uni.$u?.http.get(
"/friend_circle/newcount",
JSON.stringify({}),
{
header: {
token: uni.getStorageSync("BusinessToken"),
},
}
);
}