Skip to content

Commit

Permalink
fix: localhost => 127.0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Jul 24, 2024
1 parent a499738 commit a23ff38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/server/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class MainServer {
private async checkServerIsReady(logError: boolean = false) {
try {
await new Promise((resolve, reject) => {
const res = get(`http://localhost:${this.port}/api/v1/info`, (resp) => {
const res = get(`http://127.0.0.1:${this.port}/api/v1/info`, (resp) => {
log.info('check server api status: ', resp.statusCode);
let data = '';
// A chunk of data has been recieved.
Expand Down
2 changes: 1 addition & 1 deletion src/main/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import log from '../utils/log';
export class PathnameStore {
public static PROTOCOL = 'http';
private static defaultPathname: string = 'index.html';
private static hostname: string = 'localhost';
private static hostname: string = '127.0.0.1';
public static pathname: string = PathnameStore.defaultPathname;
public static hash: string = '';

Expand Down
2 changes: 1 addition & 1 deletion src/main/windows/mainWeb/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function newWindowEvent(mainWindow: BrowserWindow) {
mainWindow.on('close', (e) => {
log.warn(`webcontent close, url: ${mainWindow.webContents.getURL()}`);
const url = mainWindow.webContents?.getURL();
if (url.includes('localhost') && !url.includes('help-doc')) {
if (url.includes('127.0.0.1') && !url.includes('help-doc')) {
/**
* odc workspace confirm
*/
Expand Down

0 comments on commit a23ff38

Please sign in to comment.