Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
Sign in / Register
Toggle navigation
S
site-uniapp
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
王柯
site-uniapp
Commits
e3867c0d
提交
e3867c0d
authored
2月 23, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
组织编号获取项目接口调整
访客加入组织审批通过token刷新 新闻banner实时刷新
父级
bbe0a36d
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
45 行增加
和
13 行删除
+45
-13
pages/gallery/app/modeFormList/modeFormList.vue
+1
-1
pages/gallery/app/originalIndex/originalIndex.vue
+1
-1
pages/index/index.vue
+42
-6
pagesSub/mine/projectInfo/projectInfo.vue
+1
-5
没有找到文件。
pages/gallery/app/modeFormList/modeFormList.vue
View file @
e3867c0d
...
...
@@ -881,7 +881,7 @@
url
:
"/api/v1/project/project_list"
,
data
:
{
is_all
:
1
,
org_no
:
uni
.
getStorageSync
(
"org_no"
)
get_
org_no
:
uni
.
getStorageSync
(
"org_no"
)
},
header
:
{
"access_token"
:
this
.
getToken
()
...
...
pages/gallery/app/originalIndex/originalIndex.vue
View file @
e3867c0d
...
...
@@ -64,7 +64,7 @@
Api
.
getProjectList
({
data
:
{
is_all
:
1
,
org_no
:
uni
.
getStorageSync
(
"org_no"
)
get_
org_no
:
uni
.
getStorageSync
(
"org_no"
)
}
}).
then
((
result
)
=>
{
console
.
log
(
"项目列表:"
,
result
);
...
...
pages/index/index.vue
View file @
e3867c0d
...
...
@@ -182,7 +182,7 @@
this
.
getRecentlyApp
()
}
})
uni
.
$on
(
"refreshOrg"
,
res
=>
{
//组织切换了
//
uni.$on("refreshOrg", res => { //组织切换了
this
.
project_id
=
uni
.
getStorageSync
(
"project_id"
)
if
(
!
this
.
project_id
)
{
this
.
getCompanyBanners
()
...
...
@@ -191,7 +191,7 @@
this
.
getNews
()
this
.
getBanners
()
}
})
//
})
},
onUnload
()
{
uni
.
$off
(
"refreshOrg"
)
...
...
@@ -247,7 +247,7 @@
url
:
"/api/v1/project/project_list"
,
data
:
{
is_all
:
1
,
org_no
:
uni
.
getStorageSync
(
"org_no"
)
get_
org_no
:
uni
.
getStorageSync
(
"org_no"
)
},
header
:
{
"access_token"
:
this
.
getToken
()
...
...
@@ -278,7 +278,7 @@
url
:
"/api/v1/project/project_list"
,
data
:
{
is_all
:
1
,
org_no
:
orgNo
get_
org_no
:
orgNo
},
header
:
{
"access_token"
:
this
.
getToken
()
...
...
@@ -664,6 +664,30 @@
}
return
false
},
refreshToken
:
function
()
{
this
.
$http
.
consoleGet
({
url
:
"/api/v1/access/token/refresh_access_token"
,
data
:
{},
header
:
{
"refresh_token"
:
uni
.
getStorageSync
(
"refresh_token"
),
"Content-Type"
:
"application/json"
}
}).
then
((
res
)
=>
{
let
result
=
res
.
data
console
.
log
(
"刷新token"
,
result
);
if
(
result
.
code
==
0
)
{
uni
.
setStorageSync
(
"token"
,
result
.
data
.
access_token
)
uni
.
setStorageSync
(
"refresh_token"
,
result
.
data
.
refresh_token
)
uni
.
setStorageSync
(
"short_token"
,
result
.
data
.
short_token
)
this
.
loginState
()
}
else
if
(
result
.
code
==
90001
||
result
.
code
==
90201
||
result
.
code
==
10204
)
{
uni
.
navigateTo
({
url
:
"/pages/login/authLogin/authLogin"
})
uni
.
clearStorageSync
()
}
})
},
getUserInfo
()
{
Api
.
getUserInfo
().
then
((
result
)
=>
{
if
(
result
.
code
==
0
)
{
...
...
@@ -674,14 +698,23 @@
//如果是项目端 获取当前岗位
//如果是工人 获取工人当前项目
if
(
this
.
role
==
'PM'
)
{
//判断是否是访客变换身份
var
role
=
uni
.
getStorageSync
(
"role"
)
if
(
role
==
'VISITOR'
)
{
//清空身份
uni
.
setStorageSync
(
"role"
,
""
)
//刷新token
this
.
refreshToken
()
return
}
if
(
getApp
().
globalData
.
isInit
)
{
if
(
jobs
)
{
let
currentJob
=
jobs
[
0
]
uni
.
setStorageSync
(
"org_no"
,
currentJob
.
org_no
)
uni
.
setStorageSync
(
"org_id"
,
currentJob
.
org_id
)
//当前岗位 判断当前岗位是项目部还是其他
if
(
this
.
userInfo
.
user
.
dept_type
==
'2'
)
{
//项目级
uni
.
setStorageSync
(
"org_name"
,
currentJob
.
dept_name
)
if
(
this
.
userInfo
.
user
.
dept_type
==
'2'
)
{
//项目级
直接获取项目部下所有项目 默认第一个
//
uni.setStorageSync("org_name", currentJob.dept_name)
this
.
getDeptProject
()
}
else
{
uni
.
setStorageSync
(
"org_name"
,
currentJob
.
org_name
)
...
...
@@ -697,6 +730,9 @@
}
getApp
().
globalData
.
isInit
=
false
}
}
else
if
(
this
.
role
==
'VISITOR'
)
{
//如果是访客记录当前身份,身份变化需要刷新token
uni
.
setStorageSync
(
"role"
,
'VISITOR'
)
this
.
initData
()
}
else
{
this
.
project_id
=
uni
.
getStorageSync
(
"project_id"
)
if
(
!
this
.
project_id
)
{
...
...
pagesSub/mine/projectInfo/projectInfo.vue
View file @
e3867c0d
...
...
@@ -122,14 +122,10 @@
}
},
loadProject
()
{
let
orgNo
=
uni
.
getStorageSync
(
"org_no"
)
if
(
orgNo
==
'001'
)
{
orgNo
=
""
}
Api
.
getProjectList
({
data
:
{
is_all
:
1
,
org_no
:
orgNo
get_org_no
:
uni
.
getStorageSync
(
"org_no"
)
}
}).
then
((
result
)
=>
{
console
.
log
(
"项目列表:"
,
result
);
...
...
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment