From 2803ce03beb75688dc1993dc97e860611da9c0d4 Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 4 Jul 2022 22:43:47 +0800 Subject: [PATCH 01/12] =?UTF-8?q?feat=20=E6=89=8B=E6=9C=BA/=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E7=BB=91=E5=AE=9A,=20=E6=97=A0=E6=B3=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=88=B0=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=80=80=E5=87=BA=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95?= =?UTF-8?q?,=20=E5=91=BD=E5=90=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/client.js | 84 ++++----- .../system/{application.js => loginType.js} | 84 +++++---- src/api/system/{social.js => third.js} | 8 +- src/api/system/user.js | 34 +++- src/api/system/userAssist.js | 4 +- src/components/tools/UserMenu.vue | 6 + src/views/account/bind/Binding.vue | 32 ++-- src/views/account/security/EmailBind.vue | 164 +++++++++++++++++ src/views/account/security/EmailEdit.vue | 4 - src/views/account/security/PhoneBind.vue | 168 ++++++++++++++++++ src/views/account/security/PhoneEdit.vue | 2 - src/views/account/security/Security.vue | 18 +- src/views/login/Index.vue | 1 - src/views/login/UserLogin.vue | 2 +- .../modules/system/client/ClientEdit.vue | 90 +++++----- .../modules/system/client/ClientList.vue | 120 +++++-------- ...{ApplicationEdit.vue => LoginTypeEdit.vue} | 94 +++++----- ...{ApplicationList.vue => LoginTypeList.vue} | 124 +++++++------ src/views/modules/system/menu/MenuList.vue | 2 +- .../modules/system/role/RoleMenuModal.vue | 2 +- .../modules/system/social/SocialList.vue | 122 ------------- src/views/modules/system/user/UserAdd.vue | 2 +- src/views/modules/system/user/UserEdit.vue | 2 +- src/views/modules/system/user/UserShow.vue | 2 +- 24 files changed, 704 insertions(+), 467 deletions(-) rename src/api/system/{application.js => loginType.js} (57%) rename src/api/system/{social.js => third.js} (62%) create mode 100644 src/views/account/security/EmailBind.vue create mode 100644 src/views/account/security/PhoneBind.vue rename src/views/modules/system/client/{ApplicationEdit.vue => LoginTypeEdit.vue} (68%) rename src/views/modules/system/client/{ApplicationList.vue => LoginTypeList.vue} (50%) delete mode 100644 src/views/modules/system/social/SocialList.vue diff --git a/src/api/system/client.js b/src/api/system/client.js index 78c36a2..351fc79 100644 --- a/src/api/system/client.js +++ b/src/api/system/client.js @@ -1,48 +1,57 @@ import { axios } from '@/utils/request' +/** + * 分页 + */ export function page (params) { return axios({ - url: '/client/page', + url: '/application/page', method: 'GET', params: params }) } /** - * 超级分页 + * 获取单条 */ -export function superPage (params, queryParams) { +export function get (id) { return axios({ - url: '/client/superPage', - method: 'POST', - params: params, - data: queryParams + url: '/application/findById', + method: 'GET', + params: { id } }) } -export function get (id) { +/** + * 添加 + */ +export function add (obj) { return axios({ - url: '/client/findById', - method: 'GET', - params: { id } + url: '/application/add', + method: 'POST', + data: obj }) } /** - * 终端编码是否存在 + * 更新 */ -export function existsByCode (code) { +export function update (obj) { return axios({ - url: '/client/existsByCode', - method: 'GET', - params: { code } + url: '/application/update', + method: 'POST', + data: obj }) } -export function existsByCodeNotId (code, id) { + +/** + * 删除 + */ +export function del (id) { return axios({ - url: '/client/existsByCodeNotId', - method: 'GET', - params: { code, id } + url: '/application/delete', + params: { id }, + method: 'DELETE' }) } @@ -51,42 +60,25 @@ export function existsByCodeNotId (code, id) { */ export function findAll () { return axios({ - url: '/client/findAll', + url: '/application/findAll', method: 'GET' }) } /** - * 根据code获取终端信息 + * 编码是否被使用 */ -export function findByCode (code) { +export function existsByCode (code) { return axios({ - url: '/client/findByCode', + url: '/application/existsByCode', method: 'GET', params: { code } }) } - -export function add (obj) { - return axios({ - url: '/client/add', - method: 'POST', - data: obj - }) -} - -export function update (obj) { - return axios({ - url: '/client/update', - method: 'POST', - data: obj - }) -} - -export function del (id) { +export function existsByCodeNotId (code, id) { return axios({ - url: '/client/delete', - params: { id }, - method: 'DELETE' + url: '/application/existsByCodeNotId', + method: 'GET', + params: { code, id } }) -} +} \ No newline at end of file diff --git a/src/api/system/application.js b/src/api/system/loginType.js similarity index 57% rename from src/api/system/application.js rename to src/api/system/loginType.js index 351fc79..78c36a2 100644 --- a/src/api/system/application.js +++ b/src/api/system/loginType.js @@ -1,57 +1,48 @@ import { axios } from '@/utils/request' -/** - * 分页 - */ export function page (params) { return axios({ - url: '/application/page', + url: '/client/page', method: 'GET', params: params }) } /** - * 获取单条 + * 超级分页 */ -export function get (id) { +export function superPage (params, queryParams) { return axios({ - url: '/application/findById', - method: 'GET', - params: { id } + url: '/client/superPage', + method: 'POST', + params: params, + data: queryParams }) } -/** - * 添加 - */ -export function add (obj) { +export function get (id) { return axios({ - url: '/application/add', - method: 'POST', - data: obj + url: '/client/findById', + method: 'GET', + params: { id } }) } /** - * 更新 + * 终端编码是否存在 */ -export function update (obj) { +export function existsByCode (code) { return axios({ - url: '/application/update', - method: 'POST', - data: obj + url: '/client/existsByCode', + method: 'GET', + params: { code } }) } - -/** - * 删除 - */ -export function del (id) { +export function existsByCodeNotId (code, id) { return axios({ - url: '/application/delete', - params: { id }, - method: 'DELETE' + url: '/client/existsByCodeNotId', + method: 'GET', + params: { code, id } }) } @@ -60,25 +51,42 @@ export function del (id) { */ export function findAll () { return axios({ - url: '/application/findAll', + url: '/client/findAll', method: 'GET' }) } /** - * 编码是否被使用 + * 根据code获取终端信息 */ -export function existsByCode (code) { +export function findByCode (code) { return axios({ - url: '/application/existsByCode', + url: '/client/findByCode', method: 'GET', params: { code } }) } -export function existsByCodeNotId (code, id) { + +export function add (obj) { return axios({ - url: '/application/existsByCodeNotId', - method: 'GET', - params: { code, id } + url: '/client/add', + method: 'POST', + data: obj + }) +} + +export function update (obj) { + return axios({ + url: '/client/update', + method: 'POST', + data: obj }) -} \ No newline at end of file +} + +export function del (id) { + return axios({ + url: '/client/delete', + params: { id }, + method: 'DELETE' + }) +} diff --git a/src/api/system/social.js b/src/api/system/third.js similarity index 62% rename from src/api/system/social.js rename to src/api/system/third.js index 4b8e0f1..e30ef40 100644 --- a/src/api/system/social.js +++ b/src/api/system/third.js @@ -3,9 +3,9 @@ import { axios } from '@/utils/request' /** * 分页 */ -export function page (params) { +export function page(params) { return axios({ - url: '/user/social/page', + url: '/user/third/page', method: 'GET', params: params }) @@ -14,9 +14,9 @@ export function page (params) { /** * 获取单条 */ -export function get (id) { +export function get(id) { return axios({ - url: `/user/social/findById`, + url: `/user/third/findById`, method: 'GET', params: { id } }) diff --git a/src/api/system/user.js b/src/api/system/user.js index 6cbe66d..9518c41 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -122,9 +122,9 @@ export function getUserSecurityInfo () { /** * 获取用户三方绑定信息 */ -export function getSocialBindInfo () { +export function getThirdBindInfo () { return axios({ - url: `/user/social/getSocialBindInfo`, + url: `/user/third/getThirdBindInfo`, method: 'get' }) } @@ -132,9 +132,9 @@ export function getSocialBindInfo () { /** * 用户绑定三方开放平台 */ -export function bindSocial (obj) { +export function bindThird (obj) { return axios({ - url: `/user/social/bind`, + url: `/user/third/bind`, method: 'post', data: obj }) @@ -142,9 +142,9 @@ export function bindSocial (obj) { /** * 解除用户绑定三方开放平台 */ -export function unbindSocial (clientCode) { +export function unbindThird (clientCode) { return axios({ - url: `/user/social/unbind`, + url: `/user/third/unbind`, method: 'post', params: { clientCode } }) @@ -182,6 +182,17 @@ export function updatePassword (password, newPassword) { }) } +/** + * 绑定手机 + */ +export function bindPhone (phone, captcha) { + return axios({ + url: '/user/bindPhone', + method: 'POST', + params: { phone, captcha } + }) +} + /** * 更新手机号 */ @@ -193,6 +204,17 @@ export function updatePhone (obj) { }) } +/** + * 绑定邮箱 + */ +export function bindEmail (email, captcha) { + return axios({ + url: '/user/bindEmail', + method: 'POST', + params: { email, captcha } + }) +} + /** * 更新邮箱 */ diff --git a/src/api/system/userAssist.js b/src/api/system/userAssist.js index 7eef7ae..264f954 100644 --- a/src/api/system/userAssist.js +++ b/src/api/system/userAssist.js @@ -119,7 +119,7 @@ export function validateCurrentEmailChangeCaptcha (captcha) { } /** - * 发送更改邮箱验证码 + * 发送更改/绑定邮箱验证码 */ export function sendEmailChangeCaptcha (email) { return axios({ @@ -130,7 +130,7 @@ export function sendEmailChangeCaptcha (email) { } /** - * 验证更改邮箱验证码 + * 验证更改/绑定邮箱验证码 */ export function validateEmailChangeCaptcha (email, captcha) { return axios({ diff --git a/src/components/tools/UserMenu.vue b/src/components/tools/UserMenu.vue index 2bbc0e4..7a12743 100644 --- a/src/components/tools/UserMenu.vue +++ b/src/components/tools/UserMenu.vue @@ -27,6 +27,7 @@ import { message } from 'ant-design-vue/es' import AvatarDropdown from './AvatarDropdown' import MenuSearch from './MenuSearch' import { mapActions } from 'vuex' +import store from '@/store' export default { name: 'UserMenu', @@ -59,6 +60,11 @@ export default { GetUserAvatarUrl(this.currentUser.avatar).then(res => { this.avatarUrl = res.data }) + }).catch(() => { + // 获取用户信息失败时,调用登出 + store.dispatch('Logout').then(() => { + this.$router.push({ name: 'login' }) + }) }) }, /** diff --git a/src/views/account/bind/Binding.vue b/src/views/account/bind/Binding.vue index 83eec1b..ebe123f 100644 --- a/src/views/account/bind/Binding.vue +++ b/src/views/account/bind/Binding.vue @@ -16,8 +16,8 @@ @@ -28,8 +28,8 @@ @@ -40,8 +40,8 @@ @@ -52,7 +52,7 @@ + + diff --git a/src/views/account/security/EmailEdit.vue b/src/views/account/security/EmailEdit.vue index 2a9cf8f..389d730 100644 --- a/src/views/account/security/EmailEdit.vue +++ b/src/views/account/security/EmailEdit.vue @@ -99,7 +99,6 @@ export default { }, data () { return { - confirmDirty: false, // 当前进度 currentTab: 0, state: { @@ -119,7 +118,6 @@ export default { edit () { this.visible = true this.currentTab = 0 - this.confirmDirty = false this.confirmLoading = false this.resetForm() }, @@ -151,7 +149,6 @@ export default { return } const { msg, result } = validateEmail(value) - console.log(msg, result) result ? callback() : callback(msg) }, /** @@ -162,7 +159,6 @@ export default { callback() return } - console.log(111) const { msg, result } = validateEmail(value) result ? callback() : callback(msg) const { data } = existsEmail(value) diff --git a/src/views/account/security/PhoneBind.vue b/src/views/account/security/PhoneBind.vue new file mode 100644 index 0000000..27b598a --- /dev/null +++ b/src/views/account/security/PhoneBind.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/src/views/account/security/PhoneEdit.vue b/src/views/account/security/PhoneEdit.vue index 34ed2ac..41a8eb8 100644 --- a/src/views/account/security/PhoneEdit.vue +++ b/src/views/account/security/PhoneEdit.vue @@ -104,7 +104,6 @@ export default { }, data () { return { - confirmDirty: false, // 当前进度 currentTab: 0, state: { @@ -124,7 +123,6 @@ export default { edit () { this.visible = true this.currentTab = 0 - this.confirmDirty = false this.confirmLoading = false this.resetForm() }, diff --git a/src/views/account/security/Security.vue b/src/views/account/security/Security.vue index 40f1472..ed61c36 100644 --- a/src/views/account/security/Security.vue +++ b/src/views/account/security/Security.vue @@ -68,7 +68,9 @@ + + @@ -77,13 +79,17 @@ import { getUserSecurityInfo } from '@/api/system/user' import PasswordEdit from './PasswordEdit' import PhoneEdit from './PhoneEdit' import EmailEdit from './EmailEdit' +import PhoneBind from './PhoneBind' +import EmailBind from './EmailBind' export default { name: 'Security', components: { PasswordEdit, PhoneEdit, - EmailEdit + EmailEdit, + PhoneBind, + EmailBind }, data () { return { @@ -104,23 +110,23 @@ export default { }, // 显示密码修改 passwordEdit () { - this.$refs.passwordEdit.init('', 'edit') + this.$refs.passwordEdit.init() }, // 修改绑定邮箱 emailEdit () { - this.$refs.emailEdit.init('', 'edit') + this.$refs.emailEdit.init() }, // 修改绑定手机号 phoneEdit () { - this.$refs.phoneEdit.init('', 'edit') + this.$refs.phoneEdit.init() }, // 绑定手机号 phoneBind () { - this.$message.info('稍等, 下个版本实装') + this.$refs.phoneBind.init() }, // 绑定邮箱 bindEmail () { - this.$message.info('稍等, 下个版本实装') + this.$refs.emailBind.init() } }, mounted () { diff --git a/src/views/login/Index.vue b/src/views/login/Index.vue index b2d2411..b8b687e 100644 --- a/src/views/login/Index.vue +++ b/src/views/login/Index.vue @@ -59,7 +59,6 @@ export default { return { loading: false, loadingTip: '登录中...', - socialForm: {}, activeName: 'user' } }, diff --git a/src/views/login/UserLogin.vue b/src/views/login/UserLogin.vue index 8151407..811de26 100644 --- a/src/views/login/UserLogin.vue +++ b/src/views/login/UserLogin.vue @@ -71,7 +71,7 @@ diff --git a/src/views/modules/system/user/UserAdd.vue b/src/views/modules/system/user/UserAdd.vue index eaa6b53..c4ac7e2 100644 --- a/src/views/modules/system/user/UserAdd.vue +++ b/src/views/modules/system/user/UserAdd.vue @@ -71,7 +71,7 @@ import PasswordLevel from '@/components/PasswordLevel' import { add } from '@/api/system/user' import { existsUsername, existsPhone, existsEmail } from '@/api/system/userAssist' import { validateEmail, validateMobile } from '@/utils/validate' -import { findAll } from '@/api/system/application' +import { findAll } from '@/api/system/client' export default { name: 'UserAdd', diff --git a/src/views/modules/system/user/UserEdit.vue b/src/views/modules/system/user/UserEdit.vue index 5e01545..4756b7a 100644 --- a/src/views/modules/system/user/UserEdit.vue +++ b/src/views/modules/system/user/UserEdit.vue @@ -54,7 +54,7 @@ import { FormMixin } from '@/mixins/FormMixin' import { get, update } from '@/api/system/user' import { existsUsernameNotId, existsPhoneNotId, existsEmailNotId } from '@/api/system/userAssist' import { validateMobile, validateEmail } from '@/utils/validate' -import { findAll } from '@/api/system/application' +import { findAll } from '@/api/system/client' export default { name: 'UserEdit', diff --git a/src/views/modules/system/user/UserShow.vue b/src/views/modules/system/user/UserShow.vue index 4a1e7ff..6105692 100644 --- a/src/views/modules/system/user/UserShow.vue +++ b/src/views/modules/system/user/UserShow.vue @@ -51,7 +51,7 @@ import { FormMixin } from '@/mixins/FormMixin' import { get } from '@/api/system/user' import { getRoles, getDataScopes, getDeptList } from '@/api/system/userAssign' -import { findAll } from '@/api/system/application' +import { findAll } from '@/api/system/client' export default { name: 'UserShow', -- Gitee From ac5fedb116f2b5a644c97334d09e59659474b975 Mon Sep 17 00:00:00 2001 From: xxm Date: Wed, 6 Jul 2022 21:29:25 +0800 Subject: [PATCH 02/12] =?UTF-8?q?feat=20=E8=AE=A4=E8=AF=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86(=E7=BB=88=E7=AB=AF/=E7=99=BB=E5=BD=95=E6=96=B9?= =?UTF-8?q?=E5=BC=8F)=E9=80=BB=E8=BE=91=E9=87=8D=E6=9E=84,=20yarn.lock=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E9=94=81=E5=AE=9A=E6=96=87=E4=BB=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=BB=9F=E4=B8=80=E4=B8=BA=20npmmirror=20=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- src/api/login/login.js | 4 +- src/api/system/client.js | 16 +- src/api/system/loginType.js | 22 +- src/api/system/permMenu.js | 10 +- src/api/system/roleMenu.js | 8 +- src/store/modules/user.js | 2 +- src/utils/entityUtil.js | 13 + src/views/login/PhoneLogin.vue | 39 +- src/views/login/UserLogin.vue | 8 +- src/views/login/third/ThirdLogin.vue | 18 +- .../dingTalk/robot/DingRobotConfigList.vue | 5 +- .../modules/notice/mail/MailConfigList.vue | 5 +- .../modules/notice/template/TemplateList.vue | 5 +- .../channel/wechat/WeChatConfigList.vue | 5 +- .../payment/wallet/list/UserSelectModal.vue | 5 +- .../modules/starter/file/FileUploadList.vue | 5 +- .../starter/log/DataVersionLogList.vue | 5 +- .../modules/starter/log/LoginLogInfo.vue | 23 +- .../modules/starter/log/LoginLogList.vue | 73 +- .../modules/starter/log/OperateLogList.vue | 5 +- .../modules/starter/quartz/QuartzJobEdit.vue | 6 +- .../modules/starter/quartz/QuartzJobList.vue | 5 +- .../starter/quartz/QuartzJobLogList.vue | 3 - .../modules/system/client/ClientEdit.vue | 22 +- .../modules/system/client/ClientList.vue | 92 +- .../modules/system/client/LoginTypeEdit.vue | 54 +- .../modules/system/client/LoginTypeList.vue | 6 +- src/views/modules/system/menu/MenuEdit.vue | 18 +- src/views/modules/system/menu/MenuList.vue | 27 +- .../modules/system/menu/ResourcePermEdit.vue | 4 +- .../modules/system/online/OnlineUserList.vue | 5 +- src/views/modules/system/path/PathList.vue | 5 +- src/views/modules/system/role/RoleList.vue | 5 +- .../modules/system/role/RoleMenuModal.vue | 25 +- .../modules/system/scope/DataScopeList.vue | 5 +- .../modules/system/scope/UserSelectModal.vue | 5 +- src/views/modules/system/user/UserAdd.vue | 10 +- src/views/modules/system/user/UserEdit.vue | 16 +- src/views/modules/system/user/UserList.vue | 2 +- src/views/modules/system/user/UserShow.vue | 28 +- src/views/user/ForgetPassword.vue | 34 +- yarn.lock | 3124 ++++++++--------- 43 files changed, 1928 insertions(+), 1851 deletions(-) create mode 100644 src/utils/entityUtil.js diff --git a/.env b/.env index 0e7cfc0..f3cc177 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ NODE_ENV=development VUE_APP_PREVIEW=false VUE_APP_USER_ACCOUNT=xxm1995 -VUE_APP_APPLICATION=admin +VUE_APP_CLIENT=admin VUE_APP_TIMEOUT=15000 # 打包请求的地址 diff --git a/src/api/login/login.js b/src/api/login/login.js index bde4d51..73ca88d 100644 --- a/src/api/login/login.js +++ b/src/api/login/login.js @@ -25,11 +25,11 @@ export function loginOpenId (parameter) { /** * 获取用户菜单和资源权限 */ -export function getPermissions (appCode) { +export function getPermissions (clientCode) { return request({ url: `/role/menu/getPermissions`, method: 'GET', - params: { appCode } + params: { clientCode } }) } diff --git a/src/api/system/client.js b/src/api/system/client.js index 351fc79..06df75b 100644 --- a/src/api/system/client.js +++ b/src/api/system/client.js @@ -5,7 +5,7 @@ import { axios } from '@/utils/request' */ export function page (params) { return axios({ - url: '/application/page', + url: '/client/page', method: 'GET', params: params }) @@ -16,7 +16,7 @@ export function page (params) { */ export function get (id) { return axios({ - url: '/application/findById', + url: '/client/findById', method: 'GET', params: { id } }) @@ -27,7 +27,7 @@ export function get (id) { */ export function add (obj) { return axios({ - url: '/application/add', + url: '/client/add', method: 'POST', data: obj }) @@ -38,7 +38,7 @@ export function add (obj) { */ export function update (obj) { return axios({ - url: '/application/update', + url: '/client/update', method: 'POST', data: obj }) @@ -49,7 +49,7 @@ export function update (obj) { */ export function del (id) { return axios({ - url: '/application/delete', + url: '/client/delete', params: { id }, method: 'DELETE' }) @@ -60,7 +60,7 @@ export function del (id) { */ export function findAll () { return axios({ - url: '/application/findAll', + url: '/client/findAll', method: 'GET' }) } @@ -70,14 +70,14 @@ export function findAll () { */ export function existsByCode (code) { return axios({ - url: '/application/existsByCode', + url: '/client/existsByCode', method: 'GET', params: { code } }) } export function existsByCodeNotId (code, id) { return axios({ - url: '/application/existsByCodeNotId', + url: '/client/existsByCodeNotId', method: 'GET', params: { code, id } }) diff --git a/src/api/system/loginType.js b/src/api/system/loginType.js index 78c36a2..9bfefa0 100644 --- a/src/api/system/loginType.js +++ b/src/api/system/loginType.js @@ -2,7 +2,7 @@ import { axios } from '@/utils/request' export function page (params) { return axios({ - url: '/client/page', + url: '/loginType/page', method: 'GET', params: params }) @@ -13,16 +13,16 @@ export function page (params) { */ export function superPage (params, queryParams) { return axios({ - url: '/client/superPage', + url: '/loginType/superPage', method: 'POST', params: params, data: queryParams }) } -export function get (id) { +export function findById (id) { return axios({ - url: '/client/findById', + url: '/loginType/findById', method: 'GET', params: { id } }) @@ -33,14 +33,14 @@ export function get (id) { */ export function existsByCode (code) { return axios({ - url: '/client/existsByCode', + url: '/loginType/existsByCode', method: 'GET', params: { code } }) } export function existsByCodeNotId (code, id) { return axios({ - url: '/client/existsByCodeNotId', + url: '/loginType/existsByCodeNotId', method: 'GET', params: { code, id } }) @@ -51,7 +51,7 @@ export function existsByCodeNotId (code, id) { */ export function findAll () { return axios({ - url: '/client/findAll', + url: '/loginType/findAll', method: 'GET' }) } @@ -61,7 +61,7 @@ export function findAll () { */ export function findByCode (code) { return axios({ - url: '/client/findByCode', + url: '/loginType/findByCode', method: 'GET', params: { code } }) @@ -69,7 +69,7 @@ export function findByCode (code) { export function add (obj) { return axios({ - url: '/client/add', + url: '/loginType/add', method: 'POST', data: obj }) @@ -77,7 +77,7 @@ export function add (obj) { export function update (obj) { return axios({ - url: '/client/update', + url: '/loginType/update', method: 'POST', data: obj }) @@ -85,7 +85,7 @@ export function update (obj) { export function del (id) { return axios({ - url: '/client/delete', + url: '/loginType/delete', params: { id }, method: 'DELETE' }) diff --git a/src/api/system/permMenu.js b/src/api/system/permMenu.js index 8d434d8..c41065e 100644 --- a/src/api/system/permMenu.js +++ b/src/api/system/permMenu.js @@ -1,22 +1,22 @@ import { axios } from '@/utils/request' -export function menuTree (appCode) { +export function menuTree (clientCode) { return axios({ url: '/perm/menu/menuTree', method: 'GET', - params: { appCode } + params: { clientCode } }) } -export function allTree (appCode) { +export function allTree (clientCode) { return axios({ url: '/perm/menu/allTree', method: 'GET', - params: { appCode } + params: { clientCode } }) } -export function get (id) { +export function findById (id) { return axios({ url: '/perm/menu/findById', params: { id }, diff --git a/src/api/system/roleMenu.js b/src/api/system/roleMenu.js index 270141a..a946e8e 100644 --- a/src/api/system/roleMenu.js +++ b/src/api/system/roleMenu.js @@ -3,22 +3,22 @@ import { axios } from '@/utils/request' /** * 根据用户获取拥有的权限 */ -export function findPermissionIdsByRole (roleId, appCode) { +export function findPermissionIdsByRole (roleId, clientCode) { return axios({ url: `/role/menu/findPermissionIdsByRole`, method: 'GET', - params: { roleId, appCode } + params: { roleId, clientCode } }) } /** * 获取菜单权限id集合 */ -export function findMenuIds (appCode) { +export function findMenuIds (clientCode) { return axios({ url: `/role/menu/findMenuIds`, method: 'GET', - params: { appCode } + params: { clientCode } }) } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 63bca8f..c6b982e 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -74,7 +74,7 @@ const user = { // 获取用户菜单和按钮权限 GetUserPermission ({ commit }) { return new Promise((resolve, reject) => { - getPermissions(process.env.VUE_APP_APPLICATION).then(response => { + getPermissions(process.env.VUE_APP_CLIENT).then(response => { const result = response.data const resourcePerms = result.resourcePerms const menus = result.menus diff --git a/src/utils/entityUtil.js b/src/utils/entityUtil.js new file mode 100644 index 0000000..58c1167 --- /dev/null +++ b/src/utils/entityUtil.js @@ -0,0 +1,13 @@ +/** + * 从列表中获取指定的对象 + */ +export function findOneByField (list, fieldValue, fieldName) { + const item = list.filter(o => { + return o[fieldName] === fieldValue + }) + if (item && item.length > 0) { + return item[0] + } else { + return null + } +} diff --git a/src/views/login/PhoneLogin.vue b/src/views/login/PhoneLogin.vue index 3dac922..a45d1dc 100644 --- a/src/views/login/PhoneLogin.vue +++ b/src/views/login/PhoneLogin.vue @@ -16,9 +16,9 @@ - - - + + + - - - - - - + + + + + + this.$emit('loginSuccess')) .finally(() => { @@ -149,7 +148,7 @@ export default { } }, created () { - this.form.application = process.env.VUE_APP_APPLICATION + this.form.client = process.env.VUE_APP_CLIENT } } diff --git a/src/views/login/UserLogin.vue b/src/views/login/UserLogin.vue index 811de26..6f88cf9 100644 --- a/src/views/login/UserLogin.vue +++ b/src/views/login/UserLogin.vue @@ -78,8 +78,8 @@ export default { data () { return { form: { - application: '', client: '', + loginType: '', account: '', password: '123456', captchaKey: '', @@ -108,7 +108,7 @@ export default { methods: { ...mapActions(['Login', 'Logout']), init () { - findByCode(this.form.client).then(res => { + findByCode(this.form.loginType).then(res => { this.client = res.data || {} if (this.client && this.client.captcha && this.client.enable) { this.getCaptcha() @@ -149,8 +149,8 @@ export default { }, created () { this.form.account = process.env.VUE_APP_USER_ACCOUNT - this.form.application = process.env.VUE_APP_APPLICATION - this.form.client = 'password' + this.form.client = process.env.VUE_APP_CLIENT + this.form.loginType = 'password' this.init() } } diff --git a/src/views/login/third/ThirdLogin.vue b/src/views/login/third/ThirdLogin.vue index fa6d82c..5812eff 100644 --- a/src/views/login/third/ThirdLogin.vue +++ b/src/views/login/third/ThirdLogin.vue @@ -27,8 +27,8 @@ export default { DING_TALK, WE_CHAT, WE_COM, - application: '', - currentClientCode: null + client: '', + currentLoginType: null } }, methods: { @@ -36,10 +36,10 @@ export default { /** * 调起登录 */ - onThirdLogin (clientCode) { - this.currentClientCode = clientCode - const url = process.env.VUE_APP_API_BASE_URL + `/auth/third/toLoginUrl/${clientCode}` - window.open(url, `login ${clientCode}`, 'height=600, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') + onThirdLogin (loginTpe) { + this.currentLoginType = loginTpe + const url = process.env.VUE_APP_API_BASE_URL + `/auth/third/toLoginUrl/${loginTpe}` + window.open(url, `login ${loginTpe}`, 'height=600, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') // 监听回调 window.addEventListener('message', this.authCodeCallback, false) }, @@ -56,15 +56,15 @@ export default { } = this this.$emit('loginLoading', true) loginOpenId({ - application: this.application, - client: this.currentClientCode, + client: this.client, + loginType: this.currentLoginType, ...data }).then(() => this.$emit('loginSuccess')) .finally(() => this.$emit('loginLoading', false)) } }, mounted () { - this.application = process.env.VUE_APP_APPLICATION + this.client = process.env.VUE_APP_CLIENT } } diff --git a/src/views/modules/notice/dingTalk/robot/DingRobotConfigList.vue b/src/views/modules/notice/dingTalk/robot/DingRobotConfigList.vue index 00ffbe7..583abbf 100644 --- a/src/views/modules/notice/dingTalk/robot/DingRobotConfigList.vue +++ b/src/views/modules/notice/dingTalk/robot/DingRobotConfigList.vue @@ -106,10 +106,7 @@ export default { ...this.queryParam, ...this.pages }).then(res => { - this.tableData = res.data.records - this.pagination.current = Number(res.data.current) - this.pagination.total = Number(res.data.total) - this.loading = false + this.pageQueryResHandel(res, this) }) }, add () { diff --git a/src/views/modules/notice/mail/MailConfigList.vue b/src/views/modules/notice/mail/MailConfigList.vue index e035251..12f4387 100644 --- a/src/views/modules/notice/mail/MailConfigList.vue +++ b/src/views/modules/notice/mail/MailConfigList.vue @@ -133,10 +133,7 @@ export default { ...this.queryParam, ...this.pages }).then(res => { - this.tableData = res.data.records - this.pagination.current = Number(res.data.current) - this.pagination.total = Number(res.data.total) - this.loading = false + this.pageQueryResHandel(res, this) }) }, // 设置默认配置 diff --git a/src/views/modules/notice/template/TemplateList.vue b/src/views/modules/notice/template/TemplateList.vue index ca4cd5c..d2c0a55 100644 --- a/src/views/modules/notice/template/TemplateList.vue +++ b/src/views/modules/notice/template/TemplateList.vue @@ -127,10 +127,7 @@ export default { ...this.queryParam, ...this.pages }).then(res => { - this.tableData = res.data.records - this.pagination.current = Number(res.data.current) - this.pagination.total = Number(res.data.total) - this.loading = false + this.pageQueryResHandel(res, this) }) }, add () { diff --git a/src/views/modules/payment/channel/wechat/WeChatConfigList.vue b/src/views/modules/payment/channel/wechat/WeChatConfigList.vue index f7294c7..84bb381 100644 --- a/src/views/modules/payment/channel/wechat/WeChatConfigList.vue +++ b/src/views/modules/payment/channel/wechat/WeChatConfigList.vue @@ -116,10 +116,7 @@ export default { ...this.queryParam, ...this.pages }).then(res => { - this.tableData = res.data.records - this.pagination.current = Number(res.data.current) - this.pagination.total = Number(res.data.total) - this.loading = false + this.pageQueryResHandel(res, this) }) }, add () { diff --git a/src/views/modules/payment/wallet/list/UserSelectModal.vue b/src/views/modules/payment/wallet/list/UserSelectModal.vue index c0f660a..d0d1c10 100644 --- a/src/views/modules/payment/wallet/list/UserSelectModal.vue +++ b/src/views/modules/payment/wallet/list/UserSelectModal.vue @@ -87,10 +87,7 @@ export default { ...this.queryParam, ...this.pages }).then(res => { - this.tableData = res.data.records - this.pagination.current = Number(res.data.current) - this.pagination.total = Number(res.data.total) - this.loading = false + this.pageQueryResHandel(res, this) }) }, handleOk () { diff --git a/src/views/modules/starter/file/FileUploadList.vue b/src/views/modules/starter/file/FileUploadList.vue index b92800b..a0b7c6f 100644 --- a/src/views/modules/starter/file/FileUploadList.vue +++ b/src/views/modules/starter/file/FileUploadList.vue @@ -86,10 +86,7 @@ export default { ...this.queryParam, ...this.pages }).then(res => { - this.tableData = res.data.records - this.pagination.current = Number(res.data.current) - this.pagination.total = Number(res.data.total) - this.loading = false + this.pageQueryResHandel(res, this) }) }, // 下载 diff --git a/src/views/modules/starter/log/DataVersionLogList.vue b/src/views/modules/starter/log/DataVersionLogList.vue index 28c57b1..497df5a 100644 --- a/src/views/modules/starter/log/DataVersionLogList.vue +++ b/src/views/modules/starter/log/DataVersionLogList.vue @@ -87,10 +87,7 @@ export default { ...this.queryParam, ...this.pages }).then(res => { - this.tableData = res.data.records - this.pagination.current = Number(res.data.current) - this.pagination.total = Number(res.data.total) - this.loading = false + this.pageQueryResHandel(res, this) }) }, show (record) { diff --git a/src/views/modules/starter/log/LoginLogInfo.vue b/src/views/modules/starter/log/LoginLogInfo.vue index 023d285..66a5c12 100644 --- a/src/views/modules/starter/log/LoginLogInfo.vue +++ b/src/views/modules/starter/log/LoginLogInfo.vue @@ -18,7 +18,10 @@ {{ form.login?"成功":"失败" }} - {{ form.client }} + {{ getClient(form.client) }} + + + {{ getLoginType(form.loginType) }} {{ form.ip }} @@ -49,6 +52,7 @@