Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
digital-construction
Project
Project
Details
Activity
Releases
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
Open sidebar
张牧越
digital-construction
Commits
df576b3a
Commit
df576b3a
authored
Jul 26, 2023
by
张牧越
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
2ef732a8
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
18 deletions
+59
-18
.env.development
.env.development
+1
-1
.env.production
.env.production
+1
-1
App.vue
src/App.vue
+10
-4
Index.vue
src/components/construction/Index.vue
+9
-9
noloadingRequest.js
src/utils/noloadingRequest.js
+17
-1
request.js
src/utils/request.js
+20
-1
vue.config.js
vue.config.js
+1
-1
No files found.
.env.development
View file @
df576b3a
NODE_ENV = "development"
NODE_ENV = "development"
Mock: true
Mock: true
VUE_APP_API_URL = "http://
192.168.0.228:8002
"
VUE_APP_API_URL = "http://
/yth.vnet.io
"
.env.production
View file @
df576b3a
NODE_ENV = "production"
NODE_ENV = "production"
Mock: false
Mock: false
VUE_APP_API_URL = ""
VUE_APP_API_URL = "http:///yth.vnet.io"
\ No newline at end of file
\ No newline at end of file
src/App.vue
View file @
df576b3a
...
@@ -16,13 +16,17 @@ export default {
...
@@ -16,13 +16,17 @@ export default {
},
},
methods
:
{
methods
:
{
getXAccessToken
()
{
getXAccessToken
()
{
if
(
this
.
$route
.
query
.
p
re
mit_code
)
{
if
(
this
.
$route
.
query
.
p
er
mit_code
)
{
localStorage
.
setItem
(
localStorage
.
setItem
(
"PermitAuthorization"
,
"PermitAuthorization"
,
this
.
$route
.
query
.
p
re
mit_code
this
.
$route
.
query
.
p
er
mit_code
);
);
}
}
if
(
this
.
$route
.
query
.
token_code
!=
localStorage
.
getItem
(
"token"
))
{
if
(
this
.
$route
.
query
.
token_code
!=
localStorage
.
getItem
(
"token"
)
&&
!
this
.
$route
.
query
.
permit_code
&&
!
this
.
$route
.
query
.
api_type
)
{
getXAccessToken
(
this
.
$route
.
query
.
token_code
).
then
((
res
)
=>
{
getXAccessToken
(
this
.
$route
.
query
.
token_code
).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
if
(
res
.
status
==
200
)
{
localStorage
.
setItem
(
"token"
,
this
.
$route
.
query
.
token_code
);
localStorage
.
setItem
(
"token"
,
this
.
$route
.
query
.
token_code
);
...
@@ -33,7 +37,9 @@ export default {
...
@@ -33,7 +37,9 @@ export default {
}
}
});
});
}
else
{
}
else
{
this
.
$nextTick
(()
=>
{
this
.
signIn
=
true
;
this
.
signIn
=
true
;
});
}
}
},
},
},
},
...
...
src/components/construction/Index.vue
View file @
df576b3a
...
@@ -730,47 +730,47 @@ export default {
...
@@ -730,47 +730,47 @@ export default {
if
(
item
.
type
==
1
)
{
if
(
item
.
type
==
1
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/tower"
,
path
:
"/tower"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
2
)
{
}
else
if
(
item
.
type
==
2
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/supervisory"
,
path
:
"/supervisory"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
3
)
{
}
else
if
(
item
.
type
==
3
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/realname"
,
path
:
"/realname"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
4
)
{
}
else
if
(
item
.
type
==
4
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/safecap"
,
path
:
"/safecap"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
8
)
{
}
else
if
(
item
.
type
==
8
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/earlywarning"
,
path
:
"/earlywarning"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
9
)
{
}
else
if
(
item
.
type
==
9
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/noise"
,
path
:
"/noise"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
13
)
{
}
else
if
(
item
.
type
==
13
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/fallprotection"
,
path
:
"/fallprotection"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
14
)
{
}
else
if
(
item
.
type
==
14
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/unloadingplatform"
,
path
:
"/unloadingplatform"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
else
if
(
item
.
type
==
15
)
{
}
else
if
(
item
.
type
==
15
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/elevator"
,
path
:
"/elevator"
,
query
:
{
token_code
:
localStorage
.
getItem
(
"token"
)
},
query
:
{
...
this
.
$route
.
query
},
});
});
}
}
},
},
...
...
src/utils/noloadingRequest.js
View file @
df576b3a
import
axios
from
'axios'
import
axios
from
'axios'
import
{
Message
}
from
'element-ui'
;
import
{
Message
}
from
'element-ui'
;
const
getLocationParams
=
(
keyWords
)
=>
{
// 提取路由值(字符串)
let
href
=
window
.
location
.
href
;
// 从占位符开始截取路由(不包括占位符)
let
query
=
href
.
substring
(
href
.
indexOf
(
"?"
)
+
1
);
// 根据 & 切割字符串
let
vars
=
query
.
split
(
"&"
);
for
(
let
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
let
pair
=
vars
[
i
].
split
(
"="
);
// 根据指定的参数名去筛选参数值
if
(
pair
[
0
]
==
keyWords
)
{
return
pair
[
1
];
}
}
return
""
;
};
const
noLoadingrequest
=
axios
.
create
({
const
noLoadingrequest
=
axios
.
create
({
withCredentials
:
false
,
withCredentials
:
false
,
baseURL
:
getLocationParams
(
"api_type"
)
?
process
.
env
.
VUE_APP_API_URL
:
''
,
})
})
noLoadingrequest
.
interceptors
.
request
.
use
(
noLoadingrequest
.
interceptors
.
request
.
use
(
...
...
src/utils/request.js
View file @
df576b3a
...
@@ -5,6 +5,25 @@ import _ from 'lodash';
...
@@ -5,6 +5,25 @@ import _ from 'lodash';
// loading框设置局部刷新,且所有请求完成后关闭loading框
// loading框设置局部刷新,且所有请求完成后关闭loading框
let
loadingInstance
;
//loading 实例
let
loadingInstance
;
//loading 实例
let
needLoadingRequestCount
=
0
;
//当前正在请求的数量
let
needLoadingRequestCount
=
0
;
//当前正在请求的数量
const
getLocationParams
=
(
keyWords
)
=>
{
// 提取路由值(字符串)
let
href
=
window
.
location
.
href
;
// 从占位符开始截取路由(不包括占位符)
let
query
=
href
.
substring
(
href
.
indexOf
(
"?"
)
+
1
);
// 根据 & 切割字符串
let
vars
=
query
.
split
(
"&"
);
for
(
let
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
let
pair
=
vars
[
i
].
split
(
"="
);
// 根据指定的参数名去筛选参数值
if
(
pair
[
0
]
==
keyWords
)
{
return
pair
[
1
];
}
}
return
""
;
};
function
showLoading
()
{
function
showLoading
()
{
let
main
=
document
.
querySelector
(
'#app'
)
//获取dom节点
let
main
=
document
.
querySelector
(
'#app'
)
//获取dom节点
if
(
main
)
{
if
(
main
)
{
...
@@ -33,9 +52,9 @@ var hideLoading = _.debounce(() => {
...
@@ -33,9 +52,9 @@ var hideLoading = _.debounce(() => {
loadingInstance
=
null
;
loadingInstance
=
null
;
},
10
);
},
10
);
const
request
=
axios
.
create
({
const
request
=
axios
.
create
({
withCredentials
:
false
,
withCredentials
:
false
,
baseURL
:
getLocationParams
(
"api_type"
)
?
process
.
env
.
VUE_APP_API_URL
:
''
,
})
})
request
.
interceptors
.
request
.
use
(
request
.
interceptors
.
request
.
use
(
...
...
vue.config.js
View file @
df576b3a
...
@@ -18,7 +18,7 @@ module.exports = defineConfig({
...
@@ -18,7 +18,7 @@ module.exports = defineConfig({
}
}
}
}
},
},
publicPath
:
process
.
env
.
NODE_ENV
==
'production'
?
'./'
:
'/'
,
publicPath
:
process
.
env
.
NODE_ENV
==
'production'
?
'./'
:
'/'
,
// 二级根目录需要修改
devServer
:
{
devServer
:
{
port
:
3000
,
port
:
3000
,
proxy
:
{
proxy
:
{
...
...
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