Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
WeiPanAPI
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
Discuz
WeiPanAPI
Commits
36904722
Commit
36904722
authored
May 12, 2021
by
xiongyuwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e915a044
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
WeiPanService.cs
src/Bailun.Discuz.Application/WeiPan/WeiPanService.cs
+23
-5
No files found.
src/Bailun.Discuz.Application/WeiPan/WeiPanService.cs
View file @
36904722
...
...
@@ -427,6 +427,8 @@ namespace Bailun.Discuz.Application.WeiPan
public
async
Task
<
string
>
GetViewFile
(
string
userId
,
string
fileId
,
string
md5
,
string
fileName
)
{
string
fileUrl
=
""
;
try
{
// string fileUrl =(await GetFileUrl(md5))?.QiniuUrl;
//if (fileUrl == null)
// {
...
...
@@ -444,8 +446,18 @@ namespace Bailun.Discuz.Application.WeiPan
Dictionary
<
string
,
string
>
parameters
=
new
Dictionary
<
string
,
string
>();
CookieContainer
cookieContainer
=
new
CookieContainer
();
Cookie
cookie
=
new
Cookie
(
apiOutput
.
cookie_name
,
apiOutput
.
cookie_value
);
var
domain
=
apiOutput
.
download_url
.
IndexOf
(
"com/"
);
cookie
.
Domain
=
apiOutput
.
download_url
.
Substring
(
8
,
domain
-
5
);
//var domain = apiOutput.download_url.IndexOf("com/");
//if (domain > -1)
//{
// cookie.Domain = apiOutput.download_url.Substring(8, domain - 5);
//}
//else
//{
// cookie.Domain ="szfront.wxwork.qq.com";
//}
Uri
uri
=
new
Uri
(
apiOutput
.
download_url
);
cookie
.
Domain
=
uri
.
Host
;
cookieContainer
.
Add
(
cookie
);
// 加入Cookie
HttpClientHandler
httpClientHandler
=
new
HttpClientHandler
()
{
...
...
@@ -481,7 +493,13 @@ namespace Bailun.Discuz.Application.WeiPan
{
throw
new
Exception
(
apiOutput
.
errmsg
);
}
// }
// }
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
$"上传七牛云失败,失败原因:
{
ex
.
Message
}
"
);
}
return
fileUrl
;
}
...
...
@@ -665,11 +683,11 @@ namespace Bailun.Discuz.Application.WeiPan
// string userId = "chenzekai";
List
<
WeiPanFileList
>
inserWeiPanFileList
=
new
List
<
WeiPanFileList
>();
//1:获取线上的所有文档数据
var
filList
=
await
GetFileList
(
userId
,
companyName
);
var
filList
=
await
GetFileList
(
userId
,
companyName
);
//调试注释
//string value = "测试数据";
//RedisHelper.Set("key", filList);
//
List<WeiPanFileList> filList = RedisHelper.Get<List<WeiPanFileList>>("key");
//
List<WeiPanFileList> filList = RedisHelper.Get<List<WeiPanFileList>>("key");
//filList.RemoveAt(1);
//2:判断当前fileid是否存在于数据库中, 如果不存在则添加
foreach
(
var
file
in
filList
)
...
...
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