jinhui.wang

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

...@@ -13,11 +13,11 @@ let ductLabels = { ...@@ -13,11 +13,11 @@ let ductLabels = {
13 "2": "停用", 13 "2": "停用",
14 }, 14 },
15 "valid": { 15 "valid": {
16 - "1": "开启", 16 + "1": "启用",
17 "2": "关闭", 17 "2": "关闭",
18 }, 18 },
19 "isValid": { 19 "isValid": {
20 - "1": "开启", 20 + "1": "启用",
21 "2": "关闭", 21 "2": "关闭",
22 }, 22 },
23 "ticketToPiece": { 23 "ticketToPiece": {
...@@ -29,7 +29,7 @@ let ductLabels = { ...@@ -29,7 +29,7 @@ let ductLabels = {
29 "0": "否", 29 "0": "否",
30 }, 30 },
31 "highLowPriceFlg": { 31 "highLowPriceFlg": {
32 - "1": "开启", 32 + "1": "启用",
33 "0": "未开启", 33 "0": "未开启",
34 } 34 }
35 35
......
...@@ -61,6 +61,7 @@ import { mapGetters } from "vuex"; ...@@ -61,6 +61,7 @@ import { mapGetters } from "vuex";
61 import Breadcrumb from "@/components/Breadcrumb"; 61 import Breadcrumb from "@/components/Breadcrumb";
62 import TopNav from "@/components/TopNav"; 62 import TopNav from "@/components/TopNav";
63 import Hamburger from "@/components/Hamburger"; 63 import Hamburger from "@/components/Hamburger";
64 +import { removeToken } from '@/utils/auth'
64 65
65 export default { 66 export default {
66 components: { 67 components: {
...@@ -146,8 +147,8 @@ export default { ...@@ -146,8 +147,8 @@ export default {
146 type: "warning", 147 type: "warning",
147 }).then(() => { 148 }).then(() => {
148 this.$store.dispatch("LogOut").then(() => { 149 this.$store.dispatch("LogOut").then(() => {
149 - location.href = "/index"; 150 + removeToken()
150 - // window.location.href = "https://test.secure.fedex.com/logout";//wsso系统跳转 151 + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转
151 }); 152 });
152 }); 153 });
153 }, 154 },
......
1 import router from './router' 1 import router from './router'
2 import store from './store' 2 import store from './store'
3 import { Message } from 'element-ui' 3 import { Message } from 'element-ui'
4 -import { getToken,setToken } from '@/utils/auth' 4 +import { getToken, setToken, removeToken } from '@/utils/auth'
5 5
6 6
7 const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] 7 const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
...@@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => { ...@@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => {
24 Message.error(err) 24 Message.error(err)
25 store.dispatch('LogOut').then(() => { 25 store.dispatch('LogOut').then(() => {
26 // next({ path: '/' }) 26 // next({ path: '/' })
27 - window.location.href = "https://testsso.ute.apac.fedex.com/logout";//wsso系统跳转 27 + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转
28 }) 28 })
29 }) 29 })
30 } else { 30 } else {
...@@ -32,18 +32,19 @@ router.beforeEach((to, from, next) => { ...@@ -32,18 +32,19 @@ router.beforeEach((to, from, next) => {
32 } 32 }
33 } 33 }
34 } else { 34 } else {
35 + removeToken()
35 // 没有token 36 // 没有token
36 //wsso登录时对后端重定向带来的token进行记录 37 //wsso登录时对后端重定向带来的token进行记录
37 let token = location.search.split("token=")[1] 38 let token = location.search.split("token=")[1]
38 - if(token != undefined && token != '' && token != null){ 39 + if (token != undefined && token != '' && token != null) {
39 setToken(token) 40 setToken(token)
40 next({ path: '/' }) 41 next({ path: '/' })
41 - }else{ 42 + } else {
42 if (whiteList.indexOf(to.path) !== -1) { 43 if (whiteList.indexOf(to.path) !== -1) {
43 // 在免登录白名单,直接进入 44 // 在免登录白名单,直接进入
44 next() 45 next()
45 } else { 46 } else {
46 - window.location.href = "https://testsso.ute.apac.fedex.com/logout";//wsso系统跳转 47 + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转
47 } 48 }
48 } 49 }
49 50
......
...@@ -77,7 +77,7 @@ const user = { ...@@ -77,7 +77,7 @@ const user = {
77 type: 'error' 77 type: 'error'
78 }) 78 })
79 this.LogOut().then(()=>{ 79 this.LogOut().then(()=>{
80 - window.location.href = "https://testsso.ute.apac.fedex.com/logout";//wsso系统跳转 80 + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转
81 }) 81 })
82 } 82 }
83 if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 83 if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
...@@ -113,7 +113,7 @@ const user = { ...@@ -113,7 +113,7 @@ const user = {
113 LogOut({ commit, state }) { 113 LogOut({ commit, state }) {
114 return new Promise((resolve, reject) => { 114 return new Promise((resolve, reject) => {
115 logout(state.token).then(() => { 115 logout(state.token).then(() => {
116 - // window.location.href = "https://sso.secure.fedex.com/logout";//wsso系统跳转 116 + // window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//wsso系统跳转
117 commit('SET_TOKEN', '') 117 commit('SET_TOKEN', '')
118 commit('SET_ROLES', []) 118 commit('SET_ROLES', [])
119 commit('SET_PERMISSIONS', []) 119 commit('SET_PERMISSIONS', [])
...@@ -128,7 +128,7 @@ const user = { ...@@ -128,7 +128,7 @@ const user = {
128 // 前端 登出 128 // 前端 登出
129 FedLogOut({ commit }) { 129 FedLogOut({ commit }) {
130 return new Promise(resolve => { 130 return new Promise(resolve => {
131 - // window.location.href = "https://sso.secure.fedex.com/logout";//wsso系统跳转 131 + // window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//wsso系统跳转
132 commit('SET_TOKEN', '') 132 commit('SET_TOKEN', '')
133 removeToken() 133 removeToken()
134 resolve() 134 resolve()
......
...@@ -68,8 +68,8 @@ service.interceptors.response.use(res => { ...@@ -68,8 +68,8 @@ service.interceptors.response.use(res => {
68 } 68 }
69 ).then(() => { 69 ).then(() => {
70 store.dispatch('LogOut').then(() => { 70 store.dispatch('LogOut').then(() => {
71 - // location.href = '/index'; 71 + // location.href = '/';
72 - window.location.href = "https://testsso.ute.apac.fedex.com/logout";//wsso系统跳转 72 + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转
73 // testsso.ute.apac.fedex.com/iMAC 73 // testsso.ute.apac.fedex.com/iMAC
74 }) 74 })
75 }); 75 });
......
...@@ -19,8 +19,9 @@ ...@@ -19,8 +19,9 @@
19 default-expand-all 19 default-expand-all
20 :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" 20 :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
21 > 21 >
22 + <template v-for="(item, index) in tableHeader">
22 <el-table-column 23 <el-table-column
23 - v-for="(item, index) in tableHeader" 24 + v-if="item.value === 'menuType'"
24 :prop="item.value" 25 :prop="item.value"
25 :label="item.name" 26 :label="item.name"
26 :key="index" 27 :key="index"
...@@ -31,11 +32,26 @@ ...@@ -31,11 +32,26 @@
31 :formatter="formatter" 32 :formatter="formatter"
32 > 33 >
33 <template slot-scope="scope"> 34 <template slot-scope="scope">
34 - <el-tag v-if="item.value === 'menuType'" :type="scope.row.menuType === 'B'?'':'success'" 35 + <el-tag
35 - disable-transitions>{{scope.row.menuType === 'B'?'按钮':'菜单'}}</el-tag> 36 + :type="scope.row.menuType === 'B' ? '' : 'success'"
36 - <span v-else>{{scope.row.title}}</span> 37 + disable-transitions
38 + >{{ scope.row.menuType === "B" ? "按钮" : "菜单" }}</el-tag
39 + >
37 </template> 40 </template>
38 </el-table-column> 41 </el-table-column>
42 + <el-table-column
43 + v-else
44 + :prop="item.value"
45 + :label="item.name"
46 + :key="index"
47 + :align="item.align"
48 + header-align="center"
49 + showOverflowTooltip
50 + :width="item.width"
51 + :formatter="formatter"
52 + >
53 + </el-table-column>
54 + </template>
39 55
40 <el-table-column 56 <el-table-column
41 header-align="center" 57 header-align="center"
...@@ -112,7 +128,7 @@ import dictLabels from "@/assets/languages/dictLabels.js"; ...@@ -112,7 +128,7 @@ import dictLabels from "@/assets/languages/dictLabels.js";
112 import Drawer from "./drawer.vue"; 128 import Drawer from "./drawer.vue";
113 import { MessageBox } from "element-ui"; 129 import { MessageBox } from "element-ui";
114 export default { 130 export default {
115 - name:"MenuConfig", 131 + name: "MenuConfig",
116 components: { 132 components: {
117 Drawer, 133 Drawer,
118 }, 134 },
...@@ -120,13 +136,12 @@ export default { ...@@ -120,13 +136,12 @@ export default {
120 return { 136 return {
121 drawer: false, 137 drawer: false,
122 menuFormDisabled: false, 138 menuFormDisabled: false,
123 - loading:false, 139 + loading: false,
124 drawerTitle: "", 140 drawerTitle: "",
125 menuData: {}, 141 menuData: {},
126 data: [], 142 data: [],
127 tableHeader: [ 143 tableHeader: [
128 { 144 {
129 - type: "",
130 name: "菜单名", 145 name: "菜单名",
131 value: "title", 146 value: "title",
132 width: "200", 147 width: "200",
...@@ -134,7 +149,6 @@ export default { ...@@ -134,7 +149,6 @@ export default {
134 sorTable: false, 149 sorTable: false,
135 }, 150 },
136 { 151 {
137 - type: "",
138 name: "菜单类型", 152 name: "菜单类型",
139 value: "menuType", 153 value: "menuType",
140 width: "100", 154 width: "100",
...@@ -142,7 +156,6 @@ export default { ...@@ -142,7 +156,6 @@ export default {
142 sortable: false, 156 sortable: false,
143 }, 157 },
144 { 158 {
145 - type: "",
146 name: "权限标识", 159 name: "权限标识",
147 value: "permissionKey", 160 value: "permissionKey",
148 width: "auto", 161 width: "auto",
...@@ -150,7 +163,6 @@ export default { ...@@ -150,7 +163,6 @@ export default {
150 sortable: false, 163 sortable: false,
151 }, 164 },
152 { 165 {
153 - type: "",
154 name: "菜单状态", 166 name: "菜单状态",
155 value: "status", 167 value: "status",
156 width: "100", 168 width: "100",
...@@ -158,7 +170,6 @@ export default { ...@@ -158,7 +170,6 @@ export default {
158 sorTable: false, 170 sorTable: false,
159 }, 171 },
160 { 172 {
161 - type: "",
162 name: "菜单路由", 173 name: "菜单路由",
163 value: "path", 174 value: "path",
164 width: "auto", 175 width: "auto",
...@@ -169,15 +180,15 @@ export default { ...@@ -169,15 +180,15 @@ export default {
169 }; 180 };
170 }, 181 },
171 created() { 182 created() {
172 - if(this.$store.state.tagsView.cachedViews.length == 0){ 183 + if (this.$store.state.tagsView.cachedViews.length == 0) {
173 this.menuAll(); 184 this.menuAll();
174 } 185 }
175 }, 186 },
176 - activated(){ 187 + activated() {
177 this.menuAll(); 188 this.menuAll();
178 }, 189 },
179 - deactivated(){ 190 + deactivated() {
180 - this.data = [] 191 + this.data = [];
181 }, 192 },
182 methods: { 193 methods: {
183 addMenu() { 194 addMenu() {
...@@ -202,7 +213,8 @@ export default { ...@@ -202,7 +213,8 @@ export default {
202 //表格数据 213 //表格数据
203 menuAll() { 214 menuAll() {
204 this.loading = true; 215 this.loading = true;
205 - getAllAuth().then((res) => { 216 + getAllAuth()
217 + .then((res) => {
206 this.loading = false; 218 this.loading = false;
207 if (res.code === 200) { 219 if (res.code === 200) {
208 res.data.length > 0 220 res.data.length > 0
...@@ -217,7 +229,8 @@ export default { ...@@ -217,7 +229,8 @@ export default {
217 type: "warning", 229 type: "warning",
218 }); 230 });
219 } 231 }
220 - }).catch(()=>{ 232 + })
233 + .catch(() => {
221 this.loading = false; 234 this.loading = false;
222 }); 235 });
223 }, 236 },
...@@ -232,10 +245,7 @@ export default { ...@@ -232,10 +245,7 @@ export default {
232 message: "操作成功", 245 message: "操作成功",
233 type: "success", 246 type: "success",
234 }); 247 });
235 - // location.reload() 248 + location.reload();
236 - this.$store.dispatch('tagsView/delAllCachedViews')
237 - this.$store.dispatch('tagsView/delAllVisitedViews')
238 - this.$router.push('/index')
239 } else { 249 } else {
240 this.$message({ 250 this.$message({
241 message: res.msg, 251 message: res.msg,
......
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
65 :props="defaultProps" 65 :props="defaultProps"
66 :show-checkbox="true" 66 :show-checkbox="true"
67 :default-checked-keys="roleData.menuIds" 67 :default-checked-keys="roleData.menuIds"
68 - check-strictly
69 accordion 68 accordion
70 > 69 >
71 </el-tree> 70 </el-tree>
...@@ -138,7 +137,7 @@ export default { ...@@ -138,7 +137,7 @@ export default {
138 getAllAuth() 137 getAllAuth()
139 .then((res) => { 138 .then((res) => {
140 if (res.code === 200) { 139 if (res.code === 200) {
141 - this.treeData = res.data; 140 + this.treeData = this.treeDataInfo(res.data);
142 } else { 141 } else {
143 this.$message({ 142 this.$message({
144 message: res.msg, 143 message: res.msg,
...@@ -150,22 +149,22 @@ export default { ...@@ -150,22 +149,22 @@ export default {
150 console.log(err); 149 console.log(err);
151 }); 150 });
152 }, 151 },
153 - watch:{ 152 + watch: {
154 - roleFormDisabled(){ 153 + roleFormDisabled() {
155 - this.treeData = this.treeDisabled(this.treeData) 154 + this.treeData = this.treeDisabled(this.treeData);
156 }, 155 },
157 - drawer(val,oldVal){ 156 + drawer(val, oldVal) {
158 - if(val){ 157 + if (val) {
159 this.roleForm = this.roleData; 158 this.roleForm = this.roleData;
160 - }else{ 159 + } else {
161 this.loading = false; 160 this.loading = false;
162 } 161 }
163 - } 162 + },
164 }, 163 },
165 methods: { 164 methods: {
166 //关闭 165 //关闭
167 handleClose() { 166 handleClose() {
168 - this.$refs['roleForm'].clearValidate(); 167 + this.$refs["roleForm"].clearValidate();
169 this.$emit("handleClose", false); 168 this.$emit("handleClose", false);
170 }, 169 },
171 170
...@@ -173,7 +172,11 @@ export default { ...@@ -173,7 +172,11 @@ export default {
173 submit() { 172 submit() {
174 let formData = {}; 173 let formData = {};
175 this.loading = true; 174 this.loading = true;
176 - formData.menuIdList = this.$refs.tree.getCheckedKeys(); 175 + let arr = [];
176 + arr = this.$refs.tree.getCheckedKeys().filter((item,index)=>{
177 + return this.$refs.tree.getCheckedKeys().indexOf(item) == index
178 + })
179 + formData.menuIdList = arr;
177 this.roleData ? (formData.id = this.roleData.id) : ""; 180 this.roleData ? (formData.id = this.roleData.id) : "";
178 formData.remark = this.roleForm.remark; 181 formData.remark = this.roleForm.remark;
179 formData.valid = this.roleForm.valid; 182 formData.valid = this.roleForm.valid;
...@@ -204,9 +207,24 @@ export default { ...@@ -204,9 +207,24 @@ export default {
204 let data = []; 207 let data = [];
205 val.forEach((item) => { 208 val.forEach((item) => {
206 item.disabled = this.roleFormDisabled; 209 item.disabled = this.roleFormDisabled;
207 - data.push(item) 210 + data.push(item);
211 + if (item.children && item.children.length) {
212 + item.children = this.treeDisabled(item.children);
213 + }
214 + });
215 + return data;
216 + },
217 +
218 + treeDataInfo(val) {
219 + let data = [];
220 + val.forEach((item) => {
221 + let menuItem = {};
222 + menuItem.id = item.id;
223 + menuItem.title = item.title;
224 + data.push(menuItem)
208 if (item.children && item.children.length) { 225 if (item.children && item.children.length) {
209 - item.children = this.treeDisabled(item.children) 226 + menuItem.children = this.treeDataInfo(item.children);
227 + menuItem.children.unshift({id:item.id,title:`${item.title}(菜单)`})
210 } 228 }
211 }); 229 });
212 return data; 230 return data;
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
28 <el-col :span="6"> 28 <el-col :span="6">
29 <el-form-item label="状态"> 29 <el-form-item label="状态">
30 <el-select v-model="formData.valid" placeholder="角色状态" clearable> 30 <el-select v-model="formData.valid" placeholder="角色状态" clearable>
31 - <el-option label="开启" value="1"> </el-option> 31 + <el-option label="启用" value="1"> </el-option>
32 - <el-option label="关闭" value="2"> </el-option> 32 + <el-option label="停用" value="2"> </el-option>
33 </el-select> 33 </el-select>
34 </el-form-item> 34 </el-form-item>
35 </el-col> 35 </el-col>
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
23 <el-col :span="6"> 23 <el-col :span="6">
24 <el-form-item label="状态"> 24 <el-form-item label="状态">
25 <el-select placeholder="用户状态" v-model="formData.isValid" clearable> 25 <el-select placeholder="用户状态" v-model="formData.isValid" clearable>
26 - <el-option label="开启" value="1"> </el-option> 26 + <el-option label="启用" value="1"> </el-option>
27 - <el-option label="关闭" value="2"> </el-option> 27 + <el-option label="停用" value="2"> </el-option>
28 </el-select> 28 </el-select>
29 </el-form-item> 29 </el-form-item>
30 </el-col> 30 </el-col>
......