Browse Source

2022.4.29

山水共长天一色 3 years ago
parent
commit
d83dac1719
1 changed files with 11 additions and 1 deletions
  1. 11 1
      fhKeeper/formulahousekeeper/timesheet/config/index.js

+ 11 - 1
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,9 +1,19 @@
 var path = require('path')
 
 //  var ip = '127.0.0.1'
-// var ip = '192.168.2.20'// var ip = '192.168.2.12'// var ip = '47.100.37.243' 
+// var ip = '192.168.2.21'
+// var ip = '192.168.2.12'// var ip = '47.100.37.243' 
 
+var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+for (var i in ifaces) {
+    for (var j in ifaces[i]) {
+        var val = ifaces[i][j]
+        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+            ip = val.address
+        }
+    }
 }
+
 module.exports = {
   build: {
     env: require('./prod.env'),