first commit
This commit is contained in:
61
unpackage/dist/dev/mp-weixin/api/http.js
vendored
Normal file
61
unpackage/dist/dev/mp-weixin/api/http.js
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../common/vendor.js");
|
||||
const utils_fun = require("../utils/fun.js");
|
||||
const proxyObj = {
|
||||
// 开发版
|
||||
development: "https://apidjk.jitujt.com",
|
||||
// development: 'http://192.168.1.62:48080',
|
||||
// development: 'http://192.168.1.191:48080',
|
||||
// 正式版
|
||||
production: "https://apidjk.jitujt.com"
|
||||
};
|
||||
const http = ({ url, params, method }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let Authorization = common_vendor.index.getStorageSync("Authorization") || "";
|
||||
let header = {
|
||||
Authorization,
|
||||
"Tenant-id": "134"
|
||||
};
|
||||
common_vendor.index.request({
|
||||
url: proxyObj["development"] + url,
|
||||
data: params || {},
|
||||
method: method || "POST",
|
||||
header,
|
||||
success: (res) => {
|
||||
const data = res.data;
|
||||
if (data.code == 401 || res.statusCode == 401) {
|
||||
common_vendor.index.removeStorageSync("Authorization");
|
||||
common_vendor.index.removeStorageSync("userInfo");
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: `${Authorization ? "登录失效" : "你还未登录"},是否前往登录?`,
|
||||
success: function(res2) {
|
||||
if (res2.confirm) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
});
|
||||
} else if (res2.cancel) {
|
||||
common_vendor.index.clearStorageSync();
|
||||
common_vendor.index.__f__("log", "at api/http.ts:50", "用户点击取消");
|
||||
}
|
||||
}
|
||||
});
|
||||
reject(data);
|
||||
return;
|
||||
}
|
||||
if (data.code === 0) {
|
||||
resolve(data.data || null);
|
||||
} else {
|
||||
utils_fun.toast(data.msg);
|
||||
reject(data);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.http = http;
|
||||
exports.proxyObj = proxyObj;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/api/http.js.map
|
||||
14
unpackage/dist/dev/mp-weixin/api/index.js
vendored
Normal file
14
unpackage/dist/dev/mp-weixin/api/index.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
const api_modules_users = require("./modules/users.js");
|
||||
const api_modules_goods = require("./modules/goods.js");
|
||||
const api_modules_config = require("./modules/config.js");
|
||||
const api_modules_order = require("./modules/order.js");
|
||||
const api = {
|
||||
// 用户相关接口
|
||||
...api_modules_users.api,
|
||||
...api_modules_goods.api,
|
||||
...api_modules_config.api,
|
||||
...api_modules_order.api
|
||||
};
|
||||
exports.api = api;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/api/index.js.map
|
||||
14
unpackage/dist/dev/mp-weixin/api/modules/config.js
vendored
Normal file
14
unpackage/dist/dev/mp-weixin/api/modules/config.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
const api_http = require("../http.js");
|
||||
const api = {
|
||||
// 轮播图列表
|
||||
banner: (params = {}) => api_http.http({ url: "/app-api/djk/app/banner/page", params, method: "GET" }),
|
||||
// 公告列表
|
||||
noticePage: (params = {}) => api_http.http({ url: "/app-api/djk/app/notice/page", params, method: "GET" }),
|
||||
// 公告分类
|
||||
noticeCatePage: (params = {}) => api_http.http({ url: "/app-api/djk/app/notice-category/page", params, method: "GET" }),
|
||||
// 公告详情
|
||||
noticeInfo: (params = {}) => api_http.http({ url: "/app-api/djk/app/notice/get", params, method: "GET" })
|
||||
};
|
||||
exports.api = api;
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/api/modules/config.js.map
|
||||
12
unpackage/dist/dev/mp-weixin/api/modules/goods.js
vendored
Normal file
12
unpackage/dist/dev/mp-weixin/api/modules/goods.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
const api_http = require("../http.js");
|
||||
const api = {
|
||||
// 商品列表
|
||||
goodsPage: (params = {}) => api_http.http({ url: "/app-api/djk/app/goods/page", params, method: "GET" }),
|
||||
// 商品详情
|
||||
goodsInfo: (params = {}) => api_http.http({ url: "/app-api/djk/app/goods/get", params, method: "GET" }),
|
||||
// 商品分类
|
||||
goodsCate: (params = {}) => api_http.http({ url: "/app-api/djk/app/goods/category/page", params, method: "GET" })
|
||||
};
|
||||
exports.api = api;
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/api/modules/goods.js.map
|
||||
12
unpackage/dist/dev/mp-weixin/api/modules/order.js
vendored
Normal file
12
unpackage/dist/dev/mp-weixin/api/modules/order.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
const api_http = require("../http.js");
|
||||
const api = {
|
||||
// 创建用户订单
|
||||
orderCreate: (params = {}) => api_http.http({ url: "/app-api/djk/app/order/create", params, method: "POST" }),
|
||||
// 用户订单列表
|
||||
orderPage: (params = {}) => api_http.http({ url: "/app-api/djk/app/order/page", params, method: "GET" }),
|
||||
// 获取用户订单详情
|
||||
orderInfo: (params = {}) => api_http.http({ url: "/app-api/djk/app/order/get", params, method: "GET" })
|
||||
};
|
||||
exports.api = api;
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/api/modules/order.js.map
|
||||
40
unpackage/dist/dev/mp-weixin/api/modules/users.js
vendored
Normal file
40
unpackage/dist/dev/mp-weixin/api/modules/users.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
const api_http = require("../http.js");
|
||||
const api = {
|
||||
// 密码登录
|
||||
loginApi: (params = {}) => api_http.http({ url: "/app-api/member/auth/login", params, method: "POST" }),
|
||||
// 验证码登录
|
||||
smsLoginApi: (params = {}) => api_http.http({ url: "/app-api/member/auth/sms-login", params, method: "POST" }),
|
||||
//用户注册
|
||||
registerApi: (params = {}) => api_http.http({ url: "/app-api/member/auth/register", params, method: "POST" }),
|
||||
// 发送验证码
|
||||
smsCode: (params = {}) => api_http.http({ url: "/app-api/member/auth/send-sms-code", params, method: "POST" }),
|
||||
// 用户基本信息
|
||||
usersGetInfo: (params = {}) => api_http.http({ url: "/app-api/member/user/get", params, method: "GET" }),
|
||||
// 获取团队列表
|
||||
usersGetInfoTeam: (params = {}) => api_http.http({ url: "/app-api/member/user/getPage", params, method: "GET" }),
|
||||
// 修改个人信息
|
||||
usersUpdate: (params = {}) => api_http.http({ url: "/app-api/member/user/update", params, method: "PUT" }),
|
||||
// 收货地址分页
|
||||
addressPage: (params = {}) => api_http.http({ url: "/app-api/djk/app/user-receiver/page", params, method: "GET" }),
|
||||
// 新增收货地址
|
||||
addressAdd: (params = {}) => api_http.http({ url: "/app-api/djk/app/user-receiver/create", params, method: "POST" }),
|
||||
// 编辑收货地址
|
||||
addressUp: (params = {}) => api_http.http({ url: "/app-api/djk/app/user-receiver/update", params, method: "PUT" }),
|
||||
// 编辑收货地址
|
||||
addressInfo: (params = {}) => api_http.http({ url: "/app-api/djk/app/user-receiver/get", params, method: "GET" }),
|
||||
// 删除收货地址
|
||||
addressDel: (params = {}) => api_http.http({ url: "/app-api/djk/app/user-receiver/delete?id=" + params.id, params, method: "DELETE" }),
|
||||
// 余额记录
|
||||
moneyRecord: (params = {}) => api_http.http({ url: "/app-api/member/money-record/djk/page", params, method: "GET" }),
|
||||
// 修改用户手机号
|
||||
updateMobile: (params = {}) => api_http.http({ url: "/app-api/member/user/update-mobile", params, method: "PUT" }),
|
||||
// 报单综合
|
||||
rewardReport: (params = {}) => api_http.http({ url: "/app-api/member/money-record/djk/rewardReport", params, method: "GET" }),
|
||||
// 团队月度业绩奖查询
|
||||
getTeamMonthlyPerformanceAward: (params = {}) => api_http.http({ url: "/app-api/member/money-record/djk/getTeamMonthlyPerformanceAward", params, method: "GET" }),
|
||||
// 划转
|
||||
transfer2other: (params = {}) => api_http.http({ url: "/app-api/member/user/pay/transfer2other", params, method: "POST" })
|
||||
};
|
||||
exports.api = api;
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/api/modules/users.js.map
|
||||
Reference in New Issue
Block a user