Skip to content

Commit

Permalink
修复文件上传问题
Browse files Browse the repository at this point in the history
后端替换了上传接口
  • Loading branch information
chenhb23 committed Jun 28, 2023
1 parent 7b62ca3 commit 96558c6
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 29 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"husky": "^4.3.0",
"lint-staged": "^12.4.1",
"react-scripts": "5.0.1",
"tailwindcss": "^3.3.2",
"typescript": "^4.6.4",
"wait-on": "^6.0.1",
"web-vitals": "^2.1.4"
Expand Down
19 changes: 0 additions & 19 deletions src/renderer/component/Header.css

This file was deleted.

5 changes: 2 additions & 3 deletions src/renderer/component/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from 'react'
import './Header.css'

export interface HeaderProps {
right?: React.ReactNode
}

export const MyHeader: React.FC<HeaderProps> = props => {
return (
<header className='header'>
<div className='child'>{props.children}</div>
<header className='px-3 flex justify-between items-center py-2'>
<div className='flex flex-1'>{props.children}</div>
{props.right && <div>{props.right}</div>}
</header>
)
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
6 changes: 4 additions & 2 deletions src/renderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import App from './App'
import AuthGate from './AuthGate'
import {ConfigProvider} from 'antd'
import zhCN from 'antd/lib/locale/zh_CN'
import * as DarkReader from 'darkreader'
import {auto} from 'darkreader'

DarkReader.auto({brightness: 100, contrast: 90, sepia: 10})
import './index.css'

auto({brightness: 100, contrast: 90, sepia: 10})

const root = ReactDOMClient.createRoot(document.getElementById('root'))
root.render(
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/store/task/UploadTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class UploadTask implements BaseTask {
const encoder = new FormDataEncoder(form)
return {
from: Readable.from(encoder),
to: http.request.stream.post('fileup.php', {headers: encoder.headers}),
to: http.request.stream.post('html5up.php', {headers: encoder.headers}),
}
}

Expand All @@ -171,6 +171,7 @@ function createUploadForm(subTask: UploadSubtask, taskIndex: number) {
: fs.createReadStream(sourceFile.path)

form.append('task', 1)
form.append('vie', 2)
form.append('ve', 2)
form.append('lastModifiedDate', new Date(sourceFile.lastModified))
form.append('type', type)
Expand Down
11 changes: 11 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
corePlugins: {
preflight: false,
},
}
Loading

0 comments on commit 96558c6

Please sign in to comment.