Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bill-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
赵啸非
bill-manager-ui
Commits
e94eeda3
Commit
e94eeda3
authored
Nov 07, 2024
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 优化全局设置
parent
b3a7eb31
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
50 deletions
+37
-50
admin_2/.env
admin_2/.env
+0
-4
admin_2/src/components/index.js
admin_2/src/components/index.js
+6
-1
admin_2/src/config/index.js
admin_2/src/config/index.js
+18
-1
admin_2/src/layouts/components/Header.vue
admin_2/src/layouts/components/Header.vue
+3
-2
admin_2/src/pages/login/Login.vue
admin_2/src/pages/login/Login.vue
+2
-1
admin_2/src/utils/request.js
admin_2/src/utils/request.js
+8
-41
No files found.
admin_2/.env
View file @
e94eeda3
# 系统名称
VUE_APP_systemName = 数字政务数据仓库管理服务系统
#门户
#门户
VUE_APP_API_portal_URL=http://192.168.0.98:11072
VUE_APP_API_portal_URL=http://192.168.0.98:11072
\ No newline at end of file
admin_2/src/components/index.js
View file @
e94eeda3
...
@@ -8,7 +8,12 @@ let customComponents = {
...
@@ -8,7 +8,12 @@ let customComponents = {
// 参数三 {RegExp}:匹配目录内文件的正则表达式/\.vue$/表示匹配所有.vue后缀名的文件
// 参数三 {RegExp}:匹配目录内文件的正则表达式/\.vue$/表示匹配所有.vue后缀名的文件
files
.
keys
().
forEach
((
item
)
=>
{
files
.
keys
().
forEach
((
item
)
=>
{
const
componentConfig
=
files
(
item
);
const
componentConfig
=
files
(
item
);
const
name
=
componentConfig
.
default
.
name
||
componentConfig
.
name
;
const
name
=
componentConfig
.
default
.
name
||
item
.
split
(
"
/
"
)
.
pop
()
.
replace
(
/
\.\w
+$/
,
""
);
const
component
=
componentConfig
.
default
||
componentConfig
;
const
component
=
componentConfig
.
default
||
componentConfig
;
Vue
.
component
(
name
,
component
);
//注册当前组件
Vue
.
component
(
name
,
component
);
//注册当前组件
});
});
...
...
admin_2/src/config/index.js
View file @
e94eeda3
export
const
pageSizeOptions
=
[
"
10
"
,
"
30
"
,
"
50
"
,
"
100
"
,
"
200
"
];
// 翻页-每页显示数量
export
const
pageSizeOptions
=
[
10
,
30
,
50
,
100
,
200
];
// 翻页-每页显示数量
export
const
systemName
=
"
数字政务数据仓库管理服务系统
"
;
// 系统名称
// 服务器请求错误状态码
export
const
responseErr
=
{
400
:
"
请求参数错误
"
,
403
:
"
禁止访问
"
,
404
:
"
请求错误,未找到该资源
"
,
405
:
"
请求方法未允许
"
,
408
:
"
请求超时
"
,
500
:
"
服务器内部错误
"
,
501
:
"
服务未实现
"
,
502
:
"
网关错误
"
,
503
:
"
服务不可用
"
,
504
:
"
网关超时
"
,
505
:
"
http版本不支持该请求
"
,
};
// 登录失效状态码
export
const
loginErr
=
[
401
,
201
,
9001
,
9002
];
admin_2/src/layouts/components/Header.vue
View file @
e94eeda3
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<div
class=
"flex gap-5"
>
<div
class=
"flex gap-5"
>
<div
class=
"page-home"
@
click=
"handleGoHome"
>
首页
</div>
<div
class=
"page-home"
@
click=
"handleGoHome"
>
首页
</div>
<!-- 返回门户 -->
<!-- 返回门户 -->
<a
class=
"back-btn"
:href=
"portal + (path ? path : '')"
>
返回门户
</a>
<a
class=
"back-btn"
:href=
"portal + (path ? path : '
/
')"
>
返回门户
</a>
</div>
</div>
</div>
</div>
</template>
</template>
...
@@ -55,13 +55,14 @@
...
@@ -55,13 +55,14 @@
<
script
>
<
script
>
import
HeaderSite
from
"
./HeaderSite.vue
"
;
import
HeaderSite
from
"
./HeaderSite.vue
"
;
import
{
mapState
,
mapActions
}
from
"
vuex
"
;
import
{
mapState
,
mapActions
}
from
"
vuex
"
;
import
{
systemName
}
from
"
@/config
"
;
export
default
{
export
default
{
components
:
{
components
:
{
HeaderSite
,
HeaderSite
,
},
},
data
()
{
data
()
{
return
{
return
{
systemName
:
process
.
env
.
VUE_APP_systemName
,
systemName
,
portal
:
process
.
env
.
VUE_APP_API_portal_URL
+
"
/#
"
,
portal
:
process
.
env
.
VUE_APP_API_portal_URL
+
"
/#
"
,
};
};
},
},
...
...
admin_2/src/pages/login/Login.vue
View file @
e94eeda3
...
@@ -73,13 +73,14 @@ import { getHomeData } from "@/api/home";
...
@@ -73,13 +73,14 @@ import { getHomeData } from "@/api/home";
import
{
generateRoutes
,
filterBtn
}
from
"
@/utils
"
;
import
{
generateRoutes
,
filterBtn
}
from
"
@/utils
"
;
import
{
calcMenu
}
from
"
@/router
"
;
import
{
calcMenu
}
from
"
@/router
"
;
import
{
login
}
from
"
@/api/login
"
;
import
{
login
}
from
"
@/api/login
"
;
import
{
systemName
}
from
"
@/config
"
;
export
default
{
export
default
{
name
:
"
login
"
,
name
:
"
login
"
,
data
()
{
data
()
{
return
{
return
{
systemName
,
api
:
process
.
env
.
VUE_APP_API_BASE_URL
,
api
:
process
.
env
.
VUE_APP_API_BASE_URL
,
securityUrl
:
""
,
securityUrl
:
""
,
systemName
:
process
.
env
.
VUE_APP_systemName
,
originData
:
[],
originData
:
[],
loading
:
false
,
loading
:
false
,
redirect
:
this
.
$route
.
query
.
redirect
||
"
/
"
,
redirect
:
this
.
$route
.
query
.
redirect
||
"
/
"
,
...
...
admin_2/src/utils/request.js
View file @
e94eeda3
...
@@ -5,15 +5,15 @@ import axios from "axios";
...
@@ -5,15 +5,15 @@ import axios from "axios";
import
router
from
"
@/router
"
;
import
router
from
"
@/router
"
;
import
store
from
"
@/store
"
;
import
store
from
"
@/store
"
;
import
{
message
}
from
"
@/utils/resetMessage
"
;
import
{
message
}
from
"
@/utils/resetMessage
"
;
import
{
responseErr
,
loginErr
}
from
"
@/config
"
;
// 加载条插件
// 加载条插件
// import NProgress from "nprogress";
// import NProgress from "nprogress";
// 请求超时时间
// 请求超时时间
axios
.
defaults
.
timeout
=
60
*
1000
;
axios
.
defaults
.
timeout
=
60
*
1000
;
// 跨域允许携带cookie
axios
.
defaults
.
withCredentials
=
true
;
// 设置统一服务器地址
// 设置统一服务器地址
// axios.defaults.baseURL = ""
;
axios
.
defaults
.
baseURL
=
process
.
env
.
VUE_APP_API_BASE_URL
;
// 请求拦截
// 请求拦截
axios
.
interceptors
.
request
.
use
(
axios
.
interceptors
.
request
.
use
(
(
config
)
=>
{
(
config
)
=>
{
...
@@ -40,13 +40,15 @@ axios.interceptors.response.use(
...
@@ -40,13 +40,15 @@ axios.interceptors.response.use(
message
:
msg
,
message
:
msg
,
});
});
if
(
msg
===
"
非法用户,不可访问
"
)
{
if
(
msg
===
"
非法用户,不可访问
"
)
{
// 重置store下的user模块
store
.
commit
(
"
user/reset
"
);
store
.
commit
(
"
user/reset
"
);
router
.
push
(
"
/
"
);
router
.
push
(
"
/
"
);
}
}
}
else
if
(
code
===
401
||
code
===
201
||
code
==
9001
||
code
==
9002
)
{
}
else
if
(
loginErr
.
includes
(
code
)
)
{
message
.
error
({
message
.
error
({
message
:
msg
,
message
:
msg
,
});
});
// 重置store下的user模块
store
.
commit
(
"
user/reset
"
);
store
.
commit
(
"
user/reset
"
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
location
.
href
=
process
.
env
.
VUE_APP_API_portal_URL
;
location
.
href
=
process
.
env
.
VUE_APP_API_portal_URL
;
...
@@ -58,43 +60,8 @@ axios.interceptors.response.use(
...
@@ -58,43 +60,8 @@ axios.interceptors.response.use(
},
},
(
error
)
=>
{
(
error
)
=>
{
if
(
error
&&
error
.
response
)
{
if
(
error
&&
error
.
response
)
{
switch
(
error
.
response
.
status
)
{
let
msg
=
responseErr
[
error
.
response
.
status
];
case
400
:
error
.
message
=
msg
||
`连接错误
${
error
.
response
.
status
}
`
;
error
.
message
=
"
错误请求
"
;
break
;
case
403
:
error
.
message
=
"
拒绝访问
"
;
break
;
case
404
:
error
.
message
=
"
请求错误,未找到该资源
"
;
break
;
case
405
:
error
.
message
=
"
请求方法未允许
"
;
break
;
case
408
:
error
.
message
=
"
请求超时
"
;
break
;
case
500
:
error
.
message
=
"
服务器端出错
"
;
break
;
case
501
:
error
.
message
=
"
网络未实现
"
;
break
;
case
502
:
error
.
message
=
"
网络错误
"
;
break
;
case
503
:
error
.
message
=
"
服务不可用
"
;
break
;
case
504
:
error
.
message
=
"
网络超时
"
;
break
;
case
505
:
error
.
message
=
"
http版本不支持该请求
"
;
break
;
default
:
error
.
message
=
`连接错误
${
error
.
response
.
status
}
`
;
}
}
else
{
}
else
{
if
(
JSON
.
stringify
(
error
).
includes
(
"
timeout
"
))
{
if
(
JSON
.
stringify
(
error
).
includes
(
"
timeout
"
))
{
error
.
message
=
"
服务器响应超时,请刷新当前页
"
;
error
.
message
=
"
服务器响应超时,请刷新当前页
"
;
...
...
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