🐛 Fix: add local path picbed into delete api of http server

This commit is contained in:
萌萌哒赫萝
2023-08-10 05:30:46 -07:00
parent 517348886c
commit f585bb4d7d
19 changed files with 228 additions and 262 deletions

View File

@@ -11,6 +11,7 @@ import axios from 'axios'
class Server {
private httpServer: http.Server
private config: IServerConfig
constructor () {
let config = picgo.getConfig<IServerConfig>('settings.server')
const result = this.checkIfConfigIsValid(config)
@@ -31,11 +32,7 @@ class Server {
}
private checkIfConfigIsValid (config: IObj | undefined) {
if (config && config.port && config.host && (config.enable !== undefined)) {
return true
} else {
return false
}
return config && config.port && config.host && (config.enable !== undefined)
}
private handleRequest = (request: http.IncomingMessage, response: http.ServerResponse) => {

View File

@@ -7,9 +7,9 @@ import windowManager from 'apis/app/window/windowManager'
import { uploadChoosedFiles, uploadClipboardFiles, deleteChoosedFiles } from 'apis/app/uploader/apis'
import path from 'path'
import { dbPathDir } from 'apis/core/datastore/dbChecker'
const STORE_PATH = dbPathDir()
const LOG_PATH = path.join(STORE_PATH, 'piclist.log')
// import AllAPI from '../../renderer/apis/allApi'
const errorMessage = `upload error. see ${LOG_PATH} for more detail.`
const deleteErrorMessage = `delete error. see ${LOG_PATH} for more detail.`