Skip to content

Commit

Permalink
fix: repair mysql query data syntax error 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyMrYan committed Jun 20, 2024
1 parent 67db9c7 commit c5435fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ router.get('/files', async (ctx) => {

const [rows] = await connection.execute(
`SELECT created_by, created_at, public_by, public_expiration, updated_at, updated_by, filesize, filename, filelocation, thumb_location, is_public FROM files WHERE is_delete = 0 AND is_public = 1 LIMIT ? OFFSET ?`,
[limit, offset]
[String(limit), String(offset)]
);

ctx.body = rows;
Expand Down
8 changes: 4 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<script>
const { createApp, ref, onMounted } = Vue;
const { ElTabs, ElTabPane, ElUpload, ElButton, ElMessage, ElSelect, ElOption, ElImage, ElLoading } = ElementPlus;

const PUBLIC_NETWORK_DOMAIN = 'http://localhost:3000';
createApp({
components: {
ElTabs, ElTabPane, ElUpload, ElButton, ElMessage, ElSelect, ElOption, ElImage, ElLoading
Expand All @@ -68,7 +68,7 @@
const fetchImages = async () => {
loading.value = true;
try {
const response = await fetch(`https://source.giao.club/files?type=${fileType.value}`);
const response = await fetch(`${PUBLIC_NETWORK_DOMAIN}/files?type=${fileType.value}`);
const data = await response.json();
images.value = data.map(file => ({
...file,
Expand All @@ -86,7 +86,7 @@
formData.append('file', file);

try {
const response = await fetch('https://source.giao.club/upload?type=md&compress=false&isThumb=true&isPublic=true', {
const response = await fetch(`${PUBLIC_NETWORK_DOMAIN}/upload?type=md&compress=false&isThumb=true&isPublic=true`, {
method: 'POST',
body: formData,
});
Expand Down Expand Up @@ -120,7 +120,7 @@
formData.append('file', file);

try {
const response = await fetch('https://source.giao.club/upload?type=md&compress=false&keepTemp=true&isThumb=true&isPublic=true', {
const response = await fetch(`${PUBLIC_NETWORK_DOMAIN}/upload?type=md&compress=false&keepTemp=true&isThumb=true&isPublic=true`, {
method: 'POST',
body: formData,
});
Expand Down

0 comments on commit c5435fc

Please sign in to comment.