Commit f49ab12b by zhengnw@sobot.com

common 1.5.2 域名存到SobotSharedPreferencesUtil里边

parent 9b84aab8
......@@ -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);
......
......@@ -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)
}
......
......@@ -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' //版本号
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment