feat:backup

This commit is contained in:
1708-huayu 2024-09-19 15:31:25 +08:00
parent 5d83324f50
commit e612aafb9c
9 changed files with 31 additions and 79 deletions

5
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

6
package-lock.json generated
View File

@ -34,7 +34,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"antd": "5.17.0",
"antd": "^5.17.0",
"axios": "^1.3.3",
"concurrently": "^4.1.1",
"craco-less": "^2.0.0",
@ -7423,6 +7423,10 @@
"scroll-into-view-if-needed": "^3.1.0",
"throttle-debounce": "^5.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/ant-design"
},
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"

View File

@ -19,7 +19,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"antd": "5.17.0",
"antd": "^5.17.0",
"axios": "^1.3.3",
"concurrently": "^4.1.1",
"craco-less": "^2.0.0",
@ -44,7 +44,7 @@
"yjs": ">=13.5.42"
},
"scripts": {
"dev": "concurrently \"wait-on http://localhost:3000 && electron-forge start\" \"cross-env BROWSER=none npm start\"",
"dev": "concurrently \"wait-on http://localhost:3000 && electron .\" \"cross-env BROWSER=none npm start\"",
"start": "craco start",
"build": "craco build",
"startel": "electron .",

View File

@ -14,7 +14,7 @@
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!-- 应用加壳 -->
<!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> -->
<title>送给最亲爱的小宝贝</title>
<title>Note</title>
<!--[if IE]>
<script src="js/html5.js"></script>
<![endif]-->

View File

@ -1,4 +1,4 @@
@import '~antd/dist/antd.less';
@import '~antd/dist/reset.css';
.ant-tree{
overflow: auto scroll;
height: 95.7%;

View File

@ -1,4 +1,4 @@
@import '~antd/dist/antd.less';
@import '~antd/dist/reset.css';
#components-grid-demo-playground [class~='ant-col'] {
background: transparent;

View File

@ -1,57 +0,0 @@
import { Button,InputNumber,message } from 'antd'
import React, { Component } from 'react'
import axios from 'axios'
import HistoryRecord from '../../components/HistoryRecord'
import { connect } from 'react-redux';
import { historyRecordSync } from '../../redux/historyRecord_reducer';
class SyncContext extends Component {
state={size:1}
eidtSyncContextSize=(event)=>{
this.setState({size:event})
}
historySync=(data)=>{
console.info("historySync(data)",data)
this.props.historyRecordSync(data)
}
syncContext = () => {
const key = 'SYNC_CONTEXT';
message.loading({content:'Loading...',key,duration:0});
axios.get(`/ticai/sync/context/${this.state.size}`)
.then(response => {
const result = response.data;
if (result.status.code === 200) {
console.log(result.data.length)
message.destroy(key)
message.success({
content: "成功同步"+result.data.length+"条",
duration: 2,
})
this.historySync(result.data)
} else {
message.destroy(key)
message.error(result.status.message)
}
})
.catch(function (error) {
message.destroy(key)
message.error(error)
})
}
render() {
return (
<div>
<span>同步最近</span><InputNumber min={1} max={10000} defaultValue={this.state.size} onChange={this.eidtSyncContextSize}/>条数据,
<Button onClick={this.syncContext}>确认</Button>.
<hr/>
<HistoryRecord/>
</div>
)
}
}
export default connect(
null,
// state => ({
// }),//
{historyRecordSync}//
)(SyncContext)

View File

@ -3,7 +3,7 @@ import historyReducer from './historyRecord_reducer'
import dirMessageReducer from './dirMessage_reducer'
import pushHotkeysReducer from "./pushHotkeys_reducer";
import tableBarItemReducer from "./tableBarItem_reducer";
import {electronStorage} from "../utils/LocalStorage";
import {electronStorage} from "@/utils/LocalStorage";
import { persistStore, persistReducer } from 'redux-persist'
// 持久化配置
const historyRecordPersistConfig = {

View File

@ -1,15 +1,15 @@
const {createProxyMiddleware} = require('http-proxy-middleware')
module.exports=function(app){
app.use(
createProxyMiddleware('/ticai',{
target:'http://localhost:8090/',
changeOrigin:false,
pathRewrite:{'^/ticai':''}
}),
createProxyMiddleware('/oauth',{
target:'http://localhost:1112',
changeOrigin:true,
pathRewrite:{'^/oauth':''}
})
)
}
// const {createProxyMiddleware} = require('http-proxy-middleware')
// module.exports=function(app){
// app.use(
// createProxyMiddleware('/ticai',{
// target:'http://localhost:8090/',
// changeOrigin:false,
// pathRewrite:{'^/ticai':''}
// }),
// createProxyMiddleware('/oauth',{
// target:'http://localhost:1112',
// changeOrigin:true,
// pathRewrite:{'^/oauth':''}
// })
// )
// }