Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
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
sobot_android
Sobot_module_Dev
Commits
f49ab12b
Commit
f49ab12b
authored
Jan 12, 2024
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common 1.5.2 域名存到SobotSharedPreferencesUtil里边
parent
9b84aab8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
7 deletions
+33
-7
MainActivity.java
app/src/main/java/com/sobot/moduletest/MainActivity.java
+15
-2
build.gradle
sobot_common/build.gradle
+2
-2
sobot-common-publish-mavencentral.gradle
sobot_common/sobot-common-publish-mavencentral.gradle
+1
-1
SobotLoginTools.java
...src/main/java/com/sobot/common/login/SobotLoginTools.java
+15
-2
No files found.
app/src/main/java/com/sobot/moduletest/MainActivity.java
View file @
f49ab12b
...
...
@@ -9,6 +9,10 @@ import android.net.Uri;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.sobot.common.login.SobotLoginTools
;
import
com.sobot.common.login.callback.SobotResultBlock
;
import
com.sobot.common.login.callback.SobotResultCode
;
import
com.sobot.common.login.model.HostModel
;
import
com.sobot.common.utils.SobotImageUtils
;
import
com.sobot.pictureframe.SobotBitmapUtil
;
import
com.sobot.utils.SobotLogUtils
;
...
...
@@ -209,8 +213,15 @@ public class MainActivity extends SobotBaseActivity {
map1
.
put
(
"ack"
,
"1"
);
Map
<
String
,
String
>
headers1
=
new
HashMap
<>();
headers1
.
put
(
"language"
,
"zh"
);
// SobotLoginTools.getInstance().doAppLogin(MainActivity.this, MainActivity.this, "https://api-c.sobot.com/text","https://api-c.soboten.com/text", 8000, map1, headers1, new SobotResultBlock() {
// HostModel hostModel=null;
// hostModel= SobotLoginTools.getInstance().getHostInfo(MainActivity.this);
// if(hostModel==null){
// hostModel=new HostModel();
// hostModel.setHost("https://api-c.sobot.com");
// SobotLoginTools.getInstance().setHostInfo(MainActivity.this,hostModel);
// }
//
// SobotLoginTools.getInstance().doAppLogin(MainActivity.this, MainActivity.this, hostModel.getHost(),"https://api-c.soboten.com/text", 8000, map1, headers1, new SobotResultBlock() {
// @Override
// public void resultBolok(SobotResultCode code, String msg, Object obj) {
// SobotLoginTools.getInstance().checkExpiresToken();
...
...
@@ -219,6 +230,8 @@ public class MainActivity extends SobotBaseActivity {
// SobotLogUtils.i(SobotLoginTools.getInstance().getToken()+"");
// }
// });
// LoginUserEntity sa=new LoginUserEntity();
// sa.setLogin_time(System.currentTimeMillis());
// SobotLoginTools.getInstance().setLoginUser(sa);
...
...
sobot_common/build.gradle
View file @
f49ab12b
...
...
@@ -11,7 +11,7 @@ android {
//这里就是打jar包
task
makeJar
(
type:
Copy
)
{
//删除旧的jar包
delete
'build/libs/sobot_common_1.5.
1
.jar'
delete
'build/libs/sobot_common_1.5.
2
.jar'
//原地址
from
(
'build/intermediates/packaged-classes/release/'
)
//导出jar包的地址
...
...
@@ -19,7 +19,7 @@ android {
//包含的jar包
include
(
'classes.jar'
)
//重命名jar包为mysdk
rename
(
'classes.jar'
,
'sobot_common_1.5.
1
.jar'
)
rename
(
'classes.jar'
,
'sobot_common_1.5.
2
.jar'
)
}
makeJar
.
dependsOn
(
build
)
}
...
...
sobot_common/sobot-common-publish-mavencentral.gradle
View file @
f49ab12b
...
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext
{
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'sobotcommon_x'
//项目名
PUBLISH_VERSION
=
'1.5.
1
'
//版本号
PUBLISH_VERSION
=
'1.5.
2
'
//版本号
}
...
...
sobot_common/src/main/java/com/sobot/common/login/SobotLoginTools.java
View file @
f49ab12b
...
...
@@ -73,12 +73,25 @@ public class SobotLoginTools {
private
HostModel
mHostModel
;
//获取域名
public
HostModel
getHostInfo
()
{
public
HostModel
getHostInfo
(
Context
context
)
{
if
(
context
!=
null
&&
mHostModel
==
null
)
{
mHostModel
=
SobotSharedPreferencesUtil
.
getInstance
(
context
).
get
(
"app_login_host"
,
HostModel
.
class
);
}
return
mHostModel
;
}
public
void
setHostInfo
(
HostModel
newHostModel
)
{
public
void
setHostInfo
(
Context
context
,
HostModel
newHostModel
)
{
if
(
context
!=
null
&&
newHostModel
!=
null
)
{
if
((
newHostModel
.
getHost
().
contains
(
"test-branche1"
))
||
(
newHostModel
.
getHost
().
contains
(
"api-c.sobot.com"
)
||
newHostModel
.
getHost
().
contains
(
"api-c.soboten.com"
))
&&
(!
newHostModel
.
getHost
().
contains
(
"api-c.sobot.com/text"
)
&&
!
newHostModel
.
getHost
().
contains
(
"api-c.soboten.com/text"
)))
{
if
(!
newHostModel
.
getHost
().
endsWith
(
"/"
))
{
newHostModel
.
setHost
(
newHostModel
.
getHost
()
+
"/text/"
);
}
else
{
newHostModel
.
setHost
(
newHostModel
.
getHost
()
+
"text/"
);
}
}
mHostModel
=
newHostModel
;
SobotSharedPreferencesUtil
.
getInstance
(
context
).
put
(
"app_login_host"
,
newHostModel
);
}
}
//呼叫 v6 获取 accessToken
...
...
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