-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy path360test.js
44 lines (33 loc) · 1.54 KB
/
360test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as drpy from '../libs/drpyS.js';
import path from 'path';
import {fileURLToPath} from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
console.log('__dirname:', __dirname);
(async () => {
// 使用 __dirname 来确保正确的相对路径,避免路径出错
const modulePath = path.join(__dirname, '../js/_360.js');
try {
console.log('Initializing module...');
const module = await drpy.init(modulePath); // 初始化模块
console.log('Calling home...');
const result1 = await drpy.home(modulePath); // 调用 home 方法
console.log('Calling homeVod...');
const result2 = await drpy.homeVod(modulePath); // 调用 homeVod 方法
console.log('Calling cate...');
const result3 = await drpy.cate(modulePath); // 调用 cate 方法
console.log('Calling detail...');
const result4 = await drpy.detail(modulePath); // 调用 detail 方法
console.log('Calling search...');
const result5 = await drpy.search(modulePath); // 调用 search 方法
console.log('Calling play...');
const result6 = await drpy.play(modulePath); // 调用 play 方法
console.log('Result1:', result1);
console.log('Result2:', result2);
console.log('Result3:', result3);
console.log('Result4:', result4);
console.log('Result5:', result5);
console.log('Result6:', result6);
} catch (error) {
console.log('Error during module initialization or invocation:', error);
}
})();