From 4b5f387bd4b8f5cfa3becda20aa9527579a60d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 5 Sep 2024 12:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0API=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .idea/UniappTool.xml | 10 ++++++++++ src/api/cms/ad/index.ts | 15 ++++++++++++++- src/api/cms/ad/model/index.ts | 11 +++++++++++ src/api/cms/design/index.ts | 12 ++++++++++++ src/api/cms/navigation/model/index.ts | 3 +++ src/api/cms/website/model/index.ts | 11 +++++++++++ src/components/Banner/index.vue | 20 +++++++++++--------- src/layout/index.vue | 2 +- src/views/about/components/detail.vue | 16 +++++++++------- src/views/index/index.vue | 8 ++++---- 11 files changed, 87 insertions(+), 23 deletions(-) create mode 100644 .idea/UniappTool.xml diff --git a/.env.development b/.env.development index 2e992b3..a5953b5 100644 --- a/.env.development +++ b/.env.development @@ -2,6 +2,6 @@ VITE_SOCKET_URL=wss://server.gxwebsoft.com VITE_SERVER_URL=https://server.gxwebsoft.com/api VITE_API_URL=https://modules.gxwebsoft.com/api -#VITE_API_URL=http://127.0.0.1:9090/api +#VITE_API_URL=http://127.0.0.1:9001/api #VITE_SOCKET_URL=ws://localhost:9191 #VITE_API_URL=http://103.233.255.195:9300/api diff --git a/.idea/UniappTool.xml b/.idea/UniappTool.xml new file mode 100644 index 0000000..f7328e8 --- /dev/null +++ b/.idea/UniappTool.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/src/api/cms/ad/index.ts b/src/api/cms/ad/index.ts index 356d5fd..9b4f659 100644 --- a/src/api/cms/ad/index.ts +++ b/src/api/cms/ad/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { Ad, AdParam } from './model'; +import type {Ad, AdParam} from './model'; import { MODULES_API_URL } from '@/config/setting'; /** @@ -119,6 +119,19 @@ export async function getAd(id: number) { return Promise.reject(new Error(res.data.message)); } +/** + * 根据id查询广告位 + */ +export async function getSide() { + const res = await request.get>( + MODULES_API_URL + '/cms/ad/side' + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + /** * 检查IP是否存在 */ diff --git a/src/api/cms/ad/model/index.ts b/src/api/cms/ad/model/index.ts index 370f259..98928be 100644 --- a/src/api/cms/ad/model/index.ts +++ b/src/api/cms/ad/model/index.ts @@ -18,6 +18,17 @@ export interface Ad { status?: number; createTime?: string; updateTime?: string; + data?: AdItem []; +} + +/** + * 图片列表 + */ +export interface AdItem { + uid?: number; + url?: string; + path?: string; + status?: string; } /** diff --git a/src/api/cms/design/index.ts b/src/api/cms/design/index.ts index d9bfdb4..d820ed7 100644 --- a/src/api/cms/design/index.ts +++ b/src/api/cms/design/index.ts @@ -2,6 +2,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { Design, DesignParam } from './model'; import { MODULES_API_URL } from '@/config/setting'; +import {Navigation} from "@/api/cms/navigation/model"; /** * 分页查询页面设计 @@ -138,3 +139,14 @@ export async function checkExistence( } return Promise.reject(new Error(res.data.message)); } + +export async function getNavigationByPath(params?: DesignParam) { + const res = await request.get>(MODULES_API_URL + '/cms/navigation/getNavigationByPath', { + params + }); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + diff --git a/src/api/cms/navigation/model/index.ts b/src/api/cms/navigation/model/index.ts index cf8c89a..14b621c 100644 --- a/src/api/cms/navigation/model/index.ts +++ b/src/api/cms/navigation/model/index.ts @@ -1,3 +1,5 @@ +import {Design} from "@/api/cms/design/model"; + /** * 菜单 */ @@ -36,6 +38,7 @@ export interface Navigation { createTime?: string; // 子菜单 children?: Navigation[]; + design?: Design; // 权限树回显选中状态, 0未选中, 1选中 checked?: boolean; // diff --git a/src/api/cms/website/model/index.ts b/src/api/cms/website/model/index.ts index b48526f..eb44703 100644 --- a/src/api/cms/website/model/index.ts +++ b/src/api/cms/website/model/index.ts @@ -2,8 +2,19 @@ import {WebsiteField} from "@/api/cms/website/field/model"; import {Navigation} from "@/api/cms/navigation/model"; import {ArrangeCategory} from "@/api/cms/category/model"; import {Link} from "@/api/link/model"; +import {Ad} from "@/api/cms/ad/model"; // import {MenuMeta} from "ele-admin-pro/es/ele-pro-layout/types"; // import {MenuItem} from "ele-admin-pro"; +/** + * 小程序信息封装 + */ +export interface SiteInfo { + website?: Website; + config?: any; + slide?: Ad; + menus?: Navigation[]; + serverTime?: any; +} /** * 菜单 diff --git a/src/components/Banner/index.vue b/src/components/Banner/index.vue index 247e3a2..0a7df0a 100644 --- a/src/components/Banner/index.vue +++ b/src/components/Banner/index.vue @@ -21,12 +21,11 @@ -