jinhui.wang

uat退出系统地址变更,组件功能更新,显示文本更改,退出逻辑修改

......@@ -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": "未开启",
}
......
......@@ -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系统跳转
});
});
},
......
import router from './router'
import store from './store'
import { Message } from 'element-ui'
import { getToken,setToken } from '@/utils/auth'
import { getToken, setToken, removeToken } from '@/utils/auth'
const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
......@@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => {
Message.error(err)
store.dispatch('LogOut').then(() => {
// next({ path: '/' })
window.location.href = "https://testsso.ute.apac.fedex.com/logout";//wsso系统跳转
window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转
})
})
} else {
......@@ -32,18 +32,19 @@ router.beforeEach((to, from, 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://testsso.ute.apac.fedex.com/logout";//wsso系统跳转
window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转
}
}
......
......@@ -77,7 +77,7 @@ const user = {
type: 'error'
})
this.LogOut().then(()=>{
window.location.href = "https://testsso.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/logout";//wsso系统跳转
// window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//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/logout";//wsso系统跳转
// window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//wsso系统跳转
commit('SET_TOKEN', '')
removeToken()
resolve()
......
......@@ -68,8 +68,8 @@ service.interceptors.response.use(res => {
}
).then(() => {
store.dispatch('LogOut').then(() => {
// location.href = '/index';
window.location.href = "https://testsso.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
})
});
......
......@@ -19,8 +19,9 @@
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<template v-for="(item, index) in tableHeader">
<el-table-column
v-for="(item, index) in tableHeader"
v-if="item.value === 'menuType'"
:prop="item.value"
:label="item.name"
:key="index"
......@@ -31,11 +32,26 @@
: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>
<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"
......@@ -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,7 +213,8 @@ export default {
//表格数据
menuAll() {
this.loading = true;
getAllAuth().then((res) => {
getAllAuth()
.then((res) => {
this.loading = false;
if (res.code === 200) {
res.data.length > 0
......@@ -217,7 +229,8 @@ export default {
type: "warning",
});
}
}).catch(()=>{
})
.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,
......
......@@ -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;
......
......@@ -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>
......
......@@ -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>
......