后端:公告√

注意数据库新建notice表
This commit is contained in:
2025-09-16 20:03:17 +08:00
parent 158b3e65b6
commit 562ec4abf9
26 changed files with 1468 additions and 35 deletions

View File

@@ -0,0 +1,12 @@
"use strict";
const common_vendor = require("./vendor.js");
const envBaseUrl = typeof process !== "undefined" && process.env && (process.env.VITE_APP_API_BASE_URL || process.env.API_BASE_URL) || "";
const storageBaseUrl = typeof common_vendor.index !== "undefined" ? common_vendor.index.getStorageSync("API_BASE_URL") || "" : "";
const fallbackBaseUrl = "http://localhost:8080";
const API_BASE_URL = (envBaseUrl || storageBaseUrl || fallbackBaseUrl).replace(/\/$/, "");
const envShopId = typeof process !== "undefined" && process.env && (process.env.VITE_APP_SHOP_ID || process.env.SHOP_ID) || "";
const storageShopId = typeof common_vendor.index !== "undefined" ? common_vendor.index.getStorageSync("SHOP_ID") || "" : "";
const SHOP_ID = Number(envShopId || storageShopId || 1);
exports.API_BASE_URL = API_BASE_URL;
exports.SHOP_ID = SHOP_ID;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/config.js.map

View File

@@ -0,0 +1,29 @@
"use strict";
const common_vendor = require("./vendor.js");
const common_config = require("./config.js");
function buildUrl(path) {
if (!path)
return common_config.API_BASE_URL;
if (path.startsWith("http"))
return path;
return common_config.API_BASE_URL + (path.startsWith("/") ? path : "/" + path);
}
function get(path, params = {}) {
return new Promise((resolve, reject) => {
common_vendor.index.request({
url: buildUrl(path),
method: "GET",
data: params,
header: { "X-Shop-Id": common_config.SHOP_ID },
success: (res) => {
const { statusCode, data } = res;
if (statusCode >= 200 && statusCode < 300)
return resolve(data);
reject(new Error("HTTP " + statusCode));
},
fail: (err) => reject(err)
});
});
}
exports.get = get;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/http.js.map

View File

@@ -6917,9 +6917,9 @@ function isConsoleWritable() {
return isWritable;
}
function initRuntimeSocketService() {
const hosts = "198.18.0.1,192.168.31.107,127.0.0.1";
const hosts = "198.18.0.1,192.168.31.193,127.0.0.1";
const port = "8090";
const id = "mp-weixin_BJ7qAd";
const id = "mp-weixin_UjOtWQ";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();