Skip to content

Commit

Permalink
feat: 新增ip地址获取
Browse files Browse the repository at this point in the history
  • Loading branch information
shuxiaokai3 committed May 1, 2021
1 parent df1de1b commit aa60880
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/default.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ module.exports = {
"shelljs",
"ssh2",
"koa",
"internal-ip",
],
mainProcessFile: "src/main/index.js",
mainProcessWatch: ["src/main/index.js"],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"form-data": "^3.0.0",
"got": "^11.8.1",
"highlight.js": "^10.4.0",
"internal-ip": "^6.2.0",
"js-beautify": "^1.13.0",
"js-cookie": "^2.2.1",
"js-yaml": "^3.14.0",
Expand Down
8 changes: 8 additions & 0 deletions src/config/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

const packageJSON = require("../../package.json");

let ip = "127.0.0.1";

if (global && global.require) {
const internalIp = global.require("internal-ip");
ip = internalIp.v4.sync()
// console.log(, global.require)
}
//https://github.com/cheton/is-electron
//https://github.com/electron/electron/issues/2288
function isElectron() {
Expand Down Expand Up @@ -53,6 +60,7 @@ module.exports = {
mock: {
enabled: true,
port: 55555,
ip,
},
//全局组件配置
components: {
Expand Down

0 comments on commit aa60880

Please sign in to comment.