同步上游分支 - #2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee7e5ed748
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,25 +0,0 @@ | |||
| import {GoogleAnalytics} from "@next/third-parties/google"; | |||
There was a problem hiding this comment.
Restore legacy template files or block unsupported template IDs
This commit removes entire template directories (e.g. web/src/templates/001), but runtime template selection is still dynamic (process.env.NEXT_PUBLIC_TEMPLATE_ID in web/src/app/(index)/layout.js and other route pages) and compatibility logic still references non-010 IDs. In any environment still configured to 001/002/003/004 (or other non-010 values), the app now fails with module-not-found when importing @/templates/${templateId}/*. Keep those template modules or strictly validate/force supported IDs before dynamic imports.
Useful? React with 👍 / 👎.
| yarn-error.log* | ||
| .pnpm-debug.log* | ||
|
|
There was a problem hiding this comment.
Removing the .env* ignore rule makes environment files trackable, which substantially increases the chance of committing deployment credentials or other sensitive config in future changes. Since this repo now relies on .env-driven runtime configuration, keeping these files unignored is a security footgun; prefer restoring .env* ignore and committing a sanitized .env.example instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
本次 PR 主要将前端站点模板统一切换/对齐到 template10 版本(包含 BannerB、NavBar/Footer、Home 各 section 等),同时在管理后台新增了 FAQ/下载/案例等入口与基础信息配置项,并同步引入了若干部署/本地配置文件。
Changes:
- 前端:
templates/010多页面切换为BannerB+template10的导航/页脚/产品列表/Home 版式,并新增若干 detail 模板文件。 - 后台:新增“案例/下载/FAQ”管理页面入口,并在“基础信息”中加入全局变量、优势、客评等配置 UI。
- 服务端:新增 FAQ/下载/案例/TDK 的部分管理端接口文件(同时 PR 中混入了日志/缓存/IDE 文件与
.env跟踪)。
Reviewed changes
Copilot reviewed 124 out of 142 changed files in this pull request and generated 28 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/templates/010/productTemplate.jsx | 产品列表页切换到 template10 ProductList + BannerB |
| web/src/templates/010/productDetailTemplate.jsx | 新增 product detail 模板封装 |
| web/src/templates/010/newsTemplate.jsx | 新闻列表页切换到 BannerB |
| web/src/templates/010/newsDetailTemplate.jsx | 新增 news detail 模板封装 |
| web/src/templates/010/indexLayoutTemplate.jsx | 布局层切换到 template10 NavBar/Footer |
| web/src/templates/010/homeTemplate.jsx | 新增 template10 首页模板 |
| web/src/templates/010/faqTemplate.jsx | FAQ 页切换到 BannerB |
| web/src/templates/010/downloadTemplate.jsx | 下载页切换到 BannerB |
| web/src/templates/010/contactTemplate.jsx | 联系页切换到 BannerB + template10 GetInTouch |
| web/src/templates/010/caseTemplate.jsx | 案例列表页切换到 BannerB |
| web/src/templates/010/caseDetailTemplate.jsx | 新增 case detail 模板封装 |
| web/src/templates/010/aboutTemplate.jsx | About 页切换到 template10 WhoWeAre/Certification + BannerB |
| web/src/templates/004/productTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/productDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/newsTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/newsDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/homeTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/faqTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/downloadTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/contactTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/caseTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/caseDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/004/aboutTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/productDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/newsDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/indexLayoutTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/homeTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/downloadTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/caseTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/caseDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/003/aboutTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/productTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/productDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/newsTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/newsDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/indexLayoutTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/homeTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/faqTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/contactTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/caseTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/caseDetailTemplate.jsx | 删除旧模板文件 |
| web/src/templates/002/aboutTemplate.jsx | 删除旧模板文件 |
| web/src/templates/001/productTemplate.jsx | 删除旧模板文件 |
| web/src/templates/001/newsTemplate.jsx | 删除旧模板文件 |
| web/src/templates/001/indexLayoutTemplate.jsx | 删除旧模板文件 |
| web/src/templates/001/homeTemplate.jsx | 删除旧模板文件 |
| web/src/templates/001/faqTemplate.jsx | 删除旧模板文件 |
| web/src/templates/001/downloadTemplate.jsx | 删除旧模板文件 |
| web/src/templates/001/contactTemplate.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template10/whoWeAre.jsx | 调整 template10 WhoWeAre 版式/样式 |
| web/src/components/index/sections/template10/productList.jsx | ProductList 清理模拟数据并调整卡片结构与样式 |
| web/src/components/index/sections/template10/ourCategories.jsx | 分类卡片样式与文案键调整 |
| web/src/components/index/sections/template10/navBarClient.jsx | 桌面/移动端导航样式与交互调整 |
| web/src/components/index/sections/template10/navBar.jsx | NavBar 使用 template10 NavBarClient 并调整布局 |
| web/src/components/index/sections/template10/getInTouch.jsx | 联系信息字体样式调整 |
| web/src/components/index/sections/template10/ftArea.jsx | 新增 template10 FtArea |
| web/src/components/index/sections/template10/footer.jsx | Footer 样式与版权区文案调整 |
| web/src/components/index/sections/template10/featuredProducts.jsx | FeaturedProducts 样式/标题键调整 |
| web/src/components/index/sections/template10/customersSay.jsx | 新增 template10 CustomersSay |
| web/src/components/index/sections/template10/companyNews.jsx | 公司新闻标题键调整 |
| web/src/components/index/sections/template10/categoryItem.jsx | CategoryItem 移除未用图标并调整样式 |
| web/src/components/index/sections/template10/carousel.jsx | Carousel 增强 Swiper 配置并增加点击跳转逻辑 |
| web/src/components/index/sections/template10/aboutUs.jsx | AboutUs 版式与标题区样式调整 |
| web/src/components/index/sections/template04/testimonials.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/recommendedForYou.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/ourMission.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/ourFactory.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/ourCategories.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/ftArea.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/footer.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/featuredProducts.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/customersSay.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/contactUs.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/companyNews.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/certification.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/caseList.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/caseDetail.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/advantages.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template04/aboutUs.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template03/productList.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template03/navBar.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template03/ftArea.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template03/carousel.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template02/productList.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template02/ourCategories.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template02/navBar.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template02/featuredProducts.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template02/certification.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template02/carousel.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template01/ourCategories.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template01/featuredProducts.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template01/certification.jsx | 删除旧模板文件 |
| web/src/components/index/sections/template01/carousel.jsx | 删除旧模板文件 |
| web/src/components/admin/sidebar.jsx | 后台侧边栏新增案例/下载/FAQ 菜单项 |
| web/src/components/admin/basicInfo/globalSettings.jsx | 新增“全局变量”配置 UI |
| web/src/components/admin/basicInfo/commentSettings.jsx | 新增“客评变量”列表管理 UI |
| web/src/components/admin/basicInfo/commentModal.jsx | 新增“客评”编辑/新增弹窗 |
| web/src/components/admin/basicInfo/advantageSettings.jsx | 新增“优势变量”列表管理 UI |
| web/src/components/admin/basicInfo/advantageModal.jsx | 新增“优势”编辑/新增弹窗 |
| web/src/app/(admin)/admin/faq/page.jsx | 新增 FAQ 管理页面入口 |
| web/src/app/(admin)/admin/download/page.jsx | 新增 下载 管理页面入口 |
| web/src/app/(admin)/admin/case/page.jsx | 新增 案例 管理页面入口 |
| web/src/app/(admin)/admin/basicInfo/page.jsx | 基础信息页增加多个 Tab |
| web/my.conf | 新增 Nginx 配置文件 |
| web/.gitignore | 修改忽略规则(移除 .env* 忽略) |
| web/.env | 新增并提交前端环境变量文件 |
| server/server/settings.py | DB 配置占位符调整 |
| server/server/pycache/settings.cpython-38.pyc | 编译产物被提交 |
| server/myapp/views/admin/faq.py | 新增 FAQ 管理端接口 |
| server/myapp/views/admin/download.py | 新增 下载 管理端接口 |
| server/myapp/views/admin/case.py | 新增 案例 管理端接口 |
| server/myapp/views/admin/basicTdk.py | 新增 TDK 管理端接口 |
| server/myapp/views/admin/pycache/faq.cpython-38.pyc | 编译产物被提交 |
| server/myapp/views/admin/pycache/download.cpython-38.pyc | 编译产物被提交 |
| server/myapp/views/admin/pycache/case.cpython-38.pyc | 编译产物被提交 |
| server/myapp/views/admin/pycache/basicTdk.cpython-38.pyc | 编译产物被提交 |
| server/info.log | 运行日志被提交 |
| README.md | 文案与部署步骤更新 |
| .idea/web_b2b.iml | IDE 工程文件被提交 |
| .idea/vcs.xml | IDE 工程文件被提交 |
| .idea/modules.xml | IDE 工程文件被提交 |
| .idea/misc.xml | IDE 工程文件被提交 |
| .idea/inspectionProfiles/Project_Default.xml | IDE 工程文件被提交 |
| .idea/aws.xml | IDE 工程文件被提交 |
| .idea/.gitignore | IDE 工程文件被提交 |
Files not reviewed (7)
- .idea/.gitignore: Language not supported
- .idea/aws.xml: Language not supported
- .idea/inspectionProfiles/Project_Default.xml: Language not supported
- .idea/misc.xml: Language not supported
- .idea/modules.xml: Language not supported
- .idea/vcs.xml: Language not supported
- .idea/web_b2b.iml: Language not supported
Comments suppressed due to low confidence (2)
web/src/templates/010/contactTemplate.jsx:5
Banneris still imported but no longer used after switching toBannerB. Please remove the unusedBannerimport to avoid lint/build warnings.
web/src/components/index/sections/template10/carousel.jsx:13langis imported but no longer used after removing the CTA/link text from the carousel. Please remove the unused import to avoid lint warnings.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'use client'; | ||
| import FormLabel from "@/components/admin/formLabel"; | ||
| import React, {useCallback, useEffect, useState} from "react"; | ||
| import {Button, Input, message, Pagination, Popconfirm, Radio, Space, Spin, Table} from 'antd'; | ||
| import axiosInstance from "@/utils/axios"; | ||
| import {useDispatch, useSelector} from "react-redux"; | ||
| import CommentModal from "@/components/admin/basicInfo/commentModal"; | ||
|
|
||
| const CommentSettings = () => { | ||
|
|
||
| const adminApp = useSelector((state) => state.adminSetting); | ||
| const dispatch = useDispatch(); | ||
| const [loading, setLoading] = useState(false); |
There was a problem hiding this comment.
There are multiple unused imports/variables here (FormLabel, useCallback, Input, Radio, useDispatch, useSelector, and the adminApp/dispatch variables). Please remove them to keep the file lint-clean and easier to maintain.
| import React, {useEffect, useState} from "react"; | ||
| import {Button, Input, message, Radio, Spin} from 'antd'; | ||
| import ImageUpload from "@/components/admin/imageUpload"; | ||
| import {Divider} from "antd/lib"; | ||
| import axiosInstance from "@/utils/axios"; | ||
|
|
||
| const GlobalSettings = () => { | ||
|
|
||
| const [currentItem, setCurrentItem] = useState({}); | ||
| const [loading, setLoading] = useState(false); | ||
|
|
||
| // 为了制造Upload而用 | ||
| const [imageList, setImageList] = useState([]); | ||
|
|
||
|
|
||
| const fetchData = async () => { | ||
| try { | ||
| setLoading(true) | ||
| const {code, msg, data} = await axiosInstance.get('/myapp/admin/basicGlobal/list'); | ||
| if (code === 0) { | ||
| setCurrentItem(data); | ||
| fixToImageData(data); | ||
| } else { | ||
| message.error(msg || '网络异常') | ||
| } | ||
| setLoading(false) | ||
| } catch (err) { | ||
| console.log(err) | ||
| message.error('网络异常') | ||
| setLoading(false) | ||
| } | ||
| }; | ||
|
|
||
| const fixToImageData = (initialData) => { | ||
| // 制造适合Upload的数据格式 | ||
| if (initialData?.global_wechat_qrcode?.length > 0) { | ||
| setImageList(initialData?.global_wechat_qrcode?.split("#").map((item) => ({ | ||
| success: true, | ||
| name: item, | ||
| status: 'done', | ||
| url: process.env.NEXT_PUBLIC_BASE_URL + '/upload/img/' + item, | ||
| }))); | ||
| } else { | ||
| setImageList([]); | ||
| } | ||
| } | ||
|
|
||
| useEffect(() => { | ||
| fetchData(); | ||
| }, []); | ||
|
|
||
|
|
||
| const handleInputChange = (name, value) => { | ||
| setCurrentItem((prev) => ({...prev, [name]: value})); | ||
| } | ||
|
|
||
| const handleSave = async () => { | ||
| console.log(currentItem); | ||
| try { |
There was a problem hiding this comment.
There are unused imports here (e.g. Radio) and a debug console.log(currentItem) in handleSave. Please remove unused imports and avoid logging potentially sensitive config to the console in production.
| // 客户评价数据 | ||
| const testimonials = [ | ||
| { | ||
| id: 1, | ||
| content: "Fast shipping and excellent customer service. The product was even better than expected. I will definitely be a returning customer.", | ||
| name: "JENNIFER LEWIS", | ||
| avatar: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=150&h=150&q=80", | ||
| }, | ||
| { | ||
| id: 2, | ||
| content: "Great user experience on your website. Great user experience on your website.I found exactly what I was looking for at a great price. I will definitely be telling my friends.", | ||
| name: "ALICIA HEART", | ||
| avatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=150&h=150&q=80", | ||
| }, | ||
| { | ||
| id: 3, | ||
| content: "Thank you for the excellent shopping experience. It arrived quickly and was exactly as described. I will definitely be shopping with you again in the future.", | ||
| name: "JUAN CARLOS", | ||
| avatar: "https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=150&h=150&q=80", | ||
| } | ||
| ]; |
There was a problem hiding this comment.
testimonials is declared but never used (rendering uses commentData instead). Please remove the unused constant to avoid confusion and keep the component lint-clean.
|
|
||
|
|
There was a problem hiding this comment.
Removing the .env* ignore rule means environment-specific configuration (and potentially secrets in the future) will be committed. Please restore ignoring .env* and commit an example file instead (e.g. .env.example).
| # env files | |
| .env* | |
| !.env.example |
| console.log('current-----------', currentItem) | ||
|
|
||
|
|
There was a problem hiding this comment.
This component currently logs currentItem to the console on every render. Please remove console.log('current-----------', currentItem) to avoid noisy logs and accidental data exposure.
| console.log('current-----------', currentItem) |
| from myapp.auth.authentication import AdminTokenAuthtication | ||
| from myapp.handler import APIResponse | ||
| from myapp.models import BasicTdk | ||
| from myapp.permission.permission import isDemoAdminUser, check_if_demo |
There was a problem hiding this comment.
isDemoAdminUser is imported but never used in this module. Please remove the unused import to keep the file clean.
| from myapp.permission.permission import isDemoAdminUser, check_if_demo | |
| from myapp.permission.permission import check_if_demo |
| 'use client'; | ||
| import React, {useEffect, useState} from 'react'; | ||
| import {Tabs} from "antd"; | ||
| import FaqList from "@/components/admin/faq/faqList"; | ||
|
|
||
| export default function Page() { | ||
| const onChange = (key) => { | ||
| console.log(key); | ||
| }; | ||
| const items = [ |
There was a problem hiding this comment.
useEffect/useState are imported but not used, and onChange only logs to console. Please remove unused hooks and avoid leaving debug console.log in production UI code.
| import FormLabel from "@/components/admin/formLabel"; | ||
| import React, {useCallback, useEffect, useState} from "react"; | ||
| import {Button, Input, message, Pagination, Popconfirm, Radio, Space, Spin, Table} from 'antd'; | ||
| import axiosInstance from "@/utils/axios"; | ||
| import {useDispatch, useSelector} from "react-redux"; | ||
| import AdvantageModal from "@/components/admin/basicInfo/advantageModal"; | ||
|
|
||
| const AdvantageSettings = () => { | ||
|
|
||
| const adminApp = useSelector((state) => state.adminSetting); | ||
| const dispatch = useDispatch(); |
There was a problem hiding this comment.
There are multiple unused imports/variables here (FormLabel, useCallback, Input, Radio, useDispatch, useSelector, and the adminApp/dispatch variables). Please remove them to keep the file lint-clean and easier to maintain.
| import FormLabel from "@/components/admin/formLabel"; | |
| import React, {useCallback, useEffect, useState} from "react"; | |
| import {Button, Input, message, Pagination, Popconfirm, Radio, Space, Spin, Table} from 'antd'; | |
| import axiosInstance from "@/utils/axios"; | |
| import {useDispatch, useSelector} from "react-redux"; | |
| import AdvantageModal from "@/components/admin/basicInfo/advantageModal"; | |
| const AdvantageSettings = () => { | |
| const adminApp = useSelector((state) => state.adminSetting); | |
| const dispatch = useDispatch(); | |
| import React, {useEffect, useState} from "react"; | |
| import {Button, message, Pagination, Popconfirm, Space, Spin, Table} from 'antd'; | |
| import axiosInstance from "@/utils/axios"; | |
| import AdvantageModal from "@/components/admin/basicInfo/advantageModal"; | |
| const AdvantageSettings = () => { |
| console.log('current-----------', currentItem) | ||
|
|
||
|
|
There was a problem hiding this comment.
This component currently logs currentItem to the console on every render. Please remove console.log('current-----------', currentItem) to avoid noisy logs and accidental data exposure.
| console.log('current-----------', currentItem) |
| 'use client'; | ||
| import React, {useEffect, useState} from 'react'; | ||
| import {Tabs} from "antd"; | ||
| import DownloadList from "@/components/admin/download/downloadList"; | ||
|
|
||
| export default function Page() { | ||
| const onChange = (key) => { | ||
| console.log(key); | ||
| }; | ||
| const items = [ |
There was a problem hiding this comment.
useEffect/useState are imported but not used, and onChange only logs to console. Please remove unused hooks and avoid leaving debug console.log in production UI code.
Added sections for server and domain preparation with links.
No description provided.