Skip to content

Commit be8e54a

Browse files
author
zhongzhenlong
committed
finished
1 parent 6ffb423 commit be8e54a

File tree

10 files changed

+155
-44
lines changed

10 files changed

+155
-44
lines changed

src/axios.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'babel-polyfill'
22
import axios from "axios";
33
import auth from "./auth";
44
import {getBaseUrl} from "./common/utils"
5+
import {MessageBox} from "element-ui";
56

67
const instance = axios.create();
78

@@ -17,9 +18,9 @@ instance.interceptors.response.use(
1718
error => {
1819
if (error.response) {
1920
//全局ajax错误信息提示
20-
//Element.MessageBox({type:"error",message:error.response.data,title:"温馨提示"});
21+
//MessageBox({type:"error",message:error.response.data,title:"温馨提示",});
2122
}
22-
return Promise.reject(error);
23+
//return Promise.reject(error);
2324
});
2425

2526
function plugin(Vue)

src/pages/layout/header.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</el-dropdown>
2828
<el-dropdown trigger="click" class="navbar-dropdown">
2929
<div class="el-dropdown-link">
30-
<img :src='userInfo.avatar' style="width: 25px;height: 25px;border-radius: 50%; vertical-align: middle;" alt="User Image">
30+
<img :src='userInfo.avatar' style="width: 25px;height: 25px;border-radius: 50%; vertical-align: middle;" alt="U">
3131
{{userInfo.name}}
3232
</div>
3333
<el-dropdown-menu style="padding: 0px">
@@ -127,6 +127,15 @@
127127
this.list = res.data;
128128
}
129129
})
130+
.catch(err=>{
131+
this.list = [{"id":"640000201501165883","type":0,"code":107,"timeLine":"2013031613","message":"阶期查音音南这认式给自来走事。手进全线引其质行族导深些。","title":"作几点内部重压示现或采候器日","createTime":"426050337874","senderName":"Hall","senderPic":"http://dummyimage.com/100x100/f2799f/757575.png&text=H"},
132+
{"id":"15000019760303327X","type":1,"code":109,"timeLine":"1994030718","message":"听飞叫例感给其团南织主作什。","title":"府铁些以眼铁南单行办其被眼线","createTime":"612808881585","senderName":"Hall","senderPic":"http://dummyimage.com/100x100/79c3f2/757575.png&text=H"},
133+
{"id":"530000198607165793","type":1,"code":106,"timeLine":"1990122503","message":"于学认气感很效效引需说报党。调应各近思常市美许自毛完容矿日增。","title":"整近律马造起米农员济解题自例识个","createTime":"234654265042","senderName":"Rodriguez","senderPic":"http://dummyimage.com/100x100/e6f279/757575.png&text=R"},
134+
{"id":"320000200905032842","type":1,"code":103,"timeLine":"1980062104","message":"除年命却积同部去断权议党低二易过。","title":"消问料品把精是器话","createTime":"1194108860623","senderName":"Lewis","senderPic":"http://dummyimage.com/100x100/da79f2/757575.png&text=L"},
135+
{"id":"210000198109172937","type":1,"code":104,"timeLine":"1993041210","message":"具都主部确特次取圆派不儿日和难力。","title":"导结计市色通证确高想","createTime":"374284498307","senderName":"Hernandez","senderPic":"http://dummyimage.com/100x100/79f2b7/757575.png&text=H"},
136+
{"id":"410000200402164212","type":1,"code":108,"timeLine":"2015123015","message":"青矿地级质还进眼件每产它整区土容斯消。","title":"治龙工必近思空例东应","createTime":"626036503938","senderName":"Martinez","senderPic":"http://dummyimage.com/100x100/f29479/757575.png&text=M"}]
137+
this.count = this.list.length;
138+
})
130139
},
131140
mounted() {
132141
// document.addEventListener('click', this.autoHide, false)

src/pages/sys/default.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pages/sys/menu.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@
7676
import selectTree from "../../components/selectTree.vue"
7777
import treeter from "../../components/treeter"
7878
import merge from 'element-ui/src/utils/merge';
79+
import defaultValue from "./default";
7980
8081
import * as api from "../../api"
8182
83+
8284
export default {
8385
mixins: [treeter],
8486
components: {
@@ -164,7 +166,6 @@
164166
this.load();
165167
}).catch(e => {
166168
this.$message('操作成功');
167-
console.log(checkKeys);
168169
this.batchDeleteFromTree(this.menuTree, checkKeys);
169170
})
170171
});
@@ -184,7 +185,7 @@
184185
this.maxId += 1;
185186
this.$message('操作成功');
186187
this.form.id = this.maxId;
187-
var ddd = {
188+
var ddd = {
188189
id: this.form.id,
189190
name: this.form.name,
190191
sort: this.form.sort,
@@ -196,7 +197,6 @@
196197
desc: this.form.desc,
197198
children:[]
198199
}
199-
console.log(ddd)
200200
this.appendTreeNode(this.menuTree, ddd);
201201
this.menuTree.push({});
202202
this.menuTree.pop();
@@ -218,6 +218,7 @@
218218
this.menuTree = res.data;
219219
}).catch((error) => {
220220
console.log(error)
221+
this.menuTree = defaultValue.menuList;
221222
})
222223
}
223224
},

src/pages/sys/resource.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import selectTree from "../../components/selectTree.vue"
7171
import treeter from "../../components/treeter"
7272
import merge from 'element-ui/src/utils/merge';
73+
import defaultValue from "./default";
7374
7475
import * as api from "../../api"
7576
@@ -204,6 +205,8 @@
204205
this.resourceTree.push(...res.data)
205206
}).catch((error) => {
206207
console.log(error)
208+
this.resourceTree = [];
209+
this.resourceTree.push(...defaultValue.resource)
207210
})
208211
}
209212
},

src/pages/sys/role.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
import panel from "../../components/panel.vue"
8484
import selectTree from "../../components/selectTree.vue"
8585
import treeter from "../../components/treeter"
86+
import defaultValue from "./default";
8687
8788
8889
import * as api from "../../api"
@@ -205,6 +206,8 @@
205206
this.roleTree.push(...res.data)
206207
}).catch((error) => {
207208
console.log(error)
209+
this.roleTree = [];
210+
this.roleTree.push(...defaultValue.roleList)
208211
})
209212
},
210213
renderContent(h, {node, data, store}) {
@@ -224,13 +227,15 @@
224227
this.dialogVisible = true;
225228
if(this.resourceTree==null||this.resourceTree.length<=0){
226229
this.dialogLoading = true;
227-
this.$http.get(api.TEST_DATA)
230+
this.$http.get(api.SYS_RESOURCE_LIST)
228231
.then(res => {
229232
this.dialogLoading = false;
230233
this.resourceTree = res.data.resourceList;
231234
}).catch((error) => {
232235
console.log(error)
233236
this.dialogLoading = false;
237+
this.resourceTree = defaultValue.resource;
238+
234239
})
235240
}
236241
this.$http.get(api.SYS_ROLE_RESOURCE + "?id=" + id)

src/pages/sys/user.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
import panel from "../../components/panel.vue"
120120
import * as api from "../../api"
121121
import testData from "../../../static/data/data.json"
122+
import defaultValue from "./default";
122123
123124
export default {
124125
components: {
@@ -159,10 +160,13 @@
159160
this.currentRow = row;
160161
this.dialogVisible = true;
161162
if (this.roleTree.length <= 0) {
162-
this.$http.get( api.TEST_DATA + "?selectChildren=true")
163+
this.$http.get( api.SYS_ROLE_LIST + "?selectChildren=true")
163164
.then(res => {
164165
this.roleTree = res.data.roleList
165166
})
167+
.catch(err=>{
168+
this.roleTree = defaultValue.roleList
169+
})
166170
}
167171
this.$http.get(api.SYS_USER_ROLE + "?id=" + row.id)
168172
.then(res => {
@@ -194,16 +198,14 @@
194198
});
195199
},
196200
loadData(){
197-
// var d = {"offset":0,"limit":2147483647,"total":1,"size":10,"pages":1,"current":1,"searchCount":true,"optimizeCount":false,"orderByField":null,"records":[
198-
// {"id":1,"delFlag":0,"companyId":1,"officeId":2,"loginName":"admin","password":"",
199-
// "no":"0001","name":"系统管理员","email":"[email protected]","phone":"731","mobile":"13769999998",
200-
// "userType":"1","photo":null,"loginIp":"127.0.0.1","loginDate":1453188598000,"loginFlag":"1",
201-
// "remarks":"最高管理员","status":1,"token":null}],"condition":{},"asc":true,"offsetCurrent":0};
202-
// this.tableData.rows = d.records;
203201
this.$http.get(api.SYS_USER_PAGE + "?key=" + this.searchKey + "&pageSize=" + this.tableData.pagination.pageSize + "&pageNo=" + this.tableData.pagination.pageNo)
204202
.then(res => {
205203
this.tableData.rows = res.data.records;
206204
this.tableData.pagination.total = res.data.total;
205+
}).catch(err=>{
206+
debugger
207+
this.tableData.rows = defaultValue.userList;
208+
this.tableData.pagination.total = 99;
207209
});
208210
}
209211
},

0 commit comments

Comments
 (0)