/*
 * @Author: PoJun
 * @Date: 2023-09-13 17:12:51
 * @LastEditors: PoJun
 * @LastEditTime: 2024-01-04 16:42:03
 * @Message: 登录相关
 */
const { http } = uni.$uv;

// 根据用户code进行微信小程序登录 , 由于h5开发需要., 所以支持h5账号密码登录
export const wechatLogin = (code, pass, type) =>
    http.post("/wechat/mini/login", { principal: code, credentials: pass, type });

// 获取登录信息
export const getLoginInfo = config => http.get(`/web/login_info`, config);

// 注册账号
export const registerUsername = data => http.post("/web/register", data);

// 重置用户密码信息
export const updatePassword = data => http.post("/currentuser/reset_security", data);

// 修改人员信息
export const editPersonInfo = (data, config) => http.post("/org/org_persons/person_uer/info", data, config);

// 用户申请加入组织
export const userJoinOrgAffair = (data, config) => http.post("/affair_ext/UserJoinOrgAffair", data, config);

// 用户申请成为供应商
export const supplierAffair = (data, config) => http.post("/affair_ext/SupplierAffair", data, config);

// 注销账号
export const cancelUser = data => http.post("/web/cancel", data);
