Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ppt_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Li Feifei
ppt_server
Commits
348b56ab
Commit
348b56ab
authored
Jul 08, 2021
by
周业恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update upload.go
parent
50ae7908
Pipeline
#15358
passed with stages
in 39 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
upload.go
upload/upload.go
+11
-9
No files found.
upload/upload.go
View file @
348b56ab
...
...
@@ -6,6 +6,10 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/astaxie/beego/orm"
"github.com/rocketlaunchr/go-pool"
"github.com/xxjwxc/gowp/workpool"
"image"
"image/jpeg"
"image/png"
...
...
@@ -22,19 +26,15 @@ import (
"regexp"
"strconv"
"strings"
"sync"
"time"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/astaxie/beego/orm"
"github.com/rocketlaunchr/go-pool"
"github.com/xxjwxc/gowp/workpool"
)
var
(
WEBURL
string
=
"http://offcn-live-svc"
//WEBURL
string = "https://
live.offcncloud.com"
client
*
http
.
Client
token
string
//WEBURL
string = "https://test-
live.offcncloud.com"
once
sync
.
Once
syncPool
pool
.
Pool
)
const
docUrl
string
=
"http://doc.offcncloud.com/"
...
...
@@ -335,13 +335,13 @@ func webToken() (*http.Client, string, error) {
if
err
!=
nil
{
return
&
http
.
Client
{},
""
,
err
}
log
.
Println
(
"获取token == "
,
map2
)
if
_
,
ok
:=
map2
[
"code"
];
!
ok
{
return
&
http
.
Client
{},
""
,
errors
.
New
(
"登录失败"
)
}
if
_
,
ok
:=
map2
[
"code"
]
.
(
float64
);
!
ok
{
return
&
http
.
Client
{},
""
,
errors
.
New
(
"登录失败"
)
}
if
int
(
map2
[
"code"
]
.
(
float64
))
==
200
{
//登录成功获取token
t_res
,
err
:=
client
.
Get
(
WEBURL
+
"/web/admin"
)
...
...
@@ -460,6 +460,7 @@ func CreateFileDataBase(room_file map[string]interface{}) error {
log
.
Println
(
err
)
return
err
}
log
.
Println
(
"room_files response = "
,
map2
)
if
_
,
ok
:=
map2
[
"code"
];
!
ok
{
...
...
@@ -526,6 +527,7 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte
defer
fc1
.
Close
()
return
imageInfo
,
bucket
.
PutObject
(
objectPathName
+
fileName
,
fc1
)
}
func
uploadPacked
(
bucket
*
oss
.
Bucket
,
filename
,
contentHash
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment