Skip to content
项目
Groups
代码片段
帮助
正在加载...
Sign in / Register
Toggle navigation
W
workoffice
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图表
统计图
Create a new issue
作业
提交
议题看板
Open sidebar
冷广德
workoffice
Commits
4a46cea3
提交
4a46cea3
authored
5月 07, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.刷新token
2.//TODO erp用户是否选择新部门为空,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,坩埚下单,mes,编辑任务担当无法修改.
上级
a275e057
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
38 行增加
和
11 行删除
+38
-11
RefreshTokenEvent.java
.../java/com/wd/workoffice/bean/event/RefreshTokenEvent.java
+14
-0
MainActivity.java
...main/java/com/wd/workoffice/ui/activity/MainActivity.java
+12
-6
WorkUtils.java
app/src/main/java/com/wd/workoffice/util/WorkUtils.java
+12
-5
没有找到文件。
app/src/main/java/com/wd/workoffice/bean/event/RefreshTokenEvent.java
0 → 100644
浏览文件 @
4a46cea3
package
com
.
wd
.
workoffice
.
bean
.
event
;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
RefreshTokenEvent
{
public
RefreshTokenEvent
()
{
}
}
app/src/main/java/com/wd/workoffice/ui/activity/MainActivity.java
浏览文件 @
4a46cea3
...
...
@@ -15,6 +15,7 @@ import com.ashokvarma.bottomnavigation.TextBadgeItem;
import
com.qmuiteam.qmui.util.QMUIStatusBarHelper
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.WorkBaseActivity
;
import
com.wd.workoffice.bean.event.RefreshTokenEvent
;
import
com.wd.workoffice.ui.activity.login.LoginActivity
;
import
com.wd.workoffice.ui.adapter.VpMainAdapter
;
import
com.wd.workoffice.ui.fg.MainFragment
;
...
...
@@ -78,11 +79,7 @@ public class MainActivity extends WorkBaseActivity implements BottomNavigationBa
.
addItem
(
new
BottomNavigationItem
(
R
.
mipmap
.
main_my
,
"我的"
).
setActiveColorResource
(
R
.
color
.
main_icon_select
).
setInActiveColorResource
(
R
.
color
.
main_icon
))
.
initialise
();
fm
=
getSupportFragmentManager
();
fragments
=
getFragments
();
bnbMainBottomBar
.
setTabSelectedListener
(
this
);
mainContent
.
setOffscreenPageLimit
(
3
);
VpMainAdapter
vpFgAdapter
=
new
VpMainAdapter
(
fm
,
fragments
);
mainContent
.
setAdapter
(
vpFgAdapter
);
WorkUtils
.
refreshToken
();
}
@Override
...
...
@@ -162,10 +159,19 @@ public class MainActivity extends WorkBaseActivity implements BottomNavigationBa
}
@Subscribe
(
threadMode
=
ThreadMode
.
MAIN
)
public
void
L
ogin
(
LoginEvent
lg
)
{
public
void
l
ogin
(
LoginEvent
lg
)
{
Intent
intent
=
new
Intent
(
MainActivity
.
this
,
LoginActivity
.
class
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
UserKeeper
.
getInstance
().
clearAll
();
startActivity
(
intent
);
}
@Subscribe
(
threadMode
=
ThreadMode
.
MAIN
)
public
void
changeView
(
RefreshTokenEvent
refreshTokenEvent
)
{
fragments
=
getFragments
();
bnbMainBottomBar
.
setTabSelectedListener
(
this
);
mainContent
.
setOffscreenPageLimit
(
3
);
VpMainAdapter
vpFgAdapter
=
new
VpMainAdapter
(
fm
,
fragments
);
mainContent
.
setAdapter
(
vpFgAdapter
);
}
}
app/src/main/java/com/wd/workoffice/util/WorkUtils.java
浏览文件 @
4a46cea3
...
...
@@ -18,12 +18,17 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.Config
;
import
com.wd.workoffice.app.WorkApp
;
import
com.wd.workoffice.bean.event.RefreshTokenEvent
;
import
com.wd.workoffice.bean.workEnum.OrderType
;
import
com.wd.workoffice.bean.workEnum.PermissionType
;
import
com.wd.workoffice.retrofit.ApiService
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.ui.adapter.StarAdapter
;
import
org.greenrobot.eventbus.EventBus
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
...
...
@@ -32,6 +37,7 @@ import java.util.Map;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
flexible.xd.android_base.network.rtfhttp.RtfHelper
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
import
retrofit2.Call
;
...
...
@@ -290,13 +296,13 @@ public class WorkUtils {
if
(
response
.
isSuccessful
())
{
JSONObject
data
=
response
.
body
();
UserKeeper
.
getInstance
().
keepLoginInfo
(
data
.
toJSONString
());
}
else
{
}
EventBus
.
getDefault
().
post
(
new
RefreshTokenEvent
());
}
@Override
public
void
onFailure
(
Call
<
JSONObject
>
call
,
Throwable
t
)
{
EventBus
.
getDefault
().
post
(
new
RefreshTokenEvent
());
}
});
}
...
...
@@ -352,10 +358,11 @@ public class WorkUtils {
* @return
*/
public
static
boolean
isImg
(
String
type
)
{
return
TextUtils
.
equals
(
"jpeg"
,
type
)||
TextUtils
.
equals
(
"gif"
,
type
)||
TextUtils
.
equals
(
"webp"
,
type
)
||
TextUtils
.
equals
(
"png"
,
type
)||
TextUtils
.
equals
(
"bmp"
,
type
)||
TextUtils
.
equals
(
"JPEG"
,
type
)||
TextUtils
.
equals
(
"GIF"
,
type
)||
TextUtils
.
equals
(
"WEBP"
,
type
)
||
TextUtils
.
equals
(
"PNG"
,
type
)||
TextUtils
.
equals
(
"BMP"
,
type
);
return
TextUtils
.
equals
(
"jpeg"
,
type
)
||
TextUtils
.
equals
(
"gif"
,
type
)
||
TextUtils
.
equals
(
"webp"
,
type
)
||
TextUtils
.
equals
(
"png"
,
type
)
||
TextUtils
.
equals
(
"bmp"
,
type
)
||
TextUtils
.
equals
(
"JPEG"
,
type
)
||
TextUtils
.
equals
(
"GIF"
,
type
)
||
TextUtils
.
equals
(
"WEBP"
,
type
)
||
TextUtils
.
equals
(
"PNG"
,
type
)
||
TextUtils
.
equals
(
"BMP"
,
type
);
}
/**
* 小星星布局
*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论