You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
2.4 KiB
46 lines
2.4 KiB
const apiUrl = 'https://test.tall.wiki/gateway'; // 测试
|
|
// const apiUrl = 'https://www.tall.wiki/gateway'; // 生产
|
|
const tall = `${apiUrl}/tall3/v3.0`;
|
|
|
|
// 登录
|
|
// export const login = {
|
|
// async index(params) {
|
|
// try {
|
|
// const data = await uni.$u.http.post(`${tall}/users/signin`, params);
|
|
// return data;
|
|
// } catch (error) {
|
|
// throw new Error(error);
|
|
// }
|
|
// },
|
|
// };
|
|
|
|
|
|
export function setupTall(app) {
|
|
uni.$u.api = { ...uni.$u.api } || {};
|
|
// 登录
|
|
// app.config.globalProperties.$u.api.signin = params => login.index(params);
|
|
// 获取图片验证码
|
|
// app.config.globalProperties.$u.api.getImageCode = () => app.config.globalProperties.$u.get(`${tall}/users/code`);
|
|
// 获取短信验证码
|
|
// app.config.globalProperties.$u.api.getSmsCode = params => app.config.globalProperties.$u.get(`${tall}/users/smscode`, params);
|
|
// 根据userId获取token
|
|
uni.$u.api.getToken = userId => uni.$u.get(`${tall}/users/userId`, { userId });
|
|
// 绑定手机号
|
|
// app.config.globalProperties.$u.api.phoneBind = (phone, smsCode) => app.config.globalProperties.$u.http.post(`${tall}/users/binding`, { phone, smsCode });
|
|
// 是否合并账号
|
|
// app.config.globalProperties.$u.api.phoneMerge = (phone, isMerge) => app.config.globalProperties.$u.http.post(`${tall}/users/merge`, { phone, isMerge });
|
|
|
|
// 修改用户信息
|
|
// app.config.globalProperties.$u.api.updateUserInfo = params => app.config.globalProperties.$u.http.post(`${tall}/users/userInfo`, params);
|
|
|
|
// 获取项目列表
|
|
// app.config.globalProperties.$u.api.getProjects = (startTime, endTime) => app.config.globalProperties.$u.post(`${tall}/project/query`, { startTime, endTime });
|
|
// 查询日历是否有小红点
|
|
// app.config.globalProperties.$u.api.findRedPoint = (startTime, endTime) => app.config.globalProperties.$u.post(`${tall}/project/day`, { startTime, endTime });
|
|
// 设置项目顺序
|
|
// app.config.globalProperties.$u.api.setProjectSort = params => app.config.globalProperties.$u.post(`${tall}/project/setProjectSort`, params);
|
|
// 设置项目父子结构
|
|
// app.config.globalProperties.$u.api.setProjectRelation = params => app.config.globalProperties.$u.post(`${tall}/project/setProjectRelation`, params);
|
|
// 删除某个项目
|
|
// app.config.globalProperties.$u.api.delProject = projectId => app.config.globalProperties.$u.post(`${tall}/project/deleteProject`, { projectId });
|
|
}
|