Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 测试页面
yikaJasonMic0e4a3e6ef8e2
diff --git a/electron/main/test/controller.ts b/electron/main/test/controller.tsindex b8c5d062..f56046f9 100644--- a/electron/main/test/controller.ts+++ b/electron/main/test/controller.ts@@ -1,7 +1,7 @@/** @Author: nevin* @Date: 2025-01-20 22:02:54- * @LastEditTime: 2025-03-03 13:45:00+ * @LastEditTime: 2025-04-01 16:11:14* @LastEditors: nevin* @Description: Test test*/@@ -10,9 +10,7 @@ import { TestService } from './service';import { douyinService } from '../../plat/douyin/index';import { xiaohongshuService } from '../../plat/xiaohongshu/index';import { shipinhaoService } from '../../plat/shipinhao/index';--const videoPath = 'C:\\Users\\Administrator\\Desktop\\测试用的\\相册.mp4';-const coverPath = 'C:\\Users\\Administrator\\Desktop\\测试用的\\gile.jpg';+import { FileUtils } from '../../util/file';@Controller()export class TestController {@@ -22,21 +20,14 @@ export class TestController {/*** 测试-抖音登录*/- @Icp('ICP_TEST_DOUYIN_LOGIN')- async testDouyinVideoLogin(event: Electron.IpcMainInvokeEvent): Promise<any> {- const { success, data } = await douyinService.loginOrView('login');- if (!data) {- return {- cookie: '',- token: '',- };- }-- const { cookie, localStorage } = data;- return {- cookie,- token: localStorage,- };+ @Icp('ICP_GET_FILE_MATE_INFO')+ async testDouyinVideoLogin(+ event: Electron.IpcMainInvokeEvent,+ path: string,+ ): Promise<any> {+ const res = await FileUtils.getFileInfo(path);+ console.log('---- res ----', res);+ return res;}/**diff --git a/electron/plat/xiaohongshu/index.ts b/electron/plat/xiaohongshu/index.tsindex 0e024d1a..20975d98 100644--- a/electron/plat/xiaohongshu/index.ts+++ b/electron/plat/xiaohongshu/index.ts@@ -1380,12 +1380,12 @@ export class XiaohongshuService {async getSearchNodeList(cookie: string, qe: string, page: number = 0) {const url = `/api/sns/web/v1/search/notes`;- function L() {- var t, e = 2147483646;- var a = BigInt(Date.now())- , u = BigInt(Math.ceil(Math.random() * e));- return a <<= BigInt(64),- (a += u).toString(36)+ function l() {+ let t,+ e = 2147483646;+ let a = BigInt(Date.now()),+ u = BigInt(Math.ceil(Math.random() * e));+ return (a <<= BigInt(64)), (a += u).toString(36);}console.log('------ getSearchNodeList --- asdadsda::', qe, page, l());diff --git a/src/router/index.tsx b/src/router/index.tsxindex cf5590ac..c07152f3 100644--- a/src/router/index.tsx+++ b/src/router/index.tsx@@ -1,7 +1,7 @@/** @Author: nevin* @Date: 2025-02-10 22:20:15- * @LastEditTime: 2025-03-18 22:27:20+ * @LastEditTime: 2025-04-01 15:58:37* @LastEditors: nevin* @Description:*/@@ -46,6 +46,7 @@ import UserWalletRecord from '@/views/finance/userWalletRecord';import Reply from '@/views/reply';import Replyother from '@/views/replyother';import ErrorBoundary from '../components/ErrorBoundary/ErrorBoundary';+import Test from '@/views/test';interface IRouterMeta {// 路由名称@@ -145,6 +146,11 @@ export const router: CustomRouteObject[] = [{ path: 'userWalletAccount', element: <UserWalletAccount /> },],},+ {+ path: '/test',+ element: <Test />,+ meta: { name: '测试', icon: ShopOutlined },+ },],},{ path: '/login', element: <Login /> },diff --git a/src/views/test/index.tsx b/src/views/test/index.tsxnew file mode 100644index 00000000..a38000f5--- /dev/null+++ b/src/views/test/index.tsx@@ -0,0 +1,53 @@+/*+ * @Author: nevin+ * @Date: 2025-02-10 22:20:15+ * @LastEditTime: 2025-04-01 16:15:14+ * @LastEditors: nevin+ * @Description: 测试页面+ */+import { useState } from 'react';+import VideoChoose, { IVideoFile } from '@/components/Choose/VideoChoose';+import { Button } from 'antd';+import { PlusOutlined } from '@ant-design/icons';++export default function Text() {+ const [videoPath, setVideoPath] = useState('');++ function addVideos(videoFiles: IVideoFile[]) {+ const theVideoPath = videoFiles[0].videoPath;+ console.log('--------- theVideoPath', theVideoPath);+ setVideoPath(theVideoPath);+ }++ async function getFileMateInfo() {+ const res = await window.ipcRenderer.invoke(+ 'ICP_GET_FILE_MATE_INFO',+ videoPath,+ );+ console.log('---- res ----', res);+ }++ return (+ <div>+ <VideoChoose+ onMultipleChoose={(videoFiles) => {+ addVideos(videoFiles);+ }}+ onStartShoose={() => {}}+ onChooseFail={() => {}}+ >+ <Button type="dashed" icon={<PlusOutlined />}>+ 批量添加+ </Button>+ </VideoChoose>++ <Button+ onClick={() => {+ getFileMateInfo();+ }}+ >+ 获取文件信息+ </Button>+ </div>+ );+}