update list response

This commit is contained in:
lb 2022-08-04 14:41:47 +08:00
parent d3752c4f40
commit 3df2939fb4
33 changed files with 79 additions and 76 deletions

View File

@ -10,6 +10,7 @@
window.SITE_CONFIG['version'] = 'v5.0.0'; window.SITE_CONFIG['version'] = 'v5.0.0';
window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>'; window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>';
window.SITE_CONFIG['apiURL'] = ''; // api请求地址 window.SITE_CONFIG['apiURL'] = ''; // api请求地址
window.SITE_CONFIG['projURL'] = '/yd-monitor'; // api请求地址
window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态用于不刷新页面的情况下也能重置初始化项目中所有状态 window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态用于不刷新页面的情况下也能重置初始化项目中所有状态
window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象 window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象
'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径) 'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
@ -30,7 +31,7 @@
<!-- 开发环境 --> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.65:8080/yd-monitor'; window.SITE_CONFIG['apiURL'] = 'http://192.168.1.65:8080';
</script> </script>
<% } %> <% } %>
<!-- 集成测试环境 --> <!-- 集成测试环境 -->

View File

@ -44,7 +44,9 @@ export default {
query() { query() {
this.dataListLoading = true this.dataListLoading = true
this.$http.get( this.$http.get(
this.mixinViewModuleOptions.getDataListURL, this.$http.adornUrl(
this.mixinViewModuleOptions.getDataListURL
),
{ {
params: { params: {
order: this.order, order: this.order,

View File

@ -92,7 +92,7 @@ router.beforeEach((to, from, next) => {
return next() return next()
} }
// 获取字典列表, 添加并全局变量保存 // 获取字典列表, 添加并全局变量保存
http.get('/sys/dict/type/all').then(({ data: res }) => { http.get(http.adornUrl('/sys/dict/type/all')).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return return
} }
@ -101,7 +101,7 @@ router.beforeEach((to, from, next) => {
// console.log("catch /sys/dict/type/all", err) // console.log("catch /sys/dict/type/all", err)
}) })
// 获取菜单列表, 添加并全局变量保存 // 获取菜单列表, 添加并全局变量保存
http.get('/sys/menu/nav').then(({ data: res }) => { http.get(http.adornUrl('/sys/menu/nav')).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
Vue.prototype.$message.error(res.msg) Vue.prototype.$message.error(res.msg)
return next({ name: 'login' }) return next({ name: 'login' })

View File

@ -68,7 +68,7 @@ http.interceptors.response.use(response => {
*/ */
http.adornUrl = (actionName) => { http.adornUrl = (actionName) => {
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截! // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.projURL) + actionName
} }
/** /**

View File

@ -89,7 +89,7 @@ export default {
cancelButtonText: this.$t('cancel'), cancelButtonText: this.$t('cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http.post('/doLogout').then(({ data: res }) => { this.$http.post(this.$http.adornUrl('/doLogout')).then(({ data: res }) => {
if (res.code !== 200) { if (res.code !== 200) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }

View File

@ -187,8 +187,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -169,8 +169,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -163,8 +163,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -251,8 +251,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -169,8 +169,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -199,8 +199,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -217,8 +217,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -163,8 +163,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -247,8 +247,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -193,8 +193,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -187,8 +187,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -181,8 +181,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -187,8 +187,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -172,7 +172,7 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/factory/list'), url: this.$http.adornUrl('/monitoring/factory/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, 'page': this.pageIndex,
@ -181,8 +181,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -187,8 +187,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -205,8 +205,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -193,8 +193,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -133,8 +133,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -163,8 +163,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -193,8 +193,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -157,8 +157,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -193,8 +193,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -175,8 +175,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -169,8 +169,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -157,8 +157,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -187,8 +187,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -163,8 +163,8 @@
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.list
this.totalPage = data.page.totalCount this.totalPage = data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0

View File

@ -98,7 +98,7 @@ export default {
if (!valid) { if (!valid) {
return false return false
} }
this.$http.post('/login', this.dataForm).then(({ data: res }) => { this.$http.post(this.$http.adornUrl('/login'), this.dataForm).then(({ data: res }) => {
if (res.code !== 200) { if (res.code !== 200) {
// this.getCaptcha() // this.getCaptcha()
return this.$message.error(res.msg) return this.$message.error(res.msg)