mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
🎨 切换回通过 IP 127.0.0.1 加载 https://github.com/siyuan-note/siyuan/issues/6381
This commit is contained in:
parent
9dd6ac48de
commit
20ab9dd5a9
8 changed files with 10 additions and 10 deletions
|
|
@ -100,7 +100,7 @@
|
||||||
return new Promise(resolve => setTimeout(resolve, ms))
|
return new Promise(resolve => setTimeout(resolve, ms))
|
||||||
}
|
}
|
||||||
const redirect = () => {
|
const redirect = () => {
|
||||||
const uri = 'http://localhost:' + location.port
|
const uri = 'http://127.0.0.1:' + location.port
|
||||||
if (navigator.userAgent.match(/Android/i))
|
if (navigator.userAgent.match(/Android/i))
|
||||||
document.location = uri
|
document.location = uri
|
||||||
else
|
else
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
let progressing = false
|
let progressing = false
|
||||||
while (!progressing) {
|
while (!progressing) {
|
||||||
try {
|
try {
|
||||||
const progressResult = await fetch('http://localhost:' + location.port + '/api/system/bootProgress')
|
const progressResult = await fetch('http://127.0.0.1:' + location.port + '/api/system/bootProgress')
|
||||||
const progressData = await progressResult.json()
|
const progressData = await progressResult.json()
|
||||||
document.getElementById('progress').style.width = progressData.data.progress + '%'
|
document.getElementById('progress').style.width = progressData.data.progress + '%'
|
||||||
document.getElementById('details').textContent = progressData.data.details
|
document.getElementById('details').textContent = progressData.data.details
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ let siyuanOpenURL
|
||||||
let firstOpen = false
|
let firstOpen = false
|
||||||
let resetWindowStateOnRestart = false
|
let resetWindowStateOnRestart = false
|
||||||
let kernelPort = "6806"
|
let kernelPort = "6806"
|
||||||
const localhost = "localhost"
|
const localhost = "127.0.0.1"
|
||||||
require('@electron/remote/main').initialize()
|
require('@electron/remote/main').initialize()
|
||||||
|
|
||||||
if (!app.requestSingleInstanceLock()) {
|
if (!app.requestSingleInstanceLock()) {
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
{
|
{
|
||||||
"Type": "NodeTextMark",
|
"Type": "NodeTextMark",
|
||||||
"TextMarkType": "code",
|
"TextMarkType": "code",
|
||||||
"TextMarkTextContent": "localhost"
|
"TextMarkTextContent": "127.0.0.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
{
|
{
|
||||||
"Type": "NodeTextMark",
|
"Type": "NodeTextMark",
|
||||||
"TextMarkType": "code",
|
"TextMarkType": "code",
|
||||||
"TextMarkTextContent": "localhost"
|
"TextMarkTextContent": "127.0.0.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
{
|
{
|
||||||
"Type": "NodeTextMark",
|
"Type": "NodeTextMark",
|
||||||
"TextMarkType": "code",
|
"TextMarkType": "code",
|
||||||
"TextMarkTextContent": "localhost"
|
"TextMarkTextContent": "127.0.0.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Type": "NodeText",
|
"Type": "NodeText",
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ export const about = {
|
||||||
<span class="b3-label__text"><code class="fn__code">${window.siyuan.config.localIPs.join("</code> <code class='fn__code'>")}</code></span>
|
<span class="b3-label__text"><code class="fn__code">${window.siyuan.config.localIPs.join("</code> <code class='fn__code'>")}</code></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="fn__space"></div>
|
<div class="fn__space"></div>
|
||||||
<button data-type="open" data-url="http://${window.siyuan.config.system.networkServe ? window.siyuan.config.localIPs[0] : "localhost"}:${location.port}" class="b3-button b3-button--outline fn__size200 fn__flex-center">
|
<button data-type="open" data-url="http://${window.siyuan.config.system.networkServe ? window.siyuan.config.localIPs[0] : "127.0.0.1"}:${location.port}" class="b3-button b3-button--outline fn__size200 fn__flex-center">
|
||||||
<svg><use xlink:href="#iconLink"></use></svg>${window.siyuan.languages.about4}
|
<svg><use xlink:href="#iconLink"></use></svg>${window.siyuan.languages.about4}
|
||||||
</button>
|
</button>
|
||||||
</label>
|
</label>
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ ${accountHTML}
|
||||||
closePanel();
|
closePanel();
|
||||||
if (!window.siyuan.config.localIPs || window.siyuan.config.localIPs.length === 0 ||
|
if (!window.siyuan.config.localIPs || window.siyuan.config.localIPs.length === 0 ||
|
||||||
(window.siyuan.config.localIPs.length === 1 && window.siyuan.config.localIPs[0] === "")) {
|
(window.siyuan.config.localIPs.length === 1 && window.siyuan.config.localIPs[0] === "")) {
|
||||||
window.siyuan.config.localIPs = ["localhost"];
|
window.siyuan.config.localIPs = ["127.0.0.1"];
|
||||||
}
|
}
|
||||||
modelElement.style.top = "0";
|
modelElement.style.top = "0";
|
||||||
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconInfo"></use>';
|
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconInfo"></use>';
|
||||||
|
|
@ -193,7 +193,7 @@ ${accountHTML}
|
||||||
<div class="b3-label">
|
<div class="b3-label">
|
||||||
${window.siyuan.languages.about2}
|
${window.siyuan.languages.about2}
|
||||||
<div class="fn__hr"></div>
|
<div class="fn__hr"></div>
|
||||||
<input class="b3-text-field fn__block" readonly value="http://${window.siyuan.config.system.networkServe ? window.siyuan.config.localIPs[0] : "localhost"}:${location.port}">
|
<input class="b3-text-field fn__block" readonly value="http://${window.siyuan.config.system.networkServe ? window.siyuan.config.localIPs[0] : "127.0.0.1"}:${location.port}">
|
||||||
<div class="b3-label__text">${window.siyuan.languages.about3.replace("${port}", location.port)}</div>
|
<div class="b3-label__text">${window.siyuan.languages.about3.replace("${port}", location.port)}</div>
|
||||||
<div class="fn__hr"></div>
|
<div class="fn__hr"></div>
|
||||||
<span class="b3-label__text"><code class="fn__code">${window.siyuan.config.localIPs.join("</code> <code class='fn__code'>")}</code></span>
|
<span class="b3-label__text"><code class="fn__code">${window.siyuan.config.localIPs.join("</code> <code class='fn__code'>")}</code></span>
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,7 @@ const (
|
||||||
ContainerAndroid = "android" // Android 端
|
ContainerAndroid = "android" // Android 端
|
||||||
ContainerIOS = "ios" // iOS 端
|
ContainerIOS = "ios" // iOS 端
|
||||||
|
|
||||||
LocalHost = "localhost" // 本地域名,由操作系统自动解析到 127.0.0.1
|
LocalHost = "127.0.0.1" // 伺服地址
|
||||||
FixedPort = "6806" // 固定端口
|
FixedPort = "6806" // 固定端口
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue