This commit is contained in:
2025-11-11 17:07:13 +08:00
commit be86799071
2224 changed files with 271177 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
"use strict";
const BASE_URL = "http://172.20.10.2:8080";
exports.BASE_URL = BASE_URL;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/CommonValues.js.map

View File

@@ -0,0 +1,31 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const userInfoKey = "SCORE_SAFE_LOGIN";
const getUserInfo = () => {
var userInfo = common_vendor.index.getStorageSync(userInfoKey);
if (userInfo != "") {
userInfo = JSON.parse(userInfo);
return userInfo;
} else {
return null;
}
};
const setUserInfo = (userInfo) => {
common_vendor.index.setStorageSync(userInfoKey, JSON.stringify(userInfo));
};
const getTopHeight = () => {
const systemInfo = common_vendor.index.getSystemInfoSync();
const menuButtonInfo = common_vendor.index.getMenuButtonBoundingClientRect();
const statusBarHeight = systemInfo.statusBarHeight;
const menuButtonHeight = menuButtonInfo.height;
const calculatedTopHeight = statusBarHeight + menuButtonHeight + 20;
return `${calculatedTopHeight * (750 / systemInfo.windowWidth)}rpx`;
};
const StaticValue = {
getTopHeight,
userInfoKey,
getUserInfo,
setUserInfo
};
exports.StaticValue = StaticValue;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/StaticValue.js.map

View File

@@ -0,0 +1,72 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const utils_CommonValues = require("./CommonValues.js");
const api_login = require("../api/login.js");
function GET_TOKEN(url, data, token) {
return SIMPLE_TOKEN(url, data, token, "GET");
}
function POST(url, data) {
return SIMPLE(url, data, "POST");
}
let requestTime = 0;
async function SIMPLE(url, data, method) {
if (requestTime == 0) {
token = await api_login.loginSystem();
if (token.data) {
SIMPLE(url, data, method);
return;
}
requestTime += 1;
} else {
var token = common_vendor.index.getStorageSync("APP_TOKEN");
}
return new Promise((resolve, reject) => {
common_vendor.index.request({
url: `${utils_CommonValues.BASE_URL}${url}`,
method,
header: {
"Content-Type": "application/json;charset=utf-8",
"Authorization": token
},
dataType: "json",
data,
success: (res) => {
if (res.data.code == "200" || res.data.statusCode == "200") {
resolve(res.data);
} else {
reject(res);
}
},
fail: (err) => {
reject(err);
}
});
});
}
function SIMPLE_TOKEN(url, data, token, method) {
return new Promise((resolve, reject) => {
common_vendor.index.request({
url: `${utils_CommonValues.BASE_URL}${url}`,
method,
header: {
"Content-Type": "application/json;charset=utf-8",
"Authorization": token
},
dataType: "json",
data,
success: (res) => {
if (res.data.code == "200" || res.data.statusCode == "200") {
resolve(res.data);
} else {
reject(res);
}
},
fail: (err) => {
reject(err);
}
});
});
}
exports.GET_TOKEN = GET_TOKEN;
exports.POST = POST;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/request.js.map

View File

@@ -0,0 +1,38 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const utils_request = require("./request.js");
const api_login = require("../api/login.js");
function getOpenId() {
return new Promise(async (resolve, reject) => {
var token = await api_login.loginSystem();
common_vendor.wx$1.login({
success: (res) => {
if (res.code) {
utils_request.GET_TOKEN(`/wx/openid/${res.code}`, null, token).then((response) => {
response.data.openid;
resolve({
status: 200,
openid: response.data.openid,
message: "获取openid成功"
});
}).catch((error) => {
common_vendor.index.__f__("log", "at utils/wxutils.js:20", error);
reject({
status: 400,
openid: null,
message: "获取openid失败"
});
});
} else {
reject({
status: 400,
openid: null,
message: "获取微信信息失败"
});
}
}
});
});
}
exports.getOpenId = getOpenId;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/wxutils.js.map