Commit 2b630ef3f2e3e0c2e42ced07847e070f32b24d12
1 parent
bdcf00d8
多模块重构 9:调整的请求 URL
Showing
5 changed files
with
15 additions
and
11 deletions
yudao-admin-ui/src/api/login.js
| ... | ... | @@ -9,7 +9,7 @@ export function login(username, password, code, uuid) { |
| 9 | 9 | uuid |
| 10 | 10 | } |
| 11 | 11 | return request({ |
| 12 | - url: '/login', | |
| 12 | + url: '/system/login', | |
| 13 | 13 | method: 'post', |
| 14 | 14 | data: data |
| 15 | 15 | }) |
| ... | ... | @@ -18,7 +18,7 @@ export function login(username, password, code, uuid) { |
| 18 | 18 | // 获取用户详细信息 |
| 19 | 19 | export function getInfo() { |
| 20 | 20 | return request({ |
| 21 | - url: '/get-permission-info', | |
| 21 | + url: '/system/get-permission-info', | |
| 22 | 22 | method: 'get' |
| 23 | 23 | }) |
| 24 | 24 | } |
| ... | ... | @@ -26,7 +26,7 @@ export function getInfo() { |
| 26 | 26 | // 退出方法 |
| 27 | 27 | export function logout() { |
| 28 | 28 | return request({ |
| 29 | - url: '/logout', | |
| 29 | + url: '/system/logout', | |
| 30 | 30 | method: 'post' |
| 31 | 31 | }) |
| 32 | 32 | } |
| ... | ... | @@ -42,7 +42,7 @@ export function getCodeImg() { |
| 42 | 42 | // 社交授权的跳转 |
| 43 | 43 | export function socialAuthRedirect(type, redirectUri) { |
| 44 | 44 | return request({ |
| 45 | - url: '/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri, | |
| 45 | + url: '/system/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri, | |
| 46 | 46 | method: 'get' |
| 47 | 47 | }) |
| 48 | 48 | } |
| ... | ... | @@ -50,7 +50,7 @@ export function socialAuthRedirect(type, redirectUri) { |
| 50 | 50 | // 社交登录,使用 code 授权码 |
| 51 | 51 | export function socialLogin(type, code, state) { |
| 52 | 52 | return request({ |
| 53 | - url: '/social-login', | |
| 53 | + url: '/system/social-login', | |
| 54 | 54 | method: 'post', |
| 55 | 55 | data: { |
| 56 | 56 | type, |
| ... | ... | @@ -63,7 +63,7 @@ export function socialLogin(type, code, state) { |
| 63 | 63 | // 社交登录,使用 code 授权码 + + 账号密码 |
| 64 | 64 | export function socialLogin2(type, code, state, username, password) { |
| 65 | 65 | return request({ |
| 66 | - url: '/social-login2', | |
| 66 | + url: '/system/social-login2', | |
| 67 | 67 | method: 'post', |
| 68 | 68 | data: { |
| 69 | 69 | type, |
| ... | ... | @@ -78,7 +78,7 @@ export function socialLogin2(type, code, state, username, password) { |
| 78 | 78 | // 社交绑定,使用 code 授权码 |
| 79 | 79 | export function socialBind(type, code, state) { |
| 80 | 80 | return request({ |
| 81 | - url: '/social-bind', | |
| 81 | + url: '/system/social-bind', | |
| 82 | 82 | method: 'post', |
| 83 | 83 | data: { |
| 84 | 84 | type, |
| ... | ... | @@ -91,7 +91,7 @@ export function socialBind(type, code, state) { |
| 91 | 91 | // 取消社交绑定 |
| 92 | 92 | export function socialUnbind(type, unionId) { |
| 93 | 93 | return request({ |
| 94 | - url: '/social-unbind', | |
| 94 | + url: '/system/social-unbind', | |
| 95 | 95 | method: 'delete', |
| 96 | 96 | data: { |
| 97 | 97 | type, | ... | ... |
yudao-admin-ui/src/api/menu.js
yudao-admin-ui/src/store/modules/dict.js
| ... | ... | @@ -18,6 +18,10 @@ const mutations = { |
| 18 | 18 | const actions = { |
| 19 | 19 | loadDictDatas({ commit }) { |
| 20 | 20 | listSimpleDictDatas().then(response => { |
| 21 | + // 如果未加载到数据,则直接返回 | |
| 22 | + if (!response.data) { | |
| 23 | + return; | |
| 24 | + } | |
| 21 | 25 | // 设置数据 |
| 22 | 26 | const dictDataMap = {} |
| 23 | 27 | response.data.forEach(dictData => { | ... | ... |
yudao-admin-ui/src/utils/request.js
| ... | ... | @@ -9,7 +9,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' |
| 9 | 9 | // 创建axios实例 |
| 10 | 10 | const service = axios.create({ |
| 11 | 11 | // axios中请求配置有baseURL选项,表示请求URL公共部分 |
| 12 | - baseURL: process.env.VUE_APP_BASE_API + '/api/', // 此处的 /api/ 地址,原因是后端的基础路径为 /api/ | |
| 12 | + baseURL: process.env.VUE_APP_BASE_API + '/admin-api/', // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/ | |
| 13 | 13 | // 超时 |
| 14 | 14 | timeout: 10000 |
| 15 | 15 | }) | ... | ... |
更新日志.md
| ... | ... | @@ -22,12 +22,12 @@ |
| 22 | 22 | *【重构】大模块按照多 Maven Module 的方式拆分,提升可维护性,为后续重构 onemall 提供基础 |
| 23 | 23 | *【重构】Spring Security 支持读取多种用户类型,从不同的数据库表,从而实现单项目提供管理后台、用户 APP 的不同 RESTful API 接口 |
| 24 | 24 | |
| 25 | - | |
| 26 | 25 | ### 🐞 Bug Fixes |
| 27 | 26 | |
| 28 | 27 | *【修复】用户无权限访问 指定 API 时,未返回 FORBIDDEN 结果码 |
| 29 | 28 | *【修复】定时任务刷新本地缓存时,无租户上线文,导致查询报错 |
| 30 | 29 | *【修复】配置中心只加载了删除的配置 |
| 30 | +*【修复】管理后台 UI 超时登录后,返回登陆界面时,由于未登陆加载不到字典数据,导致报错的问题 | |
| 31 | 31 | |
| 32 | 32 | ### 🔨 Dependency Upgrades |
| 33 | 33 | ... | ... |