diff --git a/admin-web/config/proxy/index.js b/admin-web/config/proxy/index.js index 5ed684340..0d137ae3a 100644 --- a/admin-web/config/proxy/index.js +++ b/admin-web/config/proxy/index.js @@ -19,7 +19,7 @@ function basePathBuilder(proxys, basePath) { } export default function(NODE_ENV, basePath) { - NODE_ENV = 'prod'; + // NODE_ENV = 'prod'; let proxys = NODE_ENV === 'development' || NODE_ENV === 'undefined' ? proxyDev : proxyProd; if (basePath) { proxys = basePathBuilder(proxys, basePath); diff --git a/admin-web/config/proxy/proxy.dev.js b/admin-web/config/proxy/proxy.dev.js index e98ea1cc8..55c26f8db 100644 --- a/admin-web/config/proxy/proxy.dev.js +++ b/admin-web/config/proxy/proxy.dev.js @@ -1,7 +1,7 @@ // 开发环境,的代理配置 module.exports = { - '/admin-api/': { + '/system-api/': { target: 'http://127.0.0.1:18083/', // target: 'http://180.167.213.26:18083/', changeOrigin: true, diff --git a/admin-web/config/proxy/proxy.prod.js b/admin-web/config/proxy/proxy.prod.js index a9f626091..f75994c77 100644 --- a/admin-web/config/proxy/proxy.prod.js +++ b/admin-web/config/proxy/proxy.prod.js @@ -1,7 +1,7 @@ // production 配置文件 module.exports = { - '/admin-api/': { + '/system-api/': { target: 'http://api.shop.iocoder.cn', changeOrigin: true, pathRewrite: {}, diff --git a/admin-web/src/models/login.js b/admin-web/src/models/login.js index 24507fa9a..d7803b28d 100644 --- a/admin-web/src/models/login.js +++ b/admin-web/src/models/login.js @@ -1,6 +1,7 @@ import { routerRedux } from 'dva/router'; import { stringify } from 'qs'; -import { fakeAccountLogin, getFakeCaptcha } from '@/services/api'; +import { getFakeCaptcha } from '@/services/api'; +import { usernameAuthenticate } from '@/services/system'; import { setAuthority } from '@/utils/authority'; import { getPageQuery } from '@/utils/utils'; import { reloadAuthorized } from '@/utils/Authorized'; @@ -15,7 +16,7 @@ export default { effects: { *login({ payload }, { call, put }) { - const response = yield call(fakeAccountLogin, payload); + const response = yield call(usernameAuthenticate, payload); yield put({ type: 'changeLoginStatus', payload: response, @@ -23,6 +24,8 @@ export default { yield put(routerRedux.replace('/')); + debugger; + // Login successfully if (response.code === 0) { diff --git a/admin-web/src/services/system.js b/admin-web/src/services/system.js new file mode 100644 index 000000000..bfc4b016f --- /dev/null +++ b/admin-web/src/services/system.js @@ -0,0 +1,10 @@ +import { stringify } from '@/utils/request.qs'; +import request from '@/utils/request'; + + +export async function usernameAuthenticate(params) { + return request(`/system-api/admins/oauth2/username-authenticate?${stringify(params)}`, { + method: 'POST', + body: {}, + }); +} diff --git a/admin-web/src/utils/request.js b/admin-web/src/utils/request.js index 21352fbf1..f950a3de5 100644 --- a/admin-web/src/utils/request.js +++ b/admin-web/src/utils/request.js @@ -138,7 +138,7 @@ export default function request(url, option) { // 将登陆的 accessToken 放到 header const loginToken = getLoginToken(); if (loginToken && loginToken.accessToken - && url.indexOf('/passport/login') === -1) { // TODO 芋艿,临时这么加,可能不是很优雅 + && url.indexOf('/system-api/admins/oauth2/username-authenticate') === -1) { // TODO 芋艿,临时这么加,可能不是很优雅 const headers = { ...newOptions.headers, Authorization: `Bearer ${loginToken.accessToken}`, diff --git a/system/pom.xml b/system/pom.xml index 35db93bc9..2052279e4 100644 --- a/system/pom.xml +++ b/system/pom.xml @@ -16,8 +16,8 @@ system-application - - + system-service-api + system-service-impl system-rpc-api system-rpc system-rest diff --git a/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/dataobject/authorization/RoleDO.java b/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/dataobject/authorization/RoleDO.java index 573d7bf03..ec97a9f23 100644 --- a/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/dataobject/authorization/RoleDO.java +++ b/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/dataobject/authorization/RoleDO.java @@ -27,5 +27,11 @@ public class RoleDO extends DeletableDO { * 角色编码 */ private String code; + /** + * 角色类型 + * + * TODO 需要补充 + */ + private Integer type; } diff --git a/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsFileController.java b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsFileController.java index e9f1ec955..80d9bd653 100644 --- a/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsFileController.java +++ b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsFileController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; //@RestController @RequestMapping("admins/file") @Api(tags = "文件模块") +// TODO FROM 芋艿 to 小范:挪下 public class AdminsFileController { private Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsOAdminController.java b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsOAdminController.java new file mode 100644 index 000000000..a824af4e4 --- /dev/null +++ b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsOAdminController.java @@ -0,0 +1,15 @@ +package cn.iocoder.mall.system.rest.controller.admin; + +import cn.iocoder.common.framework.constant.MallConstants; +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(MallConstants.ROOT_PATH_ADMIN + "/admin") +@Api(tags = "管理员 - 管理员 API") +public class AdminsOAdminController { + + + +} diff --git a/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsSignController.java b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsSignController.java index 1359d88ee..86d4db7ec 100644 --- a/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsSignController.java +++ b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsSignController.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("admins/sms/sign") @Api("短信服务(签名)") +// TODO FROM 芋艿 to 小范:挪下 public class AdminsSmsSignController { @Autowired diff --git a/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsTemplateController.java b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsTemplateController.java index 853d1b5be..0857dbb9e 100644 --- a/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsTemplateController.java +++ b/system/system-rest/src/main/java/cn/iocoder/mall/system/rest/controller/admin/AdminsSmsTemplateController.java @@ -3,7 +3,6 @@ package cn.iocoder.mall.system.rest.controller.admin; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.common.framework.vo.PageResult; import cn.iocoder.mall.system.biz.bo.smsTemplate.ListSmsTemplateBO; -import cn.iocoder.mall.system.biz.dto.smsTemplate.ListSmsTemplateDTO; import cn.iocoder.mall.system.biz.service.sms.SmsService; import cn.iocoder.mall.system.rest.convert.sms.AdminsSmsConvert; import cn.iocoder.mall.system.rest.request.smsTemplate.AddSmsTemplateRequest; @@ -23,6 +22,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("admins/sms/template") @Api("短信服务(短信模板)") +// TODO FROM 芋艿 to 小范:挪下 public class AdminsSmsTemplateController { @Autowired