2 Achegas 0e1c0da1f9 ... 59ef7483aa

Autor SHA1 Mensaxe Data
  rindy 59ef7483aa Merge branch 'master' of http://192.168.0.115:3000/zhangyupeng/helper-center hai 4 meses
  rindy 81363c2954 feat: 修改搜索不正确问题 hai 4 meses

+ 11 - 17
packages/backend/src/modules/web/web.service.ts

@@ -121,25 +121,19 @@ export class WebService {
   async searchArticles(key: string, locale?: string) {
     const lang = this.sharedService.handleValidLang(locale);
     const articles = await this.articleRepo.find({
-      where: [
-        {
-          enable: true,
-        },
-        {
-          translations: {
-            locale: lang,
-            title: Like(`%${key || ''}%`),
-          },
-        },
-        {
-          translations: {
-            locale: lang,
-            content: Like(`%${key || ''}%`),
-          },
-        },
-      ],
+      where: {
+        enable: true,
+        translations: [{
+          locale: lang,
+          title: Like(`%${key || ''}%`),
+        },{
+          locale: lang,
+          content: Like(`%${key || ''}%`),
+        }],
+      },
       relations: { translations: true },
     });
+    
     return articles.map((article) => article.translate(lang));
   }
 

+ 2 - 2
packages/web/.env.development

@@ -9,5 +9,5 @@ VITE_AXIOS_BASE_URL = '/api'  # 用于代理
 # VITE_AXIOS_BASE_URL = 'https://mock.apipark.cn/m1/3776410-0-default'  # apifox云端mock
 
 # 代理配置-target
-# VITE_PROXY_TARGET = 'http://localhost:8085'
-VITE_PROXY_TARGET = 'https://support.4dkankan.com'
+VITE_PROXY_TARGET = 'http://localhost:8085'
+# VITE_PROXY_TARGET = 'https://support.4dkankan.com'

+ 0 - 1
packages/web/components.d.ts

@@ -2,7 +2,6 @@
 // @ts-nocheck
 // Generated by unplugin-vue-components
 // Read more: https://github.com/vuejs/core/pull/3399
-// biome-ignore lint: disable
 export {}
 
 /* prettier-ignore */

+ 1 - 1
packages/web/vite.config.ts

@@ -55,7 +55,7 @@ export default defineConfig(({ mode }) => {
         '/api': {
           target: VITE_PROXY_TARGET,
           changeOrigin: true,
-          // rewrite: path => path.replace(/^\/api/, ''),
+          rewrite: path => path.replace(/^\/api/, ''),
           secure: false,
           // configure: (proxy, options) => {
           //   // 配置此项可在响应头中看到请求的真实地址