diff --git a/.env.development b/.env.development index 686d928..f9ba1de 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 信联 ENV = 'development' # 修改为你真实的接口前缀 -VUE_APP_BASE_API = '/api_admin/v1' +VUE_APP_BASE_API = '/api/v1' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index b12af66..a4aabf7 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,4 @@ VUE_APP_TITLE = 信联 ENV = 'production' # 信联/生产环境 -VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = '/api/v1' diff --git a/.env.staging b/.env.staging index 1c8a4d3..e1b7d7c 100644 --- a/.env.staging +++ b/.env.staging @@ -9,4 +9,4 @@ NODE_ENV = production ENV = 'staging' # 信联/测试环境 -VUE_APP_BASE_API = '/stage-api' +VUE_APP_BASE_API = '/api/v1' diff --git a/src/api/login.js b/src/api/login.js index c70850d..6dab655 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -57,4 +57,12 @@ export function getCodeImg() { method: 'get', timeout: 20000 }) -} \ No newline at end of file +} +// 获取网络配置 +export function getCommonConfigOptions(data) { + return request({ + url: '/common/config/options', + method: 'post', + data: data + }) +} diff --git a/src/permission.js b/src/permission.js index b818358..5b905fc 100644 --- a/src/permission.js +++ b/src/permission.js @@ -37,18 +37,20 @@ router.beforeEach((to, from, next) => { isRelogin.show = true // 判断当前用户是否已拉取完user_info信息 store.dispatch('GetInfo').then(() => { - isRelogin.show = false - store.dispatch('GenerateRoutes').then(accessRoutes => { - // 根据roles权限生成可访问的路由表 - router.addRoutes(accessRoutes) // 动态添加可访问路由表 - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 + store.dispatch('GetNetConfig').then(res => { + isRelogin.show = false + store.dispatch('GenerateRoutes').then(accessRoutes => { + // 根据roles权限生成可访问的路由表 + router.addRoutes(accessRoutes) // 动态添加可访问路由表 + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 + }) }) }).catch(err => { - store.dispatch('LogOut').then(() => { - Message.error(err) - next({ path: '/' }) - }) + store.dispatch('LogOut').then(() => { + Message.error(err) + next({ path: '/' }) }) + }) } else { next() } diff --git a/src/views/utility/index.vue b/src/views/utility/index.vue index 0e9409a..cca7a86 100644 --- a/src/views/utility/index.vue +++ b/src/views/utility/index.vue @@ -9,188 +9,361 @@ style="float: right; padding: 3px 0" type="text" icon="el-icon-delete" - @click="handleClearRecords" + :disabled="groupedRecords.length === 0" + @click="handleClearAll" > 清空记录 -