Skip to content

Commit c5435fc

Browse files
committed
fix: repair mysql query data syntax error 🐛
1 parent 67db9c7 commit c5435fc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ router.get('/files', async (ctx) => {
176176

177177
const [rows] = await connection.execute(
178178
`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 ?`,
179-
[limit, offset]
179+
[String(limit), String(offset)]
180180
);
181181

182182
ctx.body = rows;

public/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<script>
5353
const { createApp, ref, onMounted } = Vue;
5454
const { ElTabs, ElTabPane, ElUpload, ElButton, ElMessage, ElSelect, ElOption, ElImage, ElLoading } = ElementPlus;
55-
55+
const PUBLIC_NETWORK_DOMAIN = 'http://localhost:3000';
5656
createApp({
5757
components: {
5858
ElTabs, ElTabPane, ElUpload, ElButton, ElMessage, ElSelect, ElOption, ElImage, ElLoading
@@ -68,7 +68,7 @@
6868
const fetchImages = async () => {
6969
loading.value = true;
7070
try {
71-
const response = await fetch(`https://source.giao.club/files?type=${fileType.value}`);
71+
const response = await fetch(`${PUBLIC_NETWORK_DOMAIN}/files?type=${fileType.value}`);
7272
const data = await response.json();
7373
images.value = data.map(file => ({
7474
...file,
@@ -86,7 +86,7 @@
8686
formData.append('file', file);
8787

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

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

0 commit comments

Comments
 (0)