fix
This commit is contained in:
parent
b979a790f1
commit
fb26e949ee
@ -12,7 +12,7 @@
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<div id="comment"></div>
|
||||
<script async src="https://embed.bsky.app/static/embed.js" charset="utf-8"></script>
|
||||
</body>
|
||||
<footer>© syui</footer>
|
||||
|
41
src/App.vue
41
src/App.vue
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<div id="comment">
|
||||
<div class="comment-root">
|
||||
<div class="loading" v-if="loading && cid_root">
|
||||
<vue-loading type="cylon" color="#fff700" :size="{ width: '50px', height: '50px' }"></vue-loading>
|
||||
</div>
|
||||
@ -19,6 +20,7 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -51,22 +53,24 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
host: window.location.host,
|
||||
loc: window.location.pathname,
|
||||
bsky_pds: "https://bsky.social/xrpc",
|
||||
bsky_handle: "yui.syui.ai",
|
||||
bsky_cursor: null,
|
||||
bsky_cursor: "",
|
||||
bsky_cid: "",
|
||||
bsky_json: null,
|
||||
api_url: null,
|
||||
api_json: null,
|
||||
api_json_record: null,
|
||||
cid_root: null,
|
||||
uri_root: null,
|
||||
bsky_json: "",
|
||||
api_url: "",
|
||||
api_json: "",
|
||||
api_json_record: "",
|
||||
blog: "",
|
||||
cid_root: "",
|
||||
uri_root: "",
|
||||
comment_open: false,
|
||||
comment_first: null,
|
||||
comment_first: "",
|
||||
loading: true,
|
||||
avatar_url: "",
|
||||
f: null,
|
||||
f: "",
|
||||
url_check: true,
|
||||
url: "/",
|
||||
products: [...Array(Number(page)).keys()],
|
||||
@ -92,11 +96,13 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (window.location.host === "localhost:8080") {
|
||||
if (this.host === "localhost:8080") {
|
||||
this.host = "manga.syui.ai";
|
||||
this.api_url = "/api/";
|
||||
} else if (window.location.host === "localhost:1313"){
|
||||
} else if (this.host === "localhost:1313"){
|
||||
this.host = "syui.ai";
|
||||
this.api_url = "https://api.syui.ai";
|
||||
} else if (window.location.host === "192.168.11.12:8080"){
|
||||
} else if (this.host === "192.168.11.12:8080"){
|
||||
this.api_url = "/api/";
|
||||
} else {
|
||||
if (location.protocol !== "https:") {
|
||||
@ -109,9 +115,12 @@ export default {
|
||||
.get(url,{ crossdomain: true })
|
||||
.then(
|
||||
response => {this.api_json = response
|
||||
this.cid_root = this.api_json.data.find((v) => v.blog_url == 'https://' + v.blog + loc).cid;
|
||||
this.uri_root = this.api_json.data.find((v) => v.blog_url == 'https://' + v.blog + loc).uri;
|
||||
this.api_json_record = this.api_json.data.filter((v) => v.cid_root == this.cid_root);
|
||||
const tmp = this.api_json.data.find((v) => v.blog_url == 'https://' + v.blog + loc);
|
||||
if (tmp !== undefined) {
|
||||
this.cid_root = this.api_json.data.find((v) => v.blog_url == 'https://' + v.blog + loc && v.blog === this.host).cid;
|
||||
this.uri_root = this.api_json.data.find((v) => v.blog_url == 'https://' + v.blog + loc && v.blog === this.host).uri;
|
||||
this.api_json_record = this.api_json.data.filter((v) => v.cid_root == this.cid_root && v.blog === this.host);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -5,5 +5,5 @@ Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
}).$mount('#comment')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user