Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
jinhui.wang
2022-04-28 18:08:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
81db746477fae3c71d6e450f21c1067deeb7ef85
81db7464
1 parent
a58a6c33
uat退出系统地址变更,组件功能更新,显示文本更改,退出逻辑修改
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
120 additions
and
90 deletions
src/assets/languages/dictLabels.js
src/layout/components/Navbar.vue
src/permission.js
src/store/modules/user.js
src/utils/request.js
src/views/systemConfig/menuConfig/index.vue
src/views/systemConfig/roleConfig/drawer.vue
src/views/systemConfig/roleConfig/index.vue
src/views/systemConfig/userConfig/index.vue
src/assets/languages/dictLabels.js
View file @
81db746
...
...
@@ -13,11 +13,11 @@ let ductLabels = {
"2"
:
"停用"
,
},
"valid"
:
{
"1"
:
"
开启
"
,
"1"
:
"
启用
"
,
"2"
:
"关闭"
,
},
"isValid"
:
{
"1"
:
"
开启
"
,
"1"
:
"
启用
"
,
"2"
:
"关闭"
,
},
"ticketToPiece"
:
{
...
...
@@ -29,7 +29,7 @@ let ductLabels = {
"0"
:
"否"
,
},
"highLowPriceFlg"
:
{
"1"
:
"
开启
"
,
"1"
:
"
启用
"
,
"0"
:
"未开启"
,
}
...
...
src/layout/components/Navbar.vue
View file @
81db746
...
...
@@ -61,6 +61,7 @@ import { mapGetters } from "vuex";
import Breadcrumb from "@/components/Breadcrumb";
import TopNav from "@/components/TopNav";
import Hamburger from "@/components/Hamburger";
import { removeToken } from '@/utils/auth'
export default {
components: {
...
...
@@ -146,8 +147,8 @@ export default {
type: "warning",
}).then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
// window.location.href = "https://test.secure.fedex.com/logout
";//wsso系统跳转
removeToken()
window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/
";//wsso系统跳转
});
});
},
...
...
src/permission.js
View file @
81db746
import
router
from
'./router'
import
store
from
'./store'
import
{
Message
}
from
'element-ui'
import
{
getToken
,
set
Token
}
from
'@/utils/auth'
import
{
getToken
,
setToken
,
remove
Token
}
from
'@/utils/auth'
const
whiteList
=
[
'/login'
,
'/auth-redirect'
,
'/bind'
,
'/register'
]
...
...
@@ -21,32 +21,33 @@ router.beforeEach((to, from, next) => {
next
({
...
to
,
replace
:
true
})
// hack方法 确保addRoutes已完成
})
}).
catch
(
err
=>
{
Message
.
error
(
err
)
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
// next({ path: '/' })
window
.
location
.
href
=
"https://testsso.ute.apac.fedex.com/logout"
;
//wsso系统跳转
})
Message
.
error
(
err
)
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
// next({ path: '/' })
window
.
location
.
href
=
"https://test-myapps.secure.fedex.com/purpleid/signout/"
;
//wsso系统跳转
})
})
}
else
{
next
()
}
}
}
else
{
removeToken
()
// 没有token
//wsso登录时对后端重定向带来的token进行记录
let
token
=
location
.
search
.
split
(
"token="
)[
1
]
if
(
token
!=
undefined
&&
token
!=
''
&&
token
!=
null
)
{
if
(
token
!=
undefined
&&
token
!=
''
&&
token
!=
null
)
{
setToken
(
token
)
next
({
path
:
'/'
})
}
else
{
}
else
{
if
(
whiteList
.
indexOf
(
to
.
path
)
!==
-
1
)
{
// 在免登录白名单,直接进入
next
()
}
else
{
window
.
location
.
href
=
"https://test
sso.ute.apac.fedex.com/logout
"
;
//wsso系统跳转
window
.
location
.
href
=
"https://test
-myapps.secure.fedex.com/purpleid/signout/
"
;
//wsso系统跳转
}
}
}
})
...
...
src/store/modules/user.js
View file @
81db746
...
...
@@ -77,7 +77,7 @@ const user = {
type
:
'error'
})
this
.
LogOut
().
then
(()
=>
{
window
.
location
.
href
=
"https://test
sso.ute.apac.fedex.com/logout
"
;
//wsso系统跳转
window
.
location
.
href
=
"https://test
-myapps.secure.fedex.com/purpleid/signout/
"
;
//wsso系统跳转
})
}
if
(
res
.
data
.
roles
&&
res
.
data
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
...
...
@@ -113,7 +113,7 @@ const user = {
LogOut
({
commit
,
state
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
logout
(
state
.
token
).
then
(()
=>
{
// window.location.href = "https://
sso.secure.fedex.com/log
out";//wsso系统跳转
// window.location.href = "https://
test-myapps.secure.fedex.com/purpleid/sign
out";//wsso系统跳转
commit
(
'SET_TOKEN'
,
''
)
commit
(
'SET_ROLES'
,
[])
commit
(
'SET_PERMISSIONS'
,
[])
...
...
@@ -128,7 +128,7 @@ const user = {
// 前端 登出
FedLogOut
({
commit
})
{
return
new
Promise
(
resolve
=>
{
// window.location.href = "https://
sso.secure.fedex.com/log
out";//wsso系统跳转
// window.location.href = "https://
test-myapps.secure.fedex.com/purpleid/sign
out";//wsso系统跳转
commit
(
'SET_TOKEN'
,
''
)
removeToken
()
resolve
()
...
...
src/utils/request.js
View file @
81db746
...
...
@@ -68,8 +68,8 @@ service.interceptors.response.use(res => {
}
).
then
(()
=>
{
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
// location.href = '/
index
';
window
.
location
.
href
=
"https://test
sso.ute.apac.fedex.com/logout
"
;
//wsso系统跳转
// location.href = '/';
window
.
location
.
href
=
"https://test
-myapps.secure.fedex.com/purpleid/signout/
"
;
//wsso系统跳转
// testsso.ute.apac.fedex.com/iMAC
})
});
...
...
src/views/systemConfig/menuConfig/index.vue
View file @
81db746
...
...
@@ -19,24 +19,40 @@
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column
v-for="(item, index) in tableHeader"
:prop="item.value"
:label="item.name"
:key="index"
:align="item.align"
header-align="center"
showOverflowTooltip
:width="item.width"
:formatter="formatter"
>
<template slot-scope="scope">
<el-tag v-if="item.value === 'menuType'" :type="scope.row.menuType === 'B'?'':'success'"
disable-transitions>{{scope.row.menuType === 'B'?'按钮':'菜单'}}</el-tag>
<span v-else>{{scope.row.title}}</span>
</template>
</el-table-column>
<template v-for="(item, index) in tableHeader">
<el-table-column
v-if="item.value === 'menuType'"
:prop="item.value"
:label="item.name"
:key="index"
:align="item.align"
header-align="center"
showOverflowTooltip
:width="item.width"
:formatter="formatter"
>
<template slot-scope="scope">
<el-tag
:type="scope.row.menuType === 'B' ? '' : 'success'"
disable-transitions
>{{ scope.row.menuType === "B" ? "按钮" : "菜单" }}</el-tag
>
</template>
</el-table-column>
<el-table-column
v-else
:prop="item.value"
:label="item.name"
:key="index"
:align="item.align"
header-align="center"
showOverflowTooltip
:width="item.width"
:formatter="formatter"
>
</el-table-column>
</template>
<el-table-column
header-align="center"
align="center"
...
...
@@ -112,7 +128,7 @@ import dictLabels from "@/assets/languages/dictLabels.js";
import Drawer from "./drawer.vue";
import { MessageBox } from "element-ui";
export default {
name:"MenuConfig",
name:
"MenuConfig",
components: {
Drawer,
},
...
...
@@ -120,13 +136,12 @@ export default {
return {
drawer: false,
menuFormDisabled: false,
loading:false,
loading:
false,
drawerTitle: "",
menuData: {},
data: [],
tableHeader: [
{
type: "",
name: "菜单名",
value: "title",
width: "200",
...
...
@@ -134,7 +149,6 @@ export default {
sorTable: false,
},
{
type: "",
name: "菜单类型",
value: "menuType",
width: "100",
...
...
@@ -142,7 +156,6 @@ export default {
sortable: false,
},
{
type: "",
name: "权限标识",
value: "permissionKey",
width: "auto",
...
...
@@ -150,7 +163,6 @@ export default {
sortable: false,
},
{
type: "",
name: "菜单状态",
value: "status",
width: "100",
...
...
@@ -158,7 +170,6 @@ export default {
sorTable: false,
},
{
type: "",
name: "菜单路由",
value: "path",
width: "auto",
...
...
@@ -169,15 +180,15 @@ export default {
};
},
created() {
if
(this.$store.state.tagsView.cachedViews.length == 0)
{
if
(this.$store.state.tagsView.cachedViews.length == 0)
{
this.menuAll();
}
},
activated(){
activated()
{
this.menuAll();
},
deactivated(){
this.data = []
deactivated()
{
this.data = []
;
},
methods: {
addMenu() {
...
...
@@ -202,24 +213,26 @@ export default {
//表格数据
menuAll() {
this.loading = true;
getAllAuth().then((res) => {
this.loading = false;
if (res.code === 200) {
res.data.length > 0
? (this.data = res.data)
: this.$message({
message: "数据为空",
type: "warning",
});
} else {
this.$message({
message: res.msg,
type: "warning",
});
}
}).catch(()=>{
this.loading = false;
});
getAllAuth()
.then((res) => {
this.loading = false;
if (res.code === 200) {
res.data.length > 0
? (this.data = res.data)
: this.$message({
message: "数据为空",
type: "warning",
});
} else {
this.$message({
message: res.msg,
type: "warning",
});
}
})
.catch(() => {
this.loading = false;
});
},
//菜单状态改变
...
...
@@ -232,10 +245,7 @@ export default {
message: "操作成功",
type: "success",
});
// location.reload()
this.$store.dispatch('tagsView/delAllCachedViews')
this.$store.dispatch('tagsView/delAllVisitedViews')
this.$router.push('/index')
location.reload();
} else {
this.$message({
message: res.msg,
...
...
@@ -283,7 +293,7 @@ export default {
})
.catch(() => {});
},
formatter(row, column, cellValue, index) {
if (dictLabels[column.property]) {
if (dictLabels[column.property][cellValue]) {
...
...
src/views/systemConfig/roleConfig/drawer.vue
View file @
81db746
...
...
@@ -65,7 +65,6 @@
:props="defaultProps"
:show-checkbox="true"
:default-checked-keys="roleData.menuIds"
check-strictly
accordion
>
</el-tree>
...
...
@@ -138,7 +137,7 @@ export default {
getAllAuth()
.then((res) => {
if (res.code === 200) {
this.treeData =
res.data
;
this.treeData =
this.treeDataInfo(res.data)
;
} else {
this.$message({
message: res.msg,
...
...
@@ -150,22 +149,22 @@ export default {
console.log(err);
});
},
watch:{
roleFormDisabled(){
this.treeData = this.treeDisabled(this.treeData)
watch:
{
roleFormDisabled()
{
this.treeData = this.treeDisabled(this.treeData)
;
},
drawer(val,
oldVal)
{
if
(val)
{
drawer(val,
oldVal)
{
if
(val)
{
this.roleForm = this.roleData;
}
else
{
}
else
{
this.loading = false;
}
}
}
}
,
},
methods: {
//关闭
handleClose() {
this.$refs[
'roleForm'
].clearValidate();
this.$refs[
"roleForm"
].clearValidate();
this.$emit("handleClose", false);
},
...
...
@@ -173,7 +172,11 @@ export default {
submit() {
let formData = {};
this.loading = true;
formData.menuIdList = this.$refs.tree.getCheckedKeys();
let arr = [];
arr = this.$refs.tree.getCheckedKeys().filter((item,index)=>{
return this.$refs.tree.getCheckedKeys().indexOf(item) == index
})
formData.menuIdList = arr;
this.roleData ? (formData.id = this.roleData.id) : "";
formData.remark = this.roleForm.remark;
formData.valid = this.roleForm.valid;
...
...
@@ -204,9 +207,24 @@ export default {
let data = [];
val.forEach((item) => {
item.disabled = this.roleFormDisabled;
data.push(item)
data.push(item);
if (item.children && item.children.length) {
item.children = this.treeDisabled(item.children);
}
});
return data;
},
treeDataInfo(val) {
let data = [];
val.forEach((item) => {
let menuItem = {};
menuItem.id = item.id;
menuItem.title = item.title;
data.push(menuItem)
if (item.children && item.children.length) {
item.children = this.treeDisabled(item.children)
menuItem.children = this.treeDataInfo(item.children);
menuItem.children.unshift({id:item.id,title:`${item.title}(菜单)`})
}
});
return data;
...
...
src/views/systemConfig/roleConfig/index.vue
View file @
81db746
...
...
@@ -28,8 +28,8 @@
<el-col :span="6">
<el-form-item label="状态">
<el-select v-model="formData.valid" placeholder="角色状态" clearable>
<el-option label="
开启
" value="1"> </el-option>
<el-option label="
关闭
" value="2"> </el-option>
<el-option label="
启用
" value="1"> </el-option>
<el-option label="
停用
" value="2"> </el-option>
</el-select>
</el-form-item>
</el-col>
...
...
src/views/systemConfig/userConfig/index.vue
View file @
81db746
...
...
@@ -23,8 +23,8 @@
<el-col :span="6">
<el-form-item label="状态">
<el-select placeholder="用户状态" v-model="formData.isValid" clearable>
<el-option label="
开启
" value="1"> </el-option>
<el-option label="
关闭
" value="2"> </el-option>
<el-option label="
启用
" value="1"> </el-option>
<el-option label="
停用
" value="2"> </el-option>
</el-select>
</el-form-item>
</el-col>
...
...
Please
register
or
login
to post a comment