From 2b630ef3f2e3e0c2e42ced07847e070f32b24d12 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 1 Feb 2022 22:59:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=A8=A1=E5=9D=97=E9=87=8D=E6=9E=84?= =?UTF-8?q?=209=EF=BC=9A=E8=B0=83=E6=95=B4=E7=9A=84=E8=AF=B7=E6=B1=82=20UR?= =?UTF-8?q?L?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-admin-ui/src/api/login.js | 16 ++++++++-------- yudao-admin-ui/src/api/menu.js | 2 +- yudao-admin-ui/src/store/modules/dict.js | 4 ++++ yudao-admin-ui/src/utils/request.js | 2 +- 更新日志.md | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/yudao-admin-ui/src/api/login.js b/yudao-admin-ui/src/api/login.js index 348aef06..24a9df47 100644 --- a/yudao-admin-ui/src/api/login.js +++ b/yudao-admin-ui/src/api/login.js @@ -9,7 +9,7 @@ export function login(username, password, code, uuid) { uuid } return request({ - url: '/login', + url: '/system/login', method: 'post', data: data }) @@ -18,7 +18,7 @@ export function login(username, password, code, uuid) { // 获取用户详细信息 export function getInfo() { return request({ - url: '/get-permission-info', + url: '/system/get-permission-info', method: 'get' }) } @@ -26,7 +26,7 @@ export function getInfo() { // 退出方法 export function logout() { return request({ - url: '/logout', + url: '/system/logout', method: 'post' }) } @@ -42,7 +42,7 @@ export function getCodeImg() { // 社交授权的跳转 export function socialAuthRedirect(type, redirectUri) { return request({ - url: '/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri, + url: '/system/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri, method: 'get' }) } @@ -50,7 +50,7 @@ export function socialAuthRedirect(type, redirectUri) { // 社交登录,使用 code 授权码 export function socialLogin(type, code, state) { return request({ - url: '/social-login', + url: '/system/social-login', method: 'post', data: { type, @@ -63,7 +63,7 @@ export function socialLogin(type, code, state) { // 社交登录,使用 code 授权码 + + 账号密码 export function socialLogin2(type, code, state, username, password) { return request({ - url: '/social-login2', + url: '/system/social-login2', method: 'post', data: { type, @@ -78,7 +78,7 @@ export function socialLogin2(type, code, state, username, password) { // 社交绑定,使用 code 授权码 export function socialBind(type, code, state) { return request({ - url: '/social-bind', + url: '/system/social-bind', method: 'post', data: { type, @@ -91,7 +91,7 @@ export function socialBind(type, code, state) { // 取消社交绑定 export function socialUnbind(type, unionId) { return request({ - url: '/social-unbind', + url: '/system/social-unbind', method: 'delete', data: { type, diff --git a/yudao-admin-ui/src/api/menu.js b/yudao-admin-ui/src/api/menu.js index 01fbbc9f..48df3dd5 100644 --- a/yudao-admin-ui/src/api/menu.js +++ b/yudao-admin-ui/src/api/menu.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 获取路由 export const getRouters = () => { return request({ - url: '/list-menus', + url: '/system/list-menus', method: 'get' }) } diff --git a/yudao-admin-ui/src/store/modules/dict.js b/yudao-admin-ui/src/store/modules/dict.js index 64c05a19..6d3984d6 100644 --- a/yudao-admin-ui/src/store/modules/dict.js +++ b/yudao-admin-ui/src/store/modules/dict.js @@ -18,6 +18,10 @@ const mutations = { const actions = { loadDictDatas({ commit }) { listSimpleDictDatas().then(response => { + // 如果未加载到数据,则直接返回 + if (!response.data) { + return; + } // 设置数据 const dictDataMap = {} response.data.forEach(dictData => { diff --git a/yudao-admin-ui/src/utils/request.js b/yudao-admin-ui/src/utils/request.js index 7b8c2901..ee2fee18 100644 --- a/yudao-admin-ui/src/utils/request.js +++ b/yudao-admin-ui/src/utils/request.js @@ -9,7 +9,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' // 创建axios实例 const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 - baseURL: process.env.VUE_APP_BASE_API + '/api/', // 此处的 /api/ 地址,原因是后端的基础路径为 /api/ + baseURL: process.env.VUE_APP_BASE_API + '/admin-api/', // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/ // 超时 timeout: 10000 }) diff --git a/更新日志.md b/更新日志.md index cf158851..1810a2bd 100644 --- a/更新日志.md +++ b/更新日志.md @@ -22,12 +22,12 @@ *【重构】大模块按照多 Maven Module 的方式拆分,提升可维护性,为后续重构 onemall 提供基础 *【重构】Spring Security 支持读取多种用户类型,从不同的数据库表,从而实现单项目提供管理后台、用户 APP 的不同 RESTful API 接口 - ### 🐞 Bug Fixes *【修复】用户无权限访问 指定 API 时,未返回 FORBIDDEN 结果码 *【修复】定时任务刷新本地缓存时,无租户上线文,导致查询报错 *【修复】配置中心只加载了删除的配置 +*【修复】管理后台 UI 超时登录后,返回登陆界面时,由于未登陆加载不到字典数据,导致报错的问题 ### 🔨 Dependency Upgrades