Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: banner
牛文政8bb903739056
diff --git a/src/api/operate.ts b/src/api/operate.tsnew file mode 100644index 00000000..1f690823--- /dev/null+++ b/src/api/operate.ts@@ -0,0 +1,22 @@+/*+ * @Author: nevin+ * @Date: 2025-02-22 12:02:55+ * @LastEditTime: 2025-03-02 23:00:49+ * @LastEditors: nevin+ * @Description: operate+ */+import http from './request';++export const operateApi = {+ /**+ * 获取banner+ */+ getBannerList(tag?: string) {+ return http.get<string>(`/banner/list`, {+ isToken: true,+ params: {+ tag,+ },+ });+ },+};diff --git a/src/api/types/operate.ts b/src/api/types/operate.tsnew file mode 100644index 00000000..6781404d--- /dev/null+++ b/src/api/types/operate.ts@@ -0,0 +1,12 @@+export interface Banner {+ _id: string;+ id: string;+ dataId: string;+ desc: string;+ url: string;+ imgUrl: string;+ tag: string;+ isPublish: 0 | 1;+ createTime: string;+ updateTime: string;+}diff --git a/src/views/test/video/index.tsx b/src/views/test/video/index.tsxindex b6442143..3d137d6b 100644--- a/src/views/test/video/index.tsx+++ b/src/views/test/video/index.tsx@@ -5,40 +5,18 @@* @LastEditors: nevin* @Description: 视频测试*/-import VideoChoose from '@/components/Choose/VideoChoose';-import { ipcGetVideoCover } from '@/icp/tools';-import Update from '@/components/update';+import { operateApi } from '@/api/operate';import { Button } from 'antd';export default function Page() {- async function onChoose(e: any) {- console.log('---- ', e.videoPath);-- const res = await ipcGetVideoCover(e.videoPath);-- console.log('---- ', res);- }-- async function setChromPath() {- const res: string = await window.ipcRenderer.invoke(- 'ICP_SET_CHROMIUM_PATH',- );- console.log('---- ', res, '----');- }-- async function getChromPath() {- const res = await window.ipcRenderer.invoke('ICP_APP_GET_INFO');- console.log('---- ', res, '----');+ async function getBanner() {+ const res = await operateApi.getBannerList();+ console.log('----banner ', res);}return (<div>- <h1>视频测试</h1>- <VideoChoose onChoose={onChoose} />- 1111- <Update />- <Button onClick={getChromPath}>获取 Chromium 路径</Button>- <Button onClick={setChromPath}>设置 Chromium 路径</Button>+ <Button onClick={getBanner}>获取banner</Button></div>);}