Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haobanDevOps
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
Open sidebar
office
haobanDevOps
Commits
ce0bc314
Commit
ce0bc314
authored
Jan 04, 2022
by
黑潮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 权限埋点
parent
a977ac86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
70 deletions
+70
-70
main.js
src/main.js
+66
-65
api-retry.vue
src/views/haoban/api-retry.vue
+2
-3
business-list.vue
src/views/haoban/business-list.vue
+2
-2
No files found.
src/main.js
View file @
ce0bc314
...
...
@@ -16,79 +16,80 @@ import '../static/font/iconfont.css'; // iconfont
import
'../theme/index.css'
;
// 新主题
import
'./assets/common.css'
;
import
filters
from
'./filters/index.js'
;
window
.
getLimit
(
router
,
'haoban-devops'
).
then
(()
=>
{
Vue
.
config
.
productionTip
=
false
;
Vue
.
config
.
productionTip
=
false
;
Vue
.
use
(
ElementUI
);
Vue
.
use
(
VueAxios
,
axios
);
Vue
.
use
(
ElementUI
);
Vue
.
use
(
VueAxios
,
axios
);
// 注册一个全局自定义指令 `v-focus`
Vue
.
directive
(
'focus'
,
function
(
el
)
{
el
.
querySelector
(
'input'
).
focus
();
});
// 全局注册过滤器
Object
.
keys
(
filters
).
forEach
(
key
=>
{
Vue
.
filter
(
key
,
filters
[
key
]);
});
// 注册一个全局自定义指令 `v-focus`
Vue
.
directive
(
'focus'
,
function
(
el
)
{
el
.
querySelector
(
'input'
).
focus
();
});
// 全局注册过滤器
Object
.
keys
(
filters
).
forEach
(
key
=>
{
Vue
.
filter
(
key
,
filters
[
key
]);
});
Vue
.
prototype
.
axios
.
withCredentials
=
true
;
// 跨域cookie访问
Vue
.
prototype
.
axios
.
withCredentials
=
true
;
// 跨域cookie访问
window
.
$bus
=
new
Vue
();
// 全局事件
window
.
$bus
=
new
Vue
();
// 全局事件
// Vue.axios.defaults.baseURL = process.env['NODE_ENV'] === 'development' ? 'http://gicdev.demogic.com' : 'https://hope.demogic.com/';
Vue
.
axios
.
interceptors
.
request
.
use
(
config
=>
{
return
config
;
},
err
=>
{
return
Promise
.
reject
(
err
);
}
);
Vue
.
axios
.
interceptors
.
response
.
use
(
response
=>
{
if
(
response
.
status
==
200
)
{
if
(
response
.
data
.
errorCode
==
4002
||
response
.
data
.
errorCode
==
4011
)
{
// 加上登录页
window
.
location
.
href
=
window
.
location
.
origin
+
'/operation-platform/#/'
;
}
// Vue.axios.defaults.baseURL = process.env['NODE_ENV'] === 'development' ? 'http://gicdev.demogic.com' : 'https://hope.demogic.com/';
Vue
.
axios
.
interceptors
.
request
.
use
(
config
=>
{
return
config
;
},
err
=>
{
return
Promise
.
reject
(
err
);
}
return
response
;
},
error
=>
{
if
(
error
.
response
)
{
switch
(
error
.
response
.
status
)
{
case
401
:
if
(
error
.
response
.
data
.
errorCode
==
4011
)
{
ElementUI
.
MessageBox
.
confirm
(
error
.
response
.
data
.
message
,
'提示'
,
{
confirmButtonText
:
'知道了'
,
showCancelButton
:
false
,
type
:
'warning'
})
.
then
(
_
=>
{
window
.
location
.
href
=
window
.
location
.
origin
+
'/operation-platform/#/'
;
);
Vue
.
axios
.
interceptors
.
response
.
use
(
response
=>
{
if
(
response
.
status
==
200
)
{
if
(
response
.
data
.
errorCode
==
4002
||
response
.
data
.
errorCode
==
4011
)
{
// 加上登录页
window
.
location
.
href
=
window
.
location
.
origin
+
'/operation-platform/#/'
;
}
}
return
response
;
},
error
=>
{
if
(
error
.
response
)
{
switch
(
error
.
response
.
status
)
{
case
401
:
if
(
error
.
response
.
data
.
errorCode
==
4011
)
{
ElementUI
.
MessageBox
.
confirm
(
error
.
response
.
data
.
message
,
'提示'
,
{
confirmButtonText
:
'知道了'
,
showCancelButton
:
false
,
type
:
'warning'
})
.
catch
(()
=>
{});
}
else
{
// 加上登录页
window
.
location
.
href
=
window
.
location
.
origin
+
'/operation-platform/#/'
;
}
break
;
case
403
:
if
(
error
.
response
.
data
.
errorCode
==
4004
)
{
ElementUI
.
Message
.
error
(
error
.
response
.
data
.
message
);
}
break
;
.
then
(
_
=>
{
window
.
location
.
href
=
window
.
location
.
origin
+
'/operation-platform/#/'
;
})
.
catch
(()
=>
{
});
}
else
{
// 加上登录页
window
.
location
.
href
=
window
.
location
.
origin
+
'/operation-platform/#/'
;
}
break
;
case
403
:
if
(
error
.
response
.
data
.
errorCode
==
4004
)
{
ElementUI
.
Message
.
error
(
error
.
response
.
data
.
message
);
}
break
;
}
}
return
Promise
.
reject
(
error
.
response
.
status
.
toString
());
}
return
Promise
.
reject
(
error
.
response
.
status
.
toString
());
}
);
);
/* eslint-disable no-new */
new
Vue
({
el
:
'#app'
,
router
,
store
,
components
:
{
App
},
template
:
'<App/>'
/* eslint-disable no-new */
new
Vue
({
el
:
'#app'
,
router
,
store
,
components
:
{
App
},
template
:
'<App/>'
});
});
src/views/haoban/api-retry.vue
View file @
ce0bc314
...
...
@@ -76,7 +76,7 @@
width=
"90"
fixed=
"right"
>
<
template
slot-scope=
"{row}"
>
<el-button
type=
"text"
@
click
.
prevent
.
native=
"retry(row.id)"
>
重试
</el-button>
<el-button
v-if=
"$getButtonLimit($buttonCode.interfaceRetry)"
:limit-code=
"$buttonCode.interfaceRetry"
type=
"text"
@
click
.
prevent
.
native=
"retry(row.id)"
>
重试
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -281,4 +281,4 @@ export default {
text-align
:
right
;
}
}
</
style
>
\ No newline at end of file
</
style
>
src/views/haoban/business-list.vue
View file @
ce0bc314
...
...
@@ -48,6 +48,7 @@
width=
"200"
>
<
template
slot-scope=
"{row}"
>
<el-button
v-if=
"$getButtonLimit($buttonCode.customerInformation)"
:limit-code=
"$buttonCode.customerInformation"
@
click
.
native
.
prevent=
"$router.push(
{ path: '/business-log?name=平台运维
&
icon=icon-03
&
code=platform_operation
&
tabCode=platform_business_list', query: { enterpriseId: row.enterpriseId } })"
type="text">
客户资料
...
...
@@ -182,4 +183,4 @@ export default {
text-align
:
right
;
margin-top
:
20px
;
}
</
style
>
\ No newline at end of file
</
style
>
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