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