Browse Source

调整样式代码

master
xyiege 4 months ago
parent
commit
9c35f17eb9
  1. 15
      scagent/core/FileRpc.go
  2. 2
      vue/afvue/src/views/Sfilecompare.vue
  3. 10
      vue/afvue/vite.config.js

15
scagent/core/FileRpc.go

@ -44,7 +44,7 @@ type ZipBlock struct {
// 处理文件上传
// dirpath 目标文件存放位置
func (f *FileService) Upload(stream pb.FileUploadService_UploadFileServer, dirpath string) error {
func (f *FileService) UploadFile(stream pb.FileUploadService_UploadFileServer, dirpath string) error {
var (
file *os.File
fileInfo *pb.FileInfo
@ -176,11 +176,11 @@ func clientUploadFile(remote string, filePath string, uploadPath string) error {
defer conn.Close()
client := pb.NewFileUploadServiceClient(conn)
// 调用RPC方法
stream, err := client.UploadFile(context.Background())
if err != nil {
logger.Error("clientUploadFile", zap.String("msg", "无法创建上传流"), zap.Error(err))
return err
}
// stream, err := client.UploadFile(context.Background())
// if err != nil {
// logger.Error("clientUploadFile", zap.String("msg", "无法创建上传流"), zap.Error(err))
// return err
// }
// 打开文件
file, err := os.Open(filePath)
@ -209,7 +209,8 @@ func clientUploadFile(remote string, filePath string, uploadPath string) error {
fileInfo.Name(), fileInfo.Size(), totalChunks)
// 创建流式上传
stream, err = client.UploadFile(context.Background())
// eg 函数为 远程的调用函数
stream, err := client.UploadFile(context.Background(), uploadPath)
if err != nil {
logger.Error("clientUploadFile", zap.String("msg", "无法创建上传流"), zap.Error(err))
return err

2
vue/afvue/src/views/Sfilecompare.vue

@ -379,7 +379,7 @@ export default {
float: left;
width: 100%;
min-height: 560px;
margin-bottom: 40px;
}
.sfcon:first-child {

10
vue/afvue/vite.config.js

@ -14,6 +14,16 @@ export default defineConfig({
// additionalLegacyPolyfills: ['regenerator-runtime/runtime']
// })
],
// js文件大小限制
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
nested: resolve(__dirname, 'nested/index.html')
}
},
chunkSizeWarningLimit: 1000
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))

Loading…
Cancel
Save