加个配cx的地方

This commit is contained in:
KoriIku 2024-10-08 02:00:08 +08:00
parent 239fd11800
commit 5cffbd4990
3 changed files with 5 additions and 4 deletions

2
.env Normal file
View File

@ -0,0 +1,2 @@
# .env
VITE_GOOGLE_CSE_CX=d0753b9ad66c34097

View File

@ -25,9 +25,8 @@
<script>
export default {
mounted() {
const cx = 'd0753b9ad66c34097';
const script = document.createElement('script');
script.src = `https://cse.google.com/cse.js?cx=${cx}`;
script.src = `https://cse.google.com/cse.js?cx=${import.meta.env.VITE_GOOGLE_CSE_CX}`;
script.async = true;
document.body.appendChild(script);
}

View File

@ -9,7 +9,7 @@
</div>
<footer>
<p>
&copy; Create by <a href="https://github.com/KoriIku">Luxirty</a> with love |
&copy; Create by <a href="https://github.com/KoriIku">Luxirty</a> with &hearts; |
<a href="https://github.com/KoriIku/luxiry-search" target="_blank">
GitHub
</a>
@ -27,7 +27,7 @@ export default {
methods: {
loadGoogleCSE() {
const script = document.createElement('script');
script.src = "https://cse.google.com/cse.js?cx=d0753b9ad66c34097";
script.src = `https://cse.google.com/cse.js?cx=${import.meta.env.VITE_GOOGLE_CSE_CX}`;
script.async = true;
document.head.appendChild(script);
},