Commit 5fc07d16 by 罗翻

增加uat环境

parent 568bf94e
...@@ -10,7 +10,6 @@ import android.os.Handler; ...@@ -10,7 +10,6 @@ import android.os.Handler;
import com.dayu.bigfish.utils.HxManager; import com.dayu.bigfish.utils.HxManager;
import com.dayu.common.BaseApplication; import com.dayu.common.BaseApplication;
import com.dayu.common.Constants;
import com.dayu.location.base.LocationUtils; import com.dayu.location.base.LocationUtils;
import com.dayu.order.greendao.GreenDaoManager; import com.dayu.order.greendao.GreenDaoManager;
import com.dayu.utils.NetworkConnectChangedReceiver; import com.dayu.utils.NetworkConnectChangedReceiver;
...@@ -63,7 +62,6 @@ public class MyApplication extends BaseApplication { ...@@ -63,7 +62,6 @@ public class MyApplication extends BaseApplication {
* 初始化友盟. * 初始化友盟.
*/ */
private void initUM() { private void initUM() {
MobclickAgent.setDebugMode(Constants.IS_DEBUG);
UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null); UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
UMConfigure.setLogEnabled(true); UMConfigure.setLogEnabled(true);
UMConfigure.setEncryptEnabled(true); UMConfigure.setEncryptEnabled(true);
...@@ -89,8 +87,4 @@ public class MyApplication extends BaseApplication { ...@@ -89,8 +87,4 @@ public class MyApplication extends BaseApplication {
public static Context getContext() { public static Context getContext() {
return mContext; return mContext;
} }
public static synchronized MyApplication context() {
return (MyApplication) mContext;
}
} }
...@@ -39,9 +39,9 @@ dependencies { ...@@ -39,9 +39,9 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
compile 'com.android.support:design:26.1.0' compile 'com.android.support:design:27.1.0'
//mutidex //mutidex
compile 'com.android.support:multidex:1.0.2' compile 'com.android.support:multidex:1.0.3'
//eventBus //eventBus
compile 'org.greenrobot:eventbus:3.1.1' compile 'org.greenrobot:eventbus:3.1.1'
//retrofit //retrofit
......
##rel
BASE_URL="https://mobile.dayu.ai"
UP_PHOTO="/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply"
WEB_SOP="https://sop.kf.ai/#/sop"
WEB_ZHI_SHI = "https://sop.kf.ai/#/detail"
LOG_LEVEL=0
IS_DEBUG = ""
##uat
#BASE_URL = "http://47.94.101.239:3112"
#LOG_LEVEL = 0
#UP_PHOTO =
#WEB_SOP
#WEB_ZHI_SHI
#IS_DEBUG
\ No newline at end of file
package com.dayu.base.api; package com.dayu.base.api;
import android.support.annotation.NonNull;
import android.text.TextUtils; import android.text.TextUtils;
import com.dayu.base.api.protocol.BaseResponse; import com.dayu.base.api.protocol.BaseResponse;
import com.dayu.common.BaseConstant; import com.dayu.common.BaseConstant;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.event.UserInfo;
import com.dayu.utils.LogUtils; import com.dayu.utils.LogUtils;
import com.dayu.utils.SPUtils; import com.dayu.utils.UserManager;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -27,7 +29,8 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; ...@@ -27,7 +29,8 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.gson.GsonConverterFactory;
/** /**
* Created by luofan on 2017/11/09. * Created by luofan
* on 2017/11/09.
*/ */
public class Api { public class Api {
private static Retrofit mRetrofit; private static Retrofit mRetrofit;
...@@ -102,10 +105,13 @@ public class Api { ...@@ -102,10 +105,13 @@ public class Api {
public static class TokenInterceptord implements Interceptor { public static class TokenInterceptord implements Interceptor {
@Override @Override
public Response intercept(Chain chain) throws IOException { public Response intercept(@NonNull Chain chain) throws IOException {
Request request = chain.request(); Request request = chain.request();
String token = (String) SPUtils.get(BaseConstant.TOKEN, ""); UserInfo userInfo = UserManager.getInstance().getUser();
token="2ab7a346308043f6bb4060ac52edfd61"; String token = "";
if (userInfo != null) {
token = userInfo.getToken();
}
if (!TextUtils.isEmpty(token) && !request.url().toString().contains(Constants.BASE_URL + Constants.LOGIN_URL)) { if (!TextUtils.isEmpty(token) && !request.url().toString().contains(Constants.BASE_URL + Constants.LOGIN_URL)) {
request = request.newBuilder() request = request.newBuilder()
.header(BaseConstant.TOKEN, token) .header(BaseConstant.TOKEN, token)
......
...@@ -12,17 +12,27 @@ public class Constants { ...@@ -12,17 +12,27 @@ public class Constants {
/** /**
* 测试环境配置. * 测试环境配置.
*/ */
public static final int DEBUGLEVEL = LogUtils.LEVEL_ALL; // public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String BASE_URL = "http://47.94.101.239:3112"; // public static final String BASE_URL = "http://47.94.101.239:3112";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
// public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
// public static final boolean IS_DEBUG = true;
/**
* uat环境配置.
*/
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String BASE_URL = "http://47.95.223.6:3112";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"; public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop"; public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail"; public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
public static final boolean IS_DEBUG = true; public static final boolean IS_DEBUG = true;
/** /**
* 正式环境. * 正式环境.
*/ */
// public static final int DEBUGLEVEL = LogUtils.LEVEL_OFF; // public static final int LOG_LEVEL = LogUtils.LEVEL_OFF;
// public static final String BASE_URL = "https://mobile.dayu.ai"; // public static final String BASE_URL = "https://mobile.dayu.ai";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply"; // public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "https://sop.kf.ai/#/sop"; // public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
...@@ -102,7 +112,6 @@ public class Constants { ...@@ -102,7 +112,6 @@ public class Constants {
public final static String ENGINEERINFO = "engineer_info"; public final static String ENGINEERINFO = "engineer_info";
public final static String TYPE = "type"; public final static String TYPE = "type";
public final static String DESCRIBE = "describe";
public static final String PART_ID = "part_id"; public static final String PART_ID = "part_id";
public static final String SHIPPER_CODE = "shipper_code"; public static final String SHIPPER_CODE = "shipper_code";
......
...@@ -33,7 +33,7 @@ public class LogUtils { ...@@ -33,7 +33,7 @@ public class LogUtils {
public static final int LEVEL_SYSTEM = 6; public static final int LEVEL_SYSTEM = 6;
/** 是否允许输出log */ /** 是否允许输出log */
private static int mDebuggable = Constants.DEBUGLEVEL; private static int mDebuggable = Constants.LOG_LEVEL;
/** 用于记时的变量 */ /** 用于记时的变量 */
private static long mTimestamp = 0; private static long mTimestamp = 0;
......
/**
* CopyRight (C), 2013, www.winchannel.net
*/
package com.dayu.utils;
import android.text.TextUtils;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class PropertyUtils {
/**
* The key for navigation address
*/
public static final String BASE_URL = "BASE_URL";
private static final String DEFAULT_CONFIG_FILE = "/assets/config.properties";
private Properties mProperties;
private static PropertyUtils sProperty;
public static PropertyUtils getInstance() {
if (null == sProperty) {
sProperty = new PropertyUtils();
}
return sProperty;
}
private PropertyUtils() {
mProperties = new Properties();
}
public void load(String path) {
if (TextUtils.isEmpty(path)) {
path = DEFAULT_CONFIG_FILE;
}
InputStream in = null;
try {
in = PropertyUtils.class.getResourceAsStream(path);
mProperties.load(in);
} catch (Exception e) {
LogUtils.e(e);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public String getParameter(String key) {
String para = null;
if (null != mProperties) {
para = mProperties.getProperty(key);
if (null != para) {
para = para.trim();
}
}
return para;
}
public String getParameter(String key, String defaultValue) {
String para = null;
if (null != mProperties) {
para = mProperties.getProperty(key, defaultValue);
if (null != para) {
para = para.trim();
}
}
return para;
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.compile_sdk_version = 26 ext.compile_sdk_version = 27
ext.build_tools_version = "26.0.2" ext.build_tools_version = "27.0.2"
ext.min_sdk_version = 16 ext.min_sdk_version = 16
ext.target_sdk_version = 23 ext.target_sdk_version = 23
ext.version_code = 7 ext.version_code = 7
......
...@@ -27,7 +27,7 @@ import okhttp3.RequestBody; ...@@ -27,7 +27,7 @@ import okhttp3.RequestBody;
* on 2017/11/8. * on 2017/11/8.
*/ */
public class OrderDoingPresenter extends orderDoingContract.Presenter { public class OrderDoingPresenter extends orderDoingContract.Presenter {
public ObservableField<Object> datas = new ObservableField(); private ObservableField<Object> datas = new ObservableField<>();
private int mUserId; private int mUserId;
private int mSiteId; private int mSiteId;
private int mState; private int mState;
......
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 sign in to comment