Browse Source

修复新API接口

master
科技小王子 9 months ago
parent
commit
4b5f387bd4
  1. 2
      .env.development
  2. 10
      .idea/UniappTool.xml
  3. 15
      src/api/cms/ad/index.ts
  4. 11
      src/api/cms/ad/model/index.ts
  5. 12
      src/api/cms/design/index.ts
  6. 3
      src/api/cms/navigation/model/index.ts
  7. 11
      src/api/cms/website/model/index.ts
  8. 20
      src/components/Banner/index.vue
  9. 2
      src/layout/index.vue
  10. 16
      src/views/about/components/detail.vue
  11. 8
      src/views/index/index.vue

2
.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

10
.idea/UniappTool.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="cn.fjdmy.uniapp.UniappProjectDataService">
<option name="generalBasePath" value="$PROJECT_DIR$" />
<option name="manifestPath" value="$PROJECT_DIR$/manifest.json" />
<option name="pagesPath" value="$PROJECT_DIR$/pages.json" />
<option name="scanNum" value="1" />
<option name="type" value="store" />
</component>
</project>

15
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<ApiResult<Ad>>(
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是否存在
*/

11
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;
}
/**

12
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<ApiResult<Navigation>>(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));
}

3
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;
//

11
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;
}
/**
*

20
src/components/Banner/index.vue

@ -21,12 +21,11 @@
<!-- <RightCircleOutlined />-->
<!-- </div>-->
<!-- </template>-->
<template v-if="form.images">
<template v-for="(item, index) in JSON.parse(form.images)" :key="index">
<template v-for="(item, index) in list" :key="index">
<div class="ad-item">
<a-image :preview="false" :src="item.url" width="100vw" />
<a-space class="ad-text" :size="10" direction="vertical">
<div class="title">{{ form.name }}</div>
<div class="title">{{ item.title }}</div>
<div class="desc">{{ form.comments }}</div>
<div class="btn"
><a-button
@ -39,14 +38,13 @@
</a-space>
</div>
</template>
</template>
</a-carousel>
</div>
</template>
<script setup lang="ts">
import { getAd } from '@/api/cms/ad';
import { getSide } from '@/api/cms/ad';
import useFormData from '@/utils/use-form-data';
import { Ad } from '@/api/cms/ad/model';
import {Ad, AdItem} from '@/api/cms/ad/model';
import { ref } from 'vue';
import { openNew } from '@/utils/common';
import {
@ -58,9 +56,10 @@ import { storeToRefs } from 'pinia';
const themeStore = useThemeStore();
const { screenWidth } = storeToRefs(themeStore);
const visible = ref<boolean>(false);
const list = ref<AdItem[]>();
//
const { form, assignFields } = useFormData<Ad>({
const { form } = useFormData<Ad>({
adId: undefined,
name: '',
adType: '图片广告',
@ -86,8 +85,11 @@ const onChange = () => {
};
const reload = () => {
getAd(254).then((data) => {
assignFields(data);
getSide().then((data) => {
if(data){
list.value = data.data;
}
// assignFields(data);
});
};

2
src/layout/index.vue

@ -44,7 +44,7 @@
//
const { menus } = storeToRefs(userStore);
const { siteInfo } = storeToRefs(tenantStore);
console.log(siteInfo.value.websiteName,'siteInfo.')
//
const projectName = siteInfo.value?.websiteName || '网站名称';
// LOGO

16
src/views/about/components/detail.vue

@ -21,7 +21,7 @@
import {toDateString} from "ele-admin-pro";
import {ref, unref, watch} from "vue";
import {Design} from "@/api/cms/design/model";
import {getDesign, listDesign} from "@/api/cms/design";
import {getDesign, getNavigationByPath, listDesign} from "@/api/cms/design";
import {useThemeStore} from "@/store/modules/theme";
import {storeToRefs} from "pinia";
import {useRouter} from "vue-router";
@ -50,20 +50,22 @@ const { form,assignFields } = useFormData<Design>({
});
const reload = () => {
listDesign({path: pagePath.value}).then(data => {
if(data.length){
assignFields((data[0]));
getNavigationByPath({path: pagePath.value}).then(data => {
console.log(data)
if (data.design) {
assignFields((data.design));
}
})
// getDesign(pageId.value).then(data => {
// assignFields(data)
// })
}
reload();
watch(
currentRoute,
(route) => {
console.log(route,'1111')
const { path } = unref(route);
console.log(path,'path')
if(path){
pagePath.value = path;
reload();

8
src/views/index/index.vue

@ -216,13 +216,13 @@
</a-card>
<a-card title="Important Dates" :bordered="false" hoverable :head-style="{ backgroundColor: '#e0f0fd', color: '#0096FF', fontSize: '24px'}" :style="{ boxShadow: '2px 0px 10px #ccc', marginBottom: '20px'}">
<div class="ele-text-heading">
<p>Abstract Submission BeforeJuly 20,2024 (2024年7月20日)</p>
<p>Abstract Submission Before<span style="text-decoration: line-through">July 20,2024 (2024年7月20日)</span></p>
<p>Full Paper Submission DeadlineAugust 20, 20242024年8月20日</p>
<p>Full Paper Submission Deadline<span style="text-decoration: line-through">August 20, 20242024年8月20日</span><span style="margin-left: 20px;">September 20,2024(2024年9月20日)</span></p>
<p>Notification of Acceptance BeforeSeptember 10, 20242024年9月10日</p>
<p>Notification of Acceptance Before<span style="text-decoration: line-through">September 10, 20242024年9月10日</span><span style="margin-left: 20px;">0ctober 22,2024(2024年10月22 )</span></p>
<p>Final Manuscript DueSeptember 30, 20242024年9月30日</p>
<p>Final Manuscript Due<span style="text-decoration: line-through">September 30, 20242024年9月30日</span><span style="margin-left: 20px;">October31,2024(2024年10月31日)</span></p>
<p>Registration DeadlineOctober 31,20242024年10月31日</p>

Loading…
Cancel
Save