表格优化
This commit is contained in:
@@ -17,7 +17,7 @@ const loadingInstance: LoadingInstance = {
|
||||
* 根据运行环境获取基础请求URL
|
||||
*/
|
||||
export const getUrl = (): string => {
|
||||
if (import.meta.env.MODE == 'development') return '/api'
|
||||
if (import.meta.env.MODE == 'development' || location.hostname === 'localhost') return '/api'
|
||||
return window.location.protocol + '//' + window.location.host
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,9 @@ export default class TableStore {
|
||||
requestPayload(this.method, this.table.params)
|
||||
)
|
||||
).then((res: any) => {
|
||||
|
||||
this.table.data = res.data.records || res.data
|
||||
console.log(this.table.data)
|
||||
this.table.total = res.data.total || res.data.length
|
||||
this.table.loading = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user