feat🔫: 修改部署脚本
This commit is contained in:
parent
1d928b8a23
commit
293df6e0a1
|
@ -1,8 +1,3 @@
|
|||
docker build . -t registry.cn-hangzhou.aliyuncs.com/fadinglight/bill-react:dev
|
||||
$server_path='fadinglight:/root/docker/caddy/site/www'
|
||||
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/fadinglight/bill-react:dev
|
||||
|
||||
ssh fadinglight "cd /root/docker/bill-sys/;
|
||||
docker compose down;
|
||||
docker pull registry.cn-hangzhou.aliyuncs.com/fadinglight/bill-react:dev;
|
||||
docker compose up -d"
|
||||
scp -r dist/* $server_path
|
|
@ -11,7 +11,7 @@ export async function getLabels() {
|
|||
return data.data
|
||||
}
|
||||
|
||||
export async function createBill(bill: IBill) {
|
||||
const data = await request.post(`/bill/`, bill)
|
||||
export async function postBills(bills: Array<IBill>) {
|
||||
const data = await request.post(`/bill/`, bills)
|
||||
return data.data
|
||||
}
|
|
@ -7,7 +7,7 @@ import { BillContext } from "../../store";
|
|||
import { observer } from "mobx-react-lite";
|
||||
import styles from "./Record.module.scss"
|
||||
import { BaseSelectRef } from "rc-select/lib/BaseSelect";
|
||||
import { createBill } from "../../api/bills";
|
||||
import { postBills } from "../../api/bills";
|
||||
|
||||
|
||||
function Record() {
|
||||
|
@ -117,16 +117,12 @@ function Record() {
|
|||
const [uploadLoading, setUploadLoading] = useState(false)
|
||||
const upload = async () => {
|
||||
setUploadLoading(true)
|
||||
const failures = []
|
||||
for (let bill of datasource) {
|
||||
datasource.forEach( it => Reflect.deleteProperty(it, "key"))
|
||||
try {
|
||||
const { id } = await createBill(bill)
|
||||
if (!id) failures.push(bill)
|
||||
} catch (e) {
|
||||
failures.push(bill)
|
||||
await postBills(datasource)
|
||||
setDataSource([])
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
setDataSource(failures)
|
||||
setUploadLoading(false)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { makeAutoObservable, runInAction } from "mobx";
|
||||
import { createContext } from "react";
|
||||
import { createBill, getBills, getLabels } from "../api/bills";
|
||||
import { postBills, getBills, getLabels } from "../api/bills";
|
||||
import { BillType, IBill } from "../model";
|
||||
import * as R from "ramda"
|
||||
import { BillLabel } from "./types";
|
||||
|
@ -110,7 +110,7 @@ export class Bill {
|
|||
|
||||
|
||||
async add(bill: IBill) {
|
||||
const { id } = await createBill(bill)
|
||||
const { id } = await postBills([bill])
|
||||
bill.id = id
|
||||
runInAction(() => {
|
||||
this._bills.push(bill);
|
||||
|
|
|
@ -7,7 +7,7 @@ export default defineConfig({
|
|||
server: {
|
||||
proxy: {
|
||||
"/api/": {
|
||||
target: "http://localhost:8080/api/v1/",
|
||||
target: "https://www.fadinglight.cn/api/",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user