自动化立体仓库 - WMS系统
zhangchao
2024-11-04 59f80df1e377e8775969ca4acadfa2eadd6e37ae
src/main/java/com/zy/asrs/controller/AppVersionController.java
@@ -13,6 +13,7 @@
import com.zy.asrs.service.AppVersionService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.ClassUtils;
import org.springframework.web.bind.annotation.*;
@@ -20,12 +21,16 @@
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.*;
@RestController
public class AppVersionController extends BaseController {
    @Value("${server.port}")
    private String port;
    @Autowired
    private AppVersionService appVersionService;
@@ -218,4 +223,18 @@
            response.setStatus(404);
        }
    }
    @RequestMapping("/appVersion/downloadApp/getIp")
    public R qrDownload() {
        String ipAddress = "";
        String url = "";
        try {
            InetAddress inetAddress = InetAddress.getLocalHost();
            ipAddress = inetAddress.getHostAddress();
            System.out.println("本机IP地址:" + ipAddress);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        url = "http://" + ipAddress + ":" + port;
        return R.ok().add(url);
    }
}