first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

View 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