Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
d45f0898
Commit
d45f0898
authored
Jan 15, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加聊天室登录错误信息解析
parent
36425e43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
...in/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
+8
-6
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MycardFragment.java
View file @
d45f0898
...
@@ -77,7 +77,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
...
@@ -77,7 +77,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
public
void
handleMessage
(
Message
msg
)
{
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
super
.
handleMessage
(
msg
);
if
(
msg
.
what
==
TYPE_MC_LOGIN
)
{
if
(
msg
.
what
==
TYPE_MC_LOGIN
)
{
McUser
mcUser
=
(
McUser
)
msg
.
obj
;
McUser
mcUser
=
(
McUser
)
msg
.
obj
;
if
(!
TextUtils
.
isEmpty
(
mcUser
.
getAvatar_url
()))
{
if
(!
TextUtils
.
isEmpty
(
mcUser
.
getAvatar_url
()))
{
GlideCompat
.
with
(
getActivity
()).
load
(
mcUser
.
getAvatar_url
()).
into
(
mHeadView
);
//刷新头像图片
GlideCompat
.
with
(
getActivity
()).
load
(
mcUser
.
getAvatar_url
()).
into
(
mHeadView
);
//刷新头像图片
}
}
...
@@ -348,7 +348,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
...
@@ -348,7 +348,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
@Override
@Override
public
void
onLogin
(
McUser
mcUser
,
String
exception
)
{
public
void
onLogin
(
McUser
mcUser
,
String
exception
)
{
if
(!
TextUtils
.
isEmpty
(
exception
)){
if
(!
TextUtils
.
isEmpty
(
exception
))
{
return
;
return
;
}
}
serviceManagement
.
disSerVice
();
//先退出当前账号,待TYPE_MC_LOGIN处重新执行start()
serviceManagement
.
disSerVice
();
//先退出当前账号,待TYPE_MC_LOGIN处重新执行start()
...
@@ -362,7 +362,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
...
@@ -362,7 +362,7 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
@Override
@Override
public
void
onUpdate
(
String
name
,
String
icon
,
String
statu
)
{
public
void
onUpdate
(
String
name
,
String
icon
,
String
statu
)
{
McUser
mcUser
=
new
McUser
();
McUser
mcUser
=
new
McUser
();
mcUser
.
setUsername
(
name
);
mcUser
.
setUsername
(
name
);
mcUser
.
setAvatar_url
(
icon
);
mcUser
.
setAvatar_url
(
icon
);
mcUser
.
setEmail
(
statu
);
mcUser
.
setEmail
(
statu
);
...
@@ -415,14 +415,16 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
...
@@ -415,14 +415,16 @@ public class MycardFragment extends BaseFragemnt implements View.OnClickListener
else
else
tv_message
.
setText
(
currentMessage
.
getName
()
+
":"
+
currentMessage
.
getMessage
());
tv_message
.
setText
(
currentMessage
.
getName
()
+
":"
+
currentMessage
.
getMessage
());
}
else
{
}
else
{
Log
.
e
(
"MyCardFragment"
,
"登录失败"
+
exception
);
Log
.
e
(
"MyCardFragment"
,
"登录失败"
+
exception
);
tv_message
.
setText
(
R
.
string
.
logining_failed
);
tv_message
.
setText
(
R
.
string
.
logining_failed
);
HandlerUtil
.
sendMessage
(
handler
,
TYPE_MC_LOGIN_FAILED
,
exception
);
HandlerUtil
.
sendMessage
(
handler
,
TYPE_MC_LOGIN_FAILED
,
exception
);
serviceManagement
.
setIsListener
(
false
);
serviceManagement
.
setIsListener
(
false
);
if
(
exception
.
endsWith
(
"not-authorized"
))
{
//如果弹这个exception基本上是账号没验证邮箱
if
(
exception
.
endsWith
(
"not-authorized"
))
{
//如果弹这个exception基本上是账号没验证邮箱
YGOUtil
.
show
(
getString
(
R
.
string
.
notice_verify_email
));
YGOUtil
.
show
(
getString
(
R
.
string
.
notice_verify_email
));
}
else
if
(
exception
.
endsWith
(
"No address associated with hostname"
))
{
//如果弹这个exception有可能是未授权连接网络或者没有连接网络
YGOUtil
.
show
(
getString
(
R
.
string
.
tip_no_netwrok
));
}
else
{
}
else
{
YGOUtil
.
show
(
getString
(
R
.
string
.
failed_reason
)
+
exception
);
YGOUtil
.
show
(
getString
(
R
.
string
.
mc_chat
)
+
getString
(
R
.
string
.
failed_reason
)
+
exception
);
}
}
}
}
}
}
...
...
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