master
鲁誉程 9 months ago
parent adbca9fd27
commit 5828176158

@ -5,7 +5,7 @@ const cors = require('cors');
const bodyParser = require('body-parser');
const app = express();
const port = 8081; // 可以根据需要修改端口号
const port = 3000; // 可以根据需要修改端口号
app.use(cors());
app.use(bodyParser.json());
@ -46,14 +46,6 @@ app.post('/createShortcut', (req, res) => {
});
});
// 静态文件服务,指定 dist 目录为静态文件目录
app.use(express.static(path.join(__dirname, 'dist')));
// 所有请求都返回 index.html 文件,让前端路由处理页面跳转
app.get('*', function(req, res) {
res.sendFile(path.join(__dirname, 'dist', 'index.html'));
});
// 运行项目 需要进入到当前的文件夹目录打开终端 执行 node nodeService.js
app.listen(port, () => {
console.log(`Server is running on port ${port}`);

@ -60,7 +60,7 @@ const PowerOnAuth: FC<PageProps> = ({ }) => {
// 在指定的目录下安装快捷方式
const installSuccess = async () => {
try {
const response = await fetch('http://127.0.0.1:8081/createShortcut', {
const response = await fetch('http://127.0.0.1:3000/createShortcut', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
mode: "cors",

@ -59,7 +59,7 @@ const CodeManage: FC<PageProps> = ({
// 在指定的目录下安装快捷方式
const installSuccess = async () => {
try {
const response = await fetch('http://127.0.0.1:8081/createShortcut', {
const response = await fetch('http://127.0.0.1:3000/createShortcut', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
mode: "cors",

@ -69,7 +69,7 @@ const CoreArea: FC<PageProps> = ({
// 在指定的目录下安装快捷方式
const installSuccess = async () => {
try {
const response = await fetch('http://127.0.0.1:8081/createShortcut', {
const response = await fetch('http://127.0.0.1:3000/createShortcut', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
mode: "cors",

@ -69,7 +69,7 @@ const DutyArea: FC<PageProps> = ({
// 在指定的目录下安装快捷方式
const installSuccess = async () => {
try {
const response = await fetch('http://127.0.0.1:8081/createShortcut', {
const response = await fetch('http://127.0.0.1:3000/createShortcut', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
mode: "cors",

@ -6,7 +6,7 @@ export const DEV = {
// 更新到线上屏蔽上面内容开放下面内容
PROXY_SERVER: 'http://127.0.0.1:8088',
LOCAL_URL: 'http://127.0.0.1:8081',
LOCAL_URL: 'http://127.0.0.1:8000',
FILE_URL: '/home/headless/Desktop',
HARD_CODE: true,
};

Loading…
Cancel
Save