diff --git a/README.md b/README.md index e2b98d97..ddf157e6 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,9 @@ Snowy谐音“小诺”,恰应小诺团队名称;意思为”下雪的、纯 ## 快速链接 -下载地址:[https://gitee.com/xiaonuobase/snowy](https://gitee.com/xiaonuobase/snowy) +gitee下载地址:[https://gitee.com/xiaonuobase/snowy](https://gitee.com/xiaonuobase/snowy) + +github下载地址(镜像):[https://github.com/xiaonuobase/Snowy](https://github.com/xiaonuobase/Snowy) 演示地址:[https://snowy.xiaonuo.vip](https://snowy.xiaonuo.vip) @@ -135,10 +137,9 @@ snowy ## 视频教程 -免费教程地址:[https://space.bilibili.com/50101698/channel/collectiondetail?sid=739071](https://space.bilibili.com/50101698/channel/collectiondetail?sid=739071) +教程地址(免费开放):[https://space.bilibili.com/50101698/channel/collectiondetail?sid=739071](https://space.bilibili.com/50101698/channel/collectiondetail?sid=739071) - - + 作者也在上班工作,所以在利用休息时间为大家创作,录制视频的目的也是为各位小伙伴提供文档跟技术交流群聊之外的上手学习资料 @@ -190,6 +191,18 @@ QQ技术群:732230670 +## 代码贡献 + +近期有很多热心开源的小伙伴陆续为咱们Snowy框架提交PR或者提出好的建议,基本合格的PR我们都接受,这样您的头像就列入到咱们Snowy仓库的贡献者列表啦! + +如何贡献: + +1、fork一份代码至自己的账号下,本地修改您要提的代码,提交至您fork的仓库 + +2、登录gitee后到Snowy仓库下创建Pull Requests,选择您的仓库到Snowy的dev分支,提交即可 + +因为dev分支是团队开发分支,并不是统一发版本的测试过的,所以我们建议提代码至dev即可 + ## 团队成员 | 成员 | 技术 | 昵称 | diff --git a/snowy-admin-web/src/components/Selector/iconSelector.vue b/snowy-admin-web/src/components/Selector/iconSelector.vue index 5d0ecbfb..01dfb3c1 100644 --- a/snowy-admin-web/src/components/Selector/iconSelector.vue +++ b/snowy-admin-web/src/components/Selector/iconSelector.vue @@ -60,7 +60,7 @@ }, // 默认配置 defaultSetting(value) { - if ((value !== undefined) & (value !== '') & (value !== 'undefined')) { + if (value) { this.modelValue = value // 判断展开哪个 if (value.indexOf('-outlined') > -1 || value.indexOf('-filled') > -1 || value.indexOf('-two-tone') > -1) { diff --git a/snowy-admin-web/src/layout/index.vue b/snowy-admin-web/src/layout/index.vue index b2625c14..fe46c91e 100644 --- a/snowy-admin-web/src/layout/index.vue +++ b/snowy-admin-web/src/layout/index.vue @@ -38,8 +38,8 @@
-
- +
+
@@ -139,8 +139,8 @@
-
- +
+
diff --git a/snowy-admin-web/src/views/auth/findPwd/emailFindForm.vue b/snowy-admin-web/src/views/auth/findPwd/emailFindForm.vue index 94aa1517..bcdd3b6c 100644 --- a/snowy-admin-web/src/views/auth/findPwd/emailFindForm.vue +++ b/snowy-admin-web/src/views/auth/findPwd/emailFindForm.vue @@ -92,6 +92,7 @@ import router from '@/router' import { required, rules } from '@/utils/formRules' import userCenterApi from '@/api/sys/userCenterApi' + import smCrypto from "@/utils/smCrypto" const emailResetFormRef = ref() const emailFormData = ref({}) const islogin = ref(false) @@ -102,7 +103,7 @@ let formRules = ref({}) const emailValidCodeReqNo = ref('') - // 点击获取短信验证码 + // 点击获取邮箱验证码 const getEmailValidCode = () => { formRules.value.email = [required(), rules.email] delete formRules.value.emailValidCode @@ -122,8 +123,8 @@ emailResetFormRef.value.validate().then(() => { emailFormData.value.validCode = emailFormData.value.emailValidCode - // delete emailFormData.value.emailValidCode emailFormData.value.validCodeReqNo = emailValidCodeReqNo.value + emailFormData.value.newPassword = smCrypto.doSm2Encrypt(emailFormData.value.newPassword) islogin.value = true userCenterApi .userFindPasswordByEmail(emailFormData.value) @@ -144,7 +145,6 @@ const emailLoginFormModalRef = ref() const emailFormModalData = ref({}) const validCodeBase64 = ref('') - const validCodeReqNo = ref('') const formModalRules = { validCode: [required(), rules.lettersNum] } @@ -158,10 +158,10 @@ visible.value = false } const handleOk = () => { - // 获取到里面的验证码,并发送短信 + // 获取到里面的验证码,并发送邮箱 emailLoginFormModalRef.value.validate().then(() => { visible.value = false - // 发送短信,首先拿到刚刚输入的手机号 + // 发送邮箱,首先拿到刚刚输入的邮箱 emailFormModalData.value.email = emailFormData.value.email // 禁用发送按钮,并设置为倒计时 state.value.smsSendBtn = true @@ -180,13 +180,15 @@ emailValidCodeReqNo.value = data visible.value = false setTimeout(hide, 500) - emailFormModalData.value.validCode = '' }) .catch(() => { setTimeout(hide, 100) clearInterval(interval) state.value.smsSendBtn = false }) + .finally(() => { + emailFormModalData.value.validCode = '' + }) }) } diff --git a/snowy-admin-web/src/views/auth/findPwd/phoneFindForm.vue b/snowy-admin-web/src/views/auth/findPwd/phoneFindForm.vue index 194fd253..ce948866 100644 --- a/snowy-admin-web/src/views/auth/findPwd/phoneFindForm.vue +++ b/snowy-admin-web/src/views/auth/findPwd/phoneFindForm.vue @@ -93,6 +93,7 @@ import router from '@/router' import { required, rules } from '@/utils/formRules' import userCenterApi from '@/api/sys/userCenterApi' + import smCrypto from "@/utils/smCrypto" const phoneLoginFormRef = ref() const phoneFormData = ref({}) const islogin = ref(false) @@ -123,8 +124,8 @@ phoneLoginFormRef.value.validate().then(() => { phoneFormData.value.validCode = phoneFormData.value.phoneValidCode - // delete phoneFormData.value.phoneValidCode phoneFormData.value.validCodeReqNo = phoneValidCodeReqNo.value + phoneFormData.value.newPassword = smCrypto.doSm2Encrypt(phoneFormData.value.newPassword) islogin.value = true userCenterApi .userFindPasswordByPhone(phoneFormData.value) @@ -145,7 +146,6 @@ const phoneLoginFormModalRef = ref() const phoneFormModalData = ref({}) const validCodeBase64 = ref('') - const validCodeReqNo = ref('') const formModalRules = { validCode: [required(), rules.lettersNum] } @@ -181,13 +181,15 @@ phoneValidCodeReqNo.value = data visible.value = false setTimeout(hide, 500) - phoneFormModalData.value.validCode = '' }) .catch(() => { setTimeout(hide, 100) clearInterval(interval) state.value.smsSendBtn = false }) + .finally(() => { + phoneFormModalData.value.validCode = '' + }) }) } diff --git a/snowy-admin-web/src/views/biz/org/form.vue b/snowy-admin-web/src/views/biz/org/form.vue index 99a7bdcf..744c2fb9 100644 --- a/snowy-admin-web/src/views/biz/org/form.vue +++ b/snowy-admin-web/src/views/biz/org/form.vue @@ -158,10 +158,12 @@ submitLoading.value = true formData.value.extJson = JSON.stringify(extJson.value) bizOrgApi.submitForm(formData.value, !formData.value.id).then(() => { - submitLoading.value = false visible = false emit('successful') }) + .finally(() => { + submitLoading.value = false + }) }) .catch(() => {}) } diff --git a/snowy-admin-web/src/views/biz/org/index.vue b/snowy-admin-web/src/views/biz/org/index.vue index 91118e22..77b33ea8 100644 --- a/snowy-admin-web/src/views/biz/org/index.vue +++ b/snowy-admin-web/src/views/biz/org/index.vue @@ -156,6 +156,9 @@ }) } }) + .finally(() => { + cardLoading.value = false + }) } // 点击树查询 const treeSelect = (selectedKeys) => { diff --git a/snowy-admin-web/src/views/biz/position/form.vue b/snowy-admin-web/src/views/biz/position/form.vue index 447cac38..fc7bc488 100644 --- a/snowy-admin-web/src/views/biz/position/form.vue +++ b/snowy-admin-web/src/views/biz/position/form.vue @@ -115,9 +115,11 @@ submitLoading.value = true bizPositionApi.submitForm(formData.value, !formData.value.id).then(() => { visible = false - submitLoading.value = false emit('successful') }) + .finally(() => { + submitLoading.value = false + }) }) .catch(() => {}) } diff --git a/snowy-admin-web/src/views/biz/position/index.vue b/snowy-admin-web/src/views/biz/position/index.vue index d24fb5b9..90e4cba6 100644 --- a/snowy-admin-web/src/views/biz/position/index.vue +++ b/snowy-admin-web/src/views/biz/position/index.vue @@ -155,6 +155,9 @@ }) } }) + .finally(() => { + cardLoading.value = false + }) // 点击树查询 const treeSelect = (selectedKeys) => { if (selectedKeys.length > 0) { diff --git a/snowy-admin-web/src/views/biz/user/index.vue b/snowy-admin-web/src/views/biz/user/index.vue index 200751d0..ce367be2 100644 --- a/snowy-admin-web/src/views/biz/user/index.vue +++ b/snowy-admin-web/src/views/biz/user/index.vue @@ -208,6 +208,9 @@ }) } }) + .finally(() => { + cardLoading.value = false + }) // 列表选择配置 const options = { alert: { @@ -236,14 +239,18 @@ loading.value = true if (record.userStatus === 'ENABLE') { bizUserApi.userDisableUser(record).then(() => { - loading.value = false table.value.refresh() }) + .finally(() => { + loading.value = false + }) } else { bizUserApi.userEnableUser(record).then(() => { - loading.value = false table.value.refresh() }) + .finally(() => { + loading.value = false + }) } } // 删除人员 diff --git a/snowy-admin-web/src/views/dev/email/index.vue b/snowy-admin-web/src/views/dev/email/index.vue index 783eda44..e2022b52 100644 --- a/snowy-admin-web/src/views/dev/email/index.vue +++ b/snowy-admin-web/src/views/dev/email/index.vue @@ -154,7 +154,7 @@ } ] emailApi.emailDelete(params).then(() => { - table.refresh(true) + table.value.refresh(true) }) } // 批量删除 diff --git a/snowy-admin-web/src/views/dev/file/index.vue b/snowy-admin-web/src/views/dev/file/index.vue index cdeff1fd..65f18ad7 100644 --- a/snowy-admin-web/src/views/dev/file/index.vue +++ b/snowy-admin-web/src/views/dev/file/index.vue @@ -178,7 +178,7 @@ } ] fileApi.fileDelete(params).then(() => { - table.refresh(true) + table.value.refresh(true) }) } // 批量删除 diff --git a/snowy-admin-web/src/views/dev/file/uploadForm.vue b/snowy-admin-web/src/views/dev/file/uploadForm.vue index 0cf7c897..dd25cf73 100644 --- a/snowy-admin-web/src/views/dev/file/uploadForm.vue +++ b/snowy-admin-web/src/views/dev/file/uploadForm.vue @@ -118,7 +118,7 @@ uploadLoading.value = false }) } - // 上传腾讯文件 + // 上传Minio文件 const customRequestMinio = (data) => { uploadLoading.value = true const fileData = new FormData() diff --git a/snowy-admin-web/src/views/dev/message/index.vue b/snowy-admin-web/src/views/dev/message/index.vue index e854a931..0b4cebc6 100644 --- a/snowy-admin-web/src/views/dev/message/index.vue +++ b/snowy-admin-web/src/views/dev/message/index.vue @@ -118,7 +118,7 @@ } ] messageApi.messageDelete(params).then(() => { - table.refresh(true) + table.value.refresh(true) }) } // 批量删除 diff --git a/snowy-admin-web/src/views/dev/sms/index.vue b/snowy-admin-web/src/views/dev/sms/index.vue index fdea94f9..5762c1da 100644 --- a/snowy-admin-web/src/views/dev/sms/index.vue +++ b/snowy-admin-web/src/views/dev/sms/index.vue @@ -154,7 +154,7 @@ } ] smsApi.smsDelete(params).then(() => { - table.refresh(true) + table.value.refresh(true) }) } // 批量删除 diff --git a/snowy-admin-web/src/views/sys/role/scopeDefineOrg.vue b/snowy-admin-web/src/views/sys/role/scopeDefineOrg.vue index 1812f983..256a2e1b 100644 --- a/snowy-admin-web/src/views/sys/role/scopeDefineOrg.vue +++ b/snowy-admin-web/src/views/sys/role/scopeDefineOrg.vue @@ -33,7 +33,7 @@ const resultDataModel = { dataScopeId: '', defineOrgIdData: { - scopeCategory: 'SCOPE_DEFINE_ORG', + scopeCategory: 'SCOPE_ORG_DEFINE', scopeDefineOrgIdList: [] } } diff --git a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java index 532ba60e..7c2fd1bb 100644 --- a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java +++ b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/core/config/AuthConfigure.java @@ -32,6 +32,7 @@ import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import vip.xiaonuo.auth.core.enums.SaClientTypeEnum; +import vip.xiaonuo.auth.core.util.StpClientLoginUserUtil; import vip.xiaonuo.auth.core.util.StpLoginUserUtil; import vip.xiaonuo.common.pojo.CommonResult; @@ -100,7 +101,11 @@ public class AuthConfigure implements WebMvcConfigurer { */ @Override public List getPermissionList(Object loginId, String loginType) { - return StpLoginUserUtil.getLoginUser().getPermissionCodeList(); + if (SaClientTypeEnum.B.getValue().equals(loginType)) { + return StpLoginUserUtil.getLoginUser().getPermissionCodeList(); + } else { + return StpClientLoginUserUtil.getClientLoginUser().getPermissionCodeList(); + } } /** @@ -108,7 +113,11 @@ public class AuthConfigure implements WebMvcConfigurer { */ @Override public List getRoleList(Object loginId, String loginType) { - return StpLoginUserUtil.getLoginUser().getRoleCodeList(); + if (SaClientTypeEnum.B.getValue().equals(loginType)) { + return StpLoginUserUtil.getLoginUser().getRoleCodeList(); + } else { + return StpClientLoginUserUtil.getClientLoginUser().getRoleCodeList(); + } } } diff --git a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java index 231c372d..7ac27587 100644 --- a/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java +++ b/snowy-plugin/snowy-plugin-auth/src/main/java/vip/xiaonuo/auth/modular/login/service/impl/AuthServiceImpl.java @@ -315,7 +315,7 @@ public class AuthServiceImpl implements AuthService { saBaseClientLoginUser.setButtonCodeList(clientLoginUserApi.getButtonCodeListListByUserId(saBaseClientLoginUser.getId())); // 获取数据范围 saBaseClientLoginUser.setDataScopeList(Convert.toList(SaBaseClientLoginUser.DataScope.class, - loginUserApi.getPermissionListByUserId(saBaseClientLoginUser.getId(), null))); + clientLoginUserApi.getPermissionListByUserId(saBaseClientLoginUser.getId(), null))); // 获取权限码 saBaseClientLoginUser.setPermissionCodeList(saBaseClientLoginUser.getDataScopeList().stream() .map(SaBaseClientLoginUser.DataScope::getApiUrl).collect(Collectors.toList())); @@ -354,7 +354,7 @@ public class AuthServiceImpl implements AuthService { saBaseClientLoginUser.setPassword(null); saBaseClientLoginUser.setPermissionCodeList(null); saBaseClientLoginUser.setDataScopeList(null); - return StpClientLoginUserUtil.getClientLoginUser(); + return saBaseClientLoginUser; } @Override diff --git a/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/ServiceImpl.java.btl b/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/ServiceImpl.java.btl index a60f75ad..ed208d0f 100644 --- a/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/ServiceImpl.java.btl +++ b/snowy-plugin/snowy-plugin-gen/src/main/resources/backend/ServiceImpl.java.btl @@ -81,7 +81,11 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${c @Override public void edit(${className}EditParam ${classNameFirstLower}EditParam) { - ${className} ${classNameFirstLower} = this.queryEntity(${classNameFirstLower}EditParam.getId()); + <% for(var i = 0; i < configList.~size; i++) { %> + <% if(configList[i].needTableId) { %> + ${className} ${classNameFirstLower} = this.queryEntity(${classNameFirstLower}EditParam.get${configList[i].fieldNameCamelCaseFirstUpper}()); + <% } %> + <% } %> BeanUtil.copyProperties(${classNameFirstLower}EditParam, ${classNameFirstLower}); this.updateById(${classNameFirstLower}); } @@ -90,12 +94,20 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${c @Override public void delete(List<${className}IdParam> ${classNameFirstLower}IdParamList) { // 执行删除 - this.removeBatchByIds(CollStreamUtil.toList(${classNameFirstLower}IdParamList, ${className}IdParam::getId)); + <% for(var i = 0; i < configList.~size; i++) { %> + <% if(configList[i].needTableId) { %> + this.removeBatchByIds(CollStreamUtil.toList(${classNameFirstLower}IdParamList, ${className}IdParam::get${configList[i].fieldNameCamelCaseFirstUpper})); + <% } %> + <% } %> } @Override public ${className} detail(${className}IdParam ${classNameFirstLower}IdParam) { - return this.queryEntity(${classNameFirstLower}IdParam.getId()); + <% for(var i = 0; i < configList.~size; i++) { %> + <% if(configList[i].needTableId) { %> + return this.queryEntity(${classNameFirstLower}IdParam.get${configList[i].fieldNameCamelCaseFirstUpper}()); + <% } %> + <% } %> } @Override diff --git a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl index 49a0d1a0..30f9071e 100644 --- a/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl +++ b/snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl @@ -1,6 +1,10 @@