|
|
@@ -1,12 +1,15 @@
|
|
|
import express from 'express';
|
|
|
import cors from 'cors';
|
|
|
import axios from 'axios';
|
|
|
-import { NodeRSA } from 'node-rsa';
|
|
|
+import nodeRSA from 'node-rsa';
|
|
|
import cookieParser from 'cookie-parser';
|
|
|
import { readFileSync } from 'fs';
|
|
|
import { fileURLToPath } from 'url';
|
|
|
import { dirname, join } from 'path';
|
|
|
|
|
|
+// node-rsa 是 CommonJS 模块,需要使用默认导入
|
|
|
+const NodeRSA = nodeRSA;
|
|
|
+
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
|
const __dirname = dirname(__filename);
|
|
|
|