Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
go-cqhttp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
go-cqhttp
Commits
1967e687
Commit
1967e687
authored
Aug 11, 2020
by
Mrs4s
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix perm error.
parent
23d43697
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
main.go
main.go
+4
-4
No files found.
main.go
View file @
1967e687
...
...
@@ -37,12 +37,12 @@ func init() {
log
.
SetOutput
(
io
.
MultiWriter
(
os
.
Stderr
,
w
))
}
if
!
global
.
PathExists
(
global
.
IMAGE_PATH
)
{
if
err
:=
os
.
MkdirAll
(
global
.
IMAGE_PATH
,
0677
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
global
.
IMAGE_PATH
,
os
.
ModePerm
);
err
!=
nil
{
log
.
Fatalf
(
"创建图片缓存文件夹失败: %v"
,
err
)
}
}
if
!
global
.
PathExists
(
global
.
VOICE_PATH
)
{
if
err
:=
os
.
MkdirAll
(
global
.
VOICE_PATH
,
06777
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
global
.
VOICE_PATH
,
os
.
ModePerm
);
err
!=
nil
{
log
.
Fatalf
(
"创建语音缓存文件夹失败: %v"
,
err
)
}
}
...
...
@@ -130,7 +130,7 @@ func main() {
if
!
global
.
PathExists
(
"device.json"
)
{
log
.
Warn
(
"虚拟设备信息不存在, 将自动生成随机设备."
)
client
.
GenRandomDevice
()
_
=
ioutil
.
WriteFile
(
"device.json"
,
client
.
SystemDeviceInfo
.
ToJson
(),
0777
)
_
=
ioutil
.
WriteFile
(
"device.json"
,
client
.
SystemDeviceInfo
.
ToJson
(),
os
.
ModePerm
)
log
.
Info
(
"已生成设备信息并保存到 device.json 文件."
)
}
else
{
log
.
Info
(
"将使用 device.json 内的设备信息运行Bot."
)
...
...
@@ -166,7 +166,7 @@ func main() {
if
!
rsp
.
Success
{
switch
rsp
.
Error
{
case
client
.
NeedCaptcha
:
_
=
ioutil
.
WriteFile
(
"captcha.jpg"
,
rsp
.
CaptchaImage
,
0677
)
_
=
ioutil
.
WriteFile
(
"captcha.jpg"
,
rsp
.
CaptchaImage
,
os
.
ModePerm
)
img
,
_
,
_
:=
image
.
Decode
(
bytes
.
NewReader
(
rsp
.
CaptchaImage
))
fmt
.
Println
(
asciiart
.
New
(
"image"
,
img
)
.
Art
)
log
.
Warn
(
"请输入验证码 (captcha.jpg): (Enter 提交)"
)
...
...
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