Commit 62293451 authored by yzl's avatar yzl

- 修改config.json路径问题

parent ded24a49
......@@ -156,9 +156,18 @@
useEffect(() => {
const getIp = () => {
const url = window.location.pathname;
let currentUrl = '';
if(url.indexOf('index.html') !== -1){
currentUrl = url.substring(0, url.indexOf('index.html'));
} else {
currentUrl = url;
}
$.ajax({
type: 'GET',
url: './config.json',
url: window.location.origin + currentUrl + '/config.json',
success: function(data) {
setIp(data.ip);
......
......@@ -203,9 +203,18 @@
}
const getIp = () => {
const url = window.location.pathname;
let currentUrl = '';
if(url.indexOf('index.html') !== -1){
currentUrl = url.substring(0, url.indexOf('index.html'));
} else {
currentUrl = url;
}
$.ajax({
type: 'GET',
url: './config.json',
url: window.location.origin + currentUrl + '/config.json',
success: function(data) {
setIp(data.ip);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment