Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setup-project-manager-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
setup-project-manager-ui
Commits
a30aec8f
Commit
a30aec8f
authored
Nov 19, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加检测是否首次安装
parent
36ec01f3
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
146 additions
and
98 deletions
+146
-98
admin/setup-project-manager-ui.tar.gz
admin/setup-project-manager-ui.tar.gz
+0
-0
admin/src/assets/utils/ajax.js
admin/src/assets/utils/ajax.js
+48
-2
admin/src/assets/utils/httpErrorHandler.js
admin/src/assets/utils/httpErrorHandler.js
+3
-3
admin/src/views/setup/project/list.vue
admin/src/views/setup/project/list.vue
+93
-91
admin/vue.config.js
admin/vue.config.js
+2
-2
No files found.
admin/setup-project-manager-ui.tar.gz
View file @
a30aec8f
No preview for this file type
admin/src/assets/utils/ajax.js
View file @
a30aec8f
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
Vue
from
'
vue
'
import
ElementUI
from
'
element-ui
'
import
'
element-ui/lib/theme-chalk/index.css
'
import
Qs
from
"
qs
"
;
import
Qs
from
"
qs
"
;
const
JSONbig
=
require
(
"
json-bigint
"
)({
storeAsString
:
true
});
const
JSONbig
=
require
(
"
json-bigint
"
)({
storeAsString
:
true
});
import
cookie
from
"
./cookie
"
;
import
cookie
from
"
./cookie
"
;
import
httpErrorHandler
from
"
./httpErrorHandler
"
;
import
httpErrorHandler
from
"
./httpErrorHandler
"
;
// loading框设置局部刷新,且所有请求完成后关闭loading框
let
loading
let
needLoadingRequestCount
=
0
// 声明一个对象用于存储请求个数
function
startLoading
()
{
loading
=
Vue
.
prototype
.
$loading
({
lock
:
true
,
customClass
:
'
createLoading
'
,
// 局部class名称
text
:
'
服务加载中...
'
,
background
:
'
rgba(0,0,0,0.5)
'
,
target
:
document
.
querySelector
(
'
.loading-area
'
)
// 设置加载动画区域
})
}
function
endLoading
()
{
loading
.
close
()
}
function
showFullScreenLoading
()
{
if
(
needLoadingRequestCount
===
0
)
{
startLoading
()
}
needLoadingRequestCount
++
}
function
hideFullScreenLoading
()
{
if
(
needLoadingRequestCount
<=
0
)
return
needLoadingRequestCount
--
if
(
needLoadingRequestCount
===
0
)
{
endLoading
()
}
}
const
instance
=
axios
.
create
({
const
instance
=
axios
.
create
({
baseURL
:
"
/m
"
,
baseURL
:
"
/m
"
,
//baseURL: process.env.VUE_APP_BASE_API,
//baseURL: process.env.VUE_APP_BASE_API,
...
@@ -24,18 +56,30 @@ const instance = axios.create({
...
@@ -24,18 +56,30 @@ const instance = axios.create({
},
},
],
],
});
});
/**
* 请求拦截器
*/
instance
.
interceptors
.
request
.
use
(
instance
.
interceptors
.
request
.
use
(
(
config
)
=>
{
(
config
)
=>
{
config
.
headers
.
Authorization
=
window
.
sessionStorage
.
getItem
(
"
token
"
)
||
""
;
config
.
headers
.
Authorization
=
window
.
sessionStorage
.
getItem
(
"
token
"
)
||
""
;
if
(
config
.
isLoading
==
true
)
{
// 如果配置了isLoading: false,则不显示loading
showFullScreenLoading
()
}
return
config
;
return
config
;
},
},
(
err
)
=>
{
(
err
)
=>
{
hideFullScreenLoading
()
return
Promise
.
reject
(
err
);
return
Promise
.
reject
(
err
);
}
}
);
);
/**
* 响应拦截器
*/
instance
.
interceptors
.
response
.
use
((
response
)
=>
{
instance
.
interceptors
.
response
.
use
((
response
)
=>
{
hideFullScreenLoading
()
// 响应成功关闭loading
return
response
.
data
;
return
response
.
data
;
},
httpErrorHandler
);
},
httpErrorHandler
);
...
@@ -98,3 +142,5 @@ export function upload(url, option, config = {}) {
...
@@ -98,3 +142,5 @@ export function upload(url, option, config = {}) {
});
});
return
uploadInstance
.
post
(
url
,
formdata
,
config
);
return
uploadInstance
.
post
(
url
,
formdata
,
config
);
}
}
admin/src/assets/utils/httpErrorHandler.js
View file @
a30aec8f
export
default
(
error
)
=>
{
export
default
(
error
)
=>
{
if
(
error
.
message
===
'
自动取消ajax操作
'
)
return
Promise
.
reject
(
error
);
if
(
error
.
message
===
'
自动取消ajax操作
'
)
return
Promise
.
reject
(
error
);
if
(
!
error
.
response
)
{
if
(
!
error
.
response
)
{
console
.
error
(
error
);
console
.
error
(
error
);
...
@@ -7,10 +8,10 @@ export default (error) => {
...
@@ -7,10 +8,10 @@ export default (error) => {
error
,
error
,
});
});
};
};
let
tip
=
''
;
let
tip
=
''
;
const
status
=
error
.
response
.
status
;
const
status
=
error
.
response
.
status
;
switch
(
status
)
{
switch
(
status
)
{
case
400
:
case
400
:
tip
=
'
错误的请求参数
'
;
tip
=
'
错误的请求参数
'
;
...
@@ -50,4 +51,3 @@ export default (error) => {
...
@@ -50,4 +51,3 @@ export default (error) => {
status
,
status
,
});
});
}
}
\ No newline at end of file
admin/src/views/setup/project/list.vue
View file @
a30aec8f
This diff is collapsed.
Click to expand it.
admin/vue.config.js
View file @
a30aec8f
...
@@ -39,8 +39,8 @@ module.exports = {
...
@@ -39,8 +39,8 @@ module.exports = {
proxy
:
{
proxy
:
{
"
/m
"
:
{
"
/m
"
:
{
// target: "http://192.168.0.98:11019",
// target: "http://192.168.0.98:11019",
target
:
'
http://127.0.0.1:18000
'
,
//
target: 'http://127.0.0.1:18000',
// target: 'http://192.168.0.98:8081
',
target
:
'
http://192.168.0.250:18000
'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
secure
:
false
secure
:
false
}
}
...
...
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