fix
This commit is contained in:
		@@ -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>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										101
									
								
								src/App.vue
									
									
									
									
									
								
							
							
						
						
									
										101
									
								
								src/App.vue
									
									
									
									
									
								
							@@ -1,22 +1,24 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div id="app">
 | 
			
		||||
		<div class="loading" v-if="loading && cid_root">
 | 
			
		||||
			<vue-loading type="cylon" color="#fff700" :size="{ width: '50px', height: '50px' }"></vue-loading>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="loading_none" v-else>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="bsky_comment" v-if="cid_root">
 | 
			
		||||
			<span v-for="(i,index) in api_json_record" class="comment">
 | 
			
		||||
				<p class="comment-body" v-if="i.cid_root == cid_root">
 | 
			
		||||
					<span v-if="i.did.replace('did:plc:', '') != ''">
 | 
			
		||||
						<img src="/icon/null.jpg" v-if="loading" class="comment" >
 | 
			
		||||
						<img :src="'https://git.syui.ai/ai/comment/raw/branch/main/public/icon/' + i.did.replace('did:plc:', '') + '.jpg'" class="comment" @load="load" v-if="api_json_record.length - 1 == index">
 | 
			
		||||
						<img :src="'https://git.syui.ai/ai/comment/raw/branch/main/public/icon/' + i.did.replace('did:plc:', '') + '.jpg'" class="comment" v-else>
 | 
			
		||||
					</span>
 | 
			
		||||
					<span class="comment-time" v-if="i.updated_at && !loading"><a :href="i.bsky_url" v-if="i.bsky_url">{{ moment(i.updated_at) }}</a></span> <span class="comment-handle" v-if="i.handle && !loading"><a :href="'https://' + i.bsky_url.split('/').slice(2,5).join('/')" v-if="i.bsky_url">@{{ i.handle.replace('.bsky.social', '') }}</a></span>
 | 
			
		||||
					<span class="comment-text" v-if="i.text && !loading">{{ i.text }}</span>
 | 
			
		||||
				</p>
 | 
			
		||||
			</span>
 | 
			
		||||
	<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>
 | 
			
		||||
			<div class="loading_none" v-else>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="bsky_comment" v-if="cid_root">
 | 
			
		||||
				<span v-for="(i,index) in api_json_record" class="comment">
 | 
			
		||||
					<p class="comment-body" v-if="i.cid_root == cid_root">
 | 
			
		||||
						<span v-if="i.did.replace('did:plc:', '') != ''">
 | 
			
		||||
							<img src="/icon/null.jpg" v-if="loading" class="comment" >
 | 
			
		||||
							<img :src="'https://git.syui.ai/ai/comment/raw/branch/main/public/icon/' + i.did.replace('did:plc:', '') + '.jpg'" class="comment" @load="load" v-if="api_json_record.length - 1 == index">
 | 
			
		||||
							<img :src="'https://git.syui.ai/ai/comment/raw/branch/main/public/icon/' + i.did.replace('did:plc:', '') + '.jpg'" class="comment" v-else>
 | 
			
		||||
						</span>
 | 
			
		||||
						<span class="comment-time" v-if="i.updated_at && !loading"><a :href="i.bsky_url" v-if="i.bsky_url">{{ moment(i.updated_at) }}</a></span> <span class="comment-handle" v-if="i.handle && !loading"><a :href="'https://' + i.bsky_url.split('/').slice(2,5).join('/')" v-if="i.bsky_url">@{{ i.handle.replace('.bsky.social', '') }}</a></span>
 | 
			
		||||
						<span class="comment-text" v-if="i.text && !loading">{{ i.text }}</span>
 | 
			
		||||
					</p>
 | 
			
		||||
				</span>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -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,28 +96,33 @@ 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"){
 | 
			
		||||
				this.api_url = "/api/";
 | 
			
		||||
			} else {
 | 
			
		||||
				if (location.protocol !== "https:") {
 | 
			
		||||
					location.replace("https:" + location.href.substring(location.protocol.length));
 | 
			
		||||
				}
 | 
			
		||||
				this.api_url = "https://api.syui.ai";
 | 
			
		||||
			}
 | 
			
		||||
			let url = this.api_url + "/users/2/ma?itemsPerPage=4000";
 | 
			
		||||
			axios
 | 
			
		||||
				.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);
 | 
			
		||||
			} else if (this.host === "192.168.11.12:8080"){
 | 
			
		||||
					this.api_url = "/api/";
 | 
			
		||||
				} else {
 | 
			
		||||
					if (location.protocol !== "https:") {
 | 
			
		||||
						location.replace("https:" + location.href.substring(location.protocol.length));
 | 
			
		||||
					}
 | 
			
		||||
				);
 | 
			
		||||
					this.api_url = "https://api.syui.ai";
 | 
			
		||||
				}
 | 
			
		||||
				let url = this.api_url + "/users/2/ma?itemsPerPage=4000";
 | 
			
		||||
				axios
 | 
			
		||||
					.get(url,{ crossdomain: true })
 | 
			
		||||
					.then(
 | 
			
		||||
						response => {this.api_json = response
 | 
			
		||||
							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);
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					);
 | 
			
		||||
		}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -5,5 +5,5 @@ Vue.config.productionTip = false
 | 
			
		||||
 | 
			
		||||
new Vue({
 | 
			
		||||
  render: h => h(App)
 | 
			
		||||
}).$mount('#app')
 | 
			
		||||
}).$mount('#comment')
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user