Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
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
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
31aa78ae
Commit
31aa78ae
authored
Jul 31, 2020
by
Wang Yuhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图层导出功能,请求拦截,未登录导到登录页面
parent
78c64473
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
45 additions
and
46 deletions
+45
-46
CheckDetail.vue
DAPlatform-front/src/components/CheckDetail.vue
+3
-1
CompletedTaskDetail.vue
DAPlatform-front/src/components/CompletedTaskDetail.vue
+3
-1
Login.vue
DAPlatform-front/src/components/Login.vue
+0
-1
NavHeader.vue
DAPlatform-front/src/components/NavHeader.vue
+8
-2
Navigator.vue
DAPlatform-front/src/components/Navigator.vue
+0
-1
OngoingTaskDetail.vue
DAPlatform-front/src/components/OngoingTaskDetail.vue
+3
-1
TaskHall.vue
DAPlatform-front/src/components/TaskHall.vue
+0
-3
UserHome.vue
DAPlatform-front/src/components/UserHome.vue
+1
-0
main.js
DAPlatform-front/src/main.js
+25
-34
index.js
DAPlatform-front/src/store/index.js
+2
-2
Task.cpython-36.pyc
DAPlatform/Dao/__pycache__/Task.cpython-36.pyc
+0
-0
imageAnnotation.cpython-36.pyc
DAPlatform/views/__pycache__/imageAnnotation.cpython-36.pyc
+0
-0
No files found.
DAPlatform-front/src/components/CheckDetail.vue
View file @
31aa78ae
...
...
@@ -96,8 +96,10 @@ export default {
var
piece
=
this
.
piece
if
(
piece
.
type
===
'文本'
)
{
download
(
'/files/downloadZip'
,
relationId
)
}
else
{
}
else
if
(
piece
.
type
===
'图片'
)
{
download
(
'/image/export/zip'
,
relationId
)
}
else
if
(
piece
.
type
===
'图层'
)
{
download
(
'/layer/export'
,
relationId
)
}
}
}
...
...
DAPlatform-front/src/components/CompletedTaskDetail.vue
View file @
31aa78ae
...
...
@@ -60,8 +60,10 @@ export default {
var
relationId
=
file
.
relation_id
if
(
piece
.
type
===
'文本'
)
{
download
(
'/files/downloadZip'
,
relationId
)
}
else
{
}
else
if
(
piece
.
type
===
'图片'
)
{
download
(
'/image/export/zip'
,
relationId
)
}
else
if
(
piece
.
type
===
'图层'
)
{
download
(
'/layer/export'
,
relationId
)
}
}
}
...
...
DAPlatform-front/src/components/Login.vue
View file @
31aa78ae
...
...
@@ -114,7 +114,6 @@ export default {
password
:
this
.
password
}
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
===
1
)
{
self
.
$store
.
commit
(
'setUserInfo'
,
res
.
data
)
self
.
$router
.
push
({
path
:
'/taskHall'
})
...
...
DAPlatform-front/src/components/NavHeader.vue
View file @
31aa78ae
...
...
@@ -7,7 +7,8 @@
background-color=
"#409EFF"
text-color=
"#fff"
active-text-color=
"#fff"
router
>
router
@
select=
"handleSelect"
>
<el-menu-item
index=
"/taskhall"
>
任务大厅
</el-menu-item>
<el-menu-item
index=
"/ongoing"
>
我的任务
</el-menu-item>
<el-menu-item
v-if=
"userType"
index=
"/releasetask"
>
发布任务
</el-menu-item>
...
...
@@ -30,7 +31,7 @@ export default {
},
computed
:
{
userType
()
{
return
this
.
$store
.
state
.
userInfo
.
identity
===
1
return
this
.
$store
.
state
.
userInfo
&&
this
.
$store
.
state
.
userInfo
.
identity
===
1
}
},
watch
:
{
...
...
@@ -42,6 +43,11 @@ export default {
}
},
methods
:
{
handleSelect
(
index
,
indexPath
)
{
if
(
index
===
'/'
)
{
this
.
$store
.
commit
(
'setUserInfo'
,
null
)
}
}
}
}
</
script
>
...
...
DAPlatform-front/src/components/Navigator.vue
View file @
31aa78ae
...
...
@@ -50,7 +50,6 @@ export default {
...
self
.
condition
}
}).
then
(
res
=>
{
console
.
log
(
res
)
self
.
tasks
=
res
.
data
.
tasks
self
.
pageNum
=
res
.
data
.
pageNum
self
.
pageChange
()
...
...
DAPlatform-front/src/components/OngoingTaskDetail.vue
View file @
31aa78ae
...
...
@@ -66,8 +66,10 @@ export default {
var
relationId
=
file
.
relation_id
if
(
piece
.
type
===
'文本'
)
{
download
(
'/files/downloadZip'
,
relationId
)
}
else
{
}
else
if
(
piece
.
type
===
'图片'
)
{
download
(
'/image/export/zip'
,
relationId
)
}
else
if
(
piece
.
type
===
'图层'
)
{
download
(
'/layer/export'
,
relationId
)
}
}
}
...
...
DAPlatform-front/src/components/TaskHall.vue
View file @
31aa78ae
...
...
@@ -55,9 +55,6 @@ export default {
}
},
methods
:
{
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
)
},
enterTask
(
task
)
{
this
.
$router
.
push
({
name
:
'task'
,
...
...
DAPlatform-front/src/components/UserHome.vue
View file @
31aa78ae
...
...
@@ -37,6 +37,7 @@ export default {
}
},
beforeMount
()
{
if
(
!
this
.
userInfo
)
this
.
$router
.
replace
(
'/'
)
var
self
=
this
// 请求用户信息
this
.
axios
({
...
...
DAPlatform-front/src/main.js
View file @
31aa78ae
...
...
@@ -16,39 +16,6 @@ Vue.prototype.$math = math
axios
.
defaults
.
baseURL
=
'http://localhost:9100/api'
axios
.
defaults
.
timeout
=
8000
// 添加响应拦截器
axios
.
interceptors
.
response
.
use
(
function
(
response
)
{
let
res
=
response
.
data
// 未登录
if
(
res
.
code
===
10
)
{
window
.
location
.
href
=
'/#/login'
}
else
{
if
(
response
.
config
.
url
===
'/file/getFiles'
)
{
res
.
id
=
response
.
config
.
params
.
pieceId
}
return
res
}
},
function
(
error
)
{
// 对响应错误做点什么
return
Promise
.
reject
(
error
)
})
// 添加请求拦截器,每次请求设置都请求cookie信息
// axios.interceptors.request.use(function(config){
// let token = localStorage.getItem("vuex")//获取vuex的全局变量
// // console.log(localStorage)
// // console.log(token)
// //如果vuex的全局变量userInfo为空值
// if(token == "undefined"){
// ElementUI.Message({
// type:"warning",
// message:"您未登录,请前往登录界面进行操作"
// })
// window.location.href = '/#/'
// }
// return config
// },function(error){
// return Promise.reject(error)
// })
Vue
.
use
(
VueAxios
,
axios
)
Vue
.
use
(
ElementUI
)
...
...
@@ -60,10 +27,34 @@ Vue.filter('formatDate', function (value) {
})
/* eslint-disable no-new */
new
Vue
({
var
vm
=
new
Vue
({
el
:
'#app'
,
router
,
store
,
components
:
{
App
},
template
:
'<App/>'
})
// 添加响应拦截器
axios
.
interceptors
.
response
.
use
(
function
(
response
)
{
let
res
=
response
.
data
if
(
response
.
config
.
url
===
'/file/getFiles'
)
{
res
.
id
=
response
.
config
.
params
.
pieceId
}
return
res
},
function
(
error
)
{
// 对响应错误做点什么
return
Promise
.
reject
(
error
)
})
// 添加请求拦截器,每次请求设置都请求cookie信息
axios
.
interceptors
.
request
.
use
(
function
(
config
)
{
// 除了登录和注册请求,其余请求如果没有用户信息(即没登录),就跳转到登录页面
if
(
!
vm
.
$store
.
state
.
userInfo
&&
config
.
url
!==
'/user/signin'
&&
config
.
url
!==
'/user/signup'
)
{
vm
.
$router
.
replace
(
'/'
)
}
return
config
},
function
(
error
)
{
return
Promise
.
reject
(
error
)
})
DAPlatform-front/src/store/index.js
View file @
31aa78ae
...
...
@@ -7,7 +7,7 @@ Vue.use(Vuex)
export
default
new
Vuex
.
Store
({
state
:
{
userInfo
:
null
,
userInfo
:
null
// imageData: null,
// layerData: null
},
...
...
@@ -33,5 +33,5 @@ export default new Vuex.Store({
},
modules
:
{
},
plugins
:
[
createPersistedState
()]
plugins
:
[
createPersistedState
(
{
storage
:
window
.
sessionStorage
}
)]
})
DAPlatform/Dao/__pycache__/Task.cpython-36.pyc
View file @
31aa78ae
No preview for this file type
DAPlatform/views/__pycache__/imageAnnotation.cpython-36.pyc
View file @
31aa78ae
No preview for this file type
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