mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-21 11:08:54 +00:00
feat: 修改request拦截
This commit is contained in:
@@ -73,6 +73,7 @@ export default {
|
|||||||
prop: 'hostname',
|
prop: 'hostname',
|
||||||
label: this.$t('assets.Hostname'),
|
label: this.$t('assets.Hostname'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
showOverflowTooltip: true,
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
route: 'AssetDetail'
|
route: 'AssetDetail'
|
||||||
|
@@ -49,7 +49,8 @@ service.interceptors.request.use(
|
|||||||
)
|
)
|
||||||
|
|
||||||
function ifUnauthorized({ response, error }) {
|
function ifUnauthorized({ response, error }) {
|
||||||
if (response.status === 401 && response.config.url.indexOf('/users/profile') !== -1) {
|
if (response.status === 401 && response.request.url.indexOf('/users/profile') !== -1) {
|
||||||
|
response.config.disableFlashErrorMsg = true
|
||||||
// 未授权重定向到登录页面
|
// 未授权重定向到登录页面
|
||||||
const title = i18n.t('common.Info')
|
const title = i18n.t('common.Info')
|
||||||
const msg = i18n.t('auth.LoginRequiredMsg')
|
const msg = i18n.t('auth.LoginRequiredMsg')
|
||||||
@@ -64,7 +65,6 @@ function ifUnauthorized({ response, error }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ifBadRequest({ response, error }) {
|
function ifBadRequest({ response, error }) {
|
||||||
console.log(response)
|
|
||||||
if (response.status === 400) {
|
if (response.status === 400) {
|
||||||
error.message = i18n.t('common.BadRequestErrorMsg')
|
error.message = i18n.t('common.BadRequestErrorMsg')
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ module.exports = {
|
|||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
devServer: {
|
devServer: {
|
||||||
port: port,
|
port: port,
|
||||||
host: 'localhost',
|
host: '0.0.0.0',
|
||||||
open: false,
|
open: false,
|
||||||
overlay: {
|
overlay: {
|
||||||
warnings: false,
|
warnings: false,
|
||||||
|
Reference in New Issue
Block a user