加个配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> <script>
export default { export default {
mounted() { mounted() {
const cx = 'd0753b9ad66c34097';
const script = document.createElement('script'); 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; script.async = true;
document.body.appendChild(script); document.body.appendChild(script);
} }

View File

@ -9,7 +9,7 @@
</div> </div>
<footer> <footer>
<p> <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"> <a href="https://github.com/KoriIku/luxiry-search" target="_blank">
GitHub GitHub
</a> </a>
@ -27,7 +27,7 @@ export default {
methods: { methods: {
loadGoogleCSE() { loadGoogleCSE() {
const script = document.createElement('script'); 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; script.async = true;
document.head.appendChild(script); document.head.appendChild(script);
}, },