Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
ca9f4d26
Commit
ca9f4d26
authored
Dec 12, 2018
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改默认登录方式
parent
dbbce67b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
14 deletions
+2
-14
src/main/java/tech/starwin/LibConfig.java
+0
-12
src/main/java/tech/starwin/utils/LoginManager.java
+1
-1
src/main/java/tech/starwin/utils/context_utils/AppInfoUtils.java
+1
-1
No files found.
src/main/java/tech/starwin/LibConfig.java
View file @
ca9f4d26
...
...
@@ -36,7 +36,6 @@ import zendesk.support.Support;
* 配置 BaseLibrary
*/
public
class
LibConfig
{
private
static
boolean
useDefaulLoginMode
=
true
;
//请求出现登录时是否使用默认的响应方式(跳转登录界面)
/**
* BuildConfig 数据
*/
...
...
@@ -219,15 +218,4 @@ public class LibConfig {
});
}
/**
* 清除默认的登录失效响应
*/
public
static
void
clearDefaultLoginMode
()
{
useDefaulLoginMode
=
false
;
}
public
static
boolean
isDefaultLoginMode
()
{
return
useDefaulLoginMode
;
}
}
src/main/java/tech/starwin/utils/LoginManager.java
View file @
ca9f4d26
...
...
@@ -62,7 +62,7 @@ public class LoginManager {
//广播通知
EventBus
.
getDefault
().
post
(
ActionEnum
.
LOGIN_INVALID
);
if
(
LibConfig
.
isDefaultLoginMode
(
))
{
if
(
!
TextUtils
.
isEmpty
(
LibConfig
.
LOGIN_ACTIVITY_ACTION
))
{
//跳转登录界面
if
(
isActionSupport
(
LibConfig
.
getContext
(),
LibConfig
.
LOGIN_ACTIVITY_ACTION
))
{
new
ActivityJumper
.
Builder
(
LibConfig
.
getContext
(),
LibConfig
.
LOGIN_ACTIVITY_ACTION
)
...
...
src/main/java/tech/starwin/utils/context_utils/AppInfoUtils.java
View file @
ca9f4d26
...
...
@@ -60,7 +60,7 @@ public class AppInfoUtils {
@SuppressLint
(
"MissingPermission"
)
public
static
String
getPhoneNumber
(
Context
context
)
{
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
context
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
String
[]
permissions
=
new
String
[]{
Manifest
.
permission
.
READ_SMS
,
Manifest
.
permission
.
READ_PHONE_NUMBERS
,
Manifest
.
permission
.
READ_PHONE_STATE
};
String
[]
permissions
=
new
String
[]{
Manifest
.
permission
.
READ_SMS
,
Manifest
.
permission
.
READ_PHONE_STATE
};
if
(
telephonyManager
!=
null
&&
PermissionsHelper
.
isGranted
(
context
,
permissions
))
{
return
telephonyManager
.
getLine1Number
();
}
else
{
...
...
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