remove unused WeCom backend integration

This commit is contained in:
inman
2026-07-23 18:44:54 +08:00
parent 4b3734f988
commit a284fbe3f3
11 changed files with 6 additions and 1022 deletions

View File

@@ -2,7 +2,7 @@
这是唯一的用户端前台,基于 Taro + React + TypeScript覆盖探索、搜索、线路详情、收藏、最近浏览、微信登录、手机号授权、我的需求和原生企微“联系我”页。
小程序已声明企微官方插件 `wx104a1a20c3f81ec2`(版本 `1.4.3`)。`pages/contact/index` 通过公开 API 读取当前联系我 `config_id`渲染 `plugin://contactPlugin/cell`H5 中的“企微联系”入口只负责跳转到该原生页。
小程序已声明企微官方插件 `wx104a1a20c3f81ec2`(版本 `1.4.3`)。`pages/contact/index` 内置企业微信后台创建的联系我 `config_id`直接渲染 `plugin://contactPlugin/cell`H5 中的“企微联系”入口只负责跳转到该原生页。后端不参与联系我插件的配置、同步或回调。
## 本地开发
@@ -30,6 +30,6 @@ TARO_APP_API_BASE_URL="https://biz.wanderqtrip.com/api"
npm run build:miniapp
```
生产 API 需要配置 `WECHAT_APP_ID``WECHAT_APP_SECRET``DATABASE_URL``JWT_SECRET`企微对接还需要按 `docs/backend/README.md` 配置 `WECOM_*` 服务端变量,并将 API 域名与 OSS/CDN 域名加入微信小程序的 `request``downloadFile` 合法域名。图片统一使用 API 返回的 OSS WebP 公共 URL不打包本地图片素材。
生产 API 需要配置 `WECHAT_APP_ID``WECHAT_APP_SECRET``DATABASE_URL``JWT_SECRET`,并将 API 域名与 OSS/CDN 域名加入微信小程序的 `request``downloadFile` 合法域名。联系我插件的 `config_id` 已随小程序代码发布,不需要后端企微密钥。图片统一使用 API 返回的 OSS WebP 公共 URL不打包本地图片素材。
数据库首次部署执行 `npm run db:migrate`,初始化内容执行 `npm run db:seed`

View File

@@ -1,72 +1,26 @@
import { Button, Text, View } from "@tarojs/components";
import Taro from "@tarojs/taro";
import { useEffect, useState } from "react";
import { apiUrl } from "../../services/api";
const SUPPORT_PHONE = "18786174929";
type ContactWayResponse = {
enabled: boolean;
configId: string;
type: number;
scene: number;
style: number;
remark?: string | null;
state?: string | null;
pluginId: string;
pluginVersion: string;
};
const DEFAULT_CONTACT_WAY: ContactWayResponse = {
enabled: true,
configId: "5f8a2d2756e2c69776c186ef28fc48ee",
type: 1,
scene: 1,
style: 1,
remark: null,
state: null,
pluginId: "wx104a1a20c3f81ec2",
pluginVersion: "1.4.3",
};
const CONTACT_WAY_CONFIG_ID = "5f8a2d2756e2c69776c186ef28fc48ee";
const CONTACT_WAY_STYLE = 1;
export default function ContactPage() {
const [contactWay, setContactWay] = useState<ContactWayResponse>(DEFAULT_CONTACT_WAY);
useEffect(() => {
let active = true;
Taro.request<ContactWayResponse>({ url: apiUrl("/api/public/wecom/contact-way") })
.then((response) => {
if (!active) return;
if (response.statusCode >= 200 && response.statusCode < 300 && response.data?.configId) {
setContactWay(response.data);
}
})
.catch(() => {
if (active) console.warn("企微联系配置接口暂时不可达,使用内置联系我配置", DEFAULT_CONTACT_WAY.configId);
});
return () => {
active = false;
};
}, []);
const callSupport = () => {
void Taro.makePhoneCall({ phoneNumber: SUPPORT_PHONE });
};
const showPlugin = Boolean(contactWay.enabled && contactWay.configId);
return (
<View className="page contact-page">
<View className="contact-hero">
<Text className="eyebrow"></Text>
<Text className="contact-title"></Text>
</View>
{showPlugin ? (
{CONTACT_WAY_CONFIG_ID ? (
<View className="contact-plugin-card">
<Text className="contact-card-title"></Text>
<Text className="contact-card-note"></Text>
<cell plugid={contactWay.configId} styleType={contactWay.style} />
<cell plugid={CONTACT_WAY_CONFIG_ID} styleType={CONTACT_WAY_STYLE} />
</View>
) : (
<View className="contact-plugin-card contact-fallback">