优化代码

This commit is contained in:
RuoYi 2021-11-30 11:15:17 +08:00
parent bf4ac3ad7a
commit a2d3f987c0
8 changed files with 27 additions and 9 deletions

View File

@ -179,7 +179,7 @@ public class SysMenuServiceImpl implements ISysMenuService
router.setPath("/inner"); router.setPath("/inner");
List<RouterVo> childrenList = new ArrayList<RouterVo>(); List<RouterVo> childrenList = new ArrayList<RouterVo>();
RouterVo children = new RouterVo(); RouterVo children = new RouterVo();
String routerPath = StringUtils.replaceEach(menu.getPath(), new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" }); String routerPath = innerLinkReplaceEach(menu.getPath());
children.setPath(routerPath); children.setPath(routerPath);
children.setComponent(UserConstants.INNER_LINK); children.setComponent(UserConstants.INNER_LINK);
children.setName(StringUtils.capitalize(routerPath)); children.setName(StringUtils.capitalize(routerPath));
@ -358,7 +358,7 @@ public class SysMenuServiceImpl implements ISysMenuService
// 内链打开外网方式 // 内链打开外网方式
if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) if (menu.getParentId().intValue() != 0 && isInnerLink(menu))
{ {
routerPath = StringUtils.replaceEach(routerPath, new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" }); routerPath = innerLinkReplaceEach(routerPath);
} }
// 非外链并且是一级目录类型为目录 // 非外链并且是一级目录类型为目录
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
@ -500,4 +500,15 @@ public class SysMenuServiceImpl implements ISysMenuService
{ {
return getChildList(list, t).size() > 0 ? true : false; return getChildList(list, t).size() > 0 ? true : false;
} }
/**
* 内链域名特殊字符替换
*
* @return
*/
public String innerLinkReplaceEach(String path)
{
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS },
new String[] { "", "" });
}
} }

View File

@ -59,6 +59,14 @@ export default {
type: "warning", type: "warning",
}) })
}, },
// 提交内容
prompt(content) {
return MessageBox.prompt(content, "系统提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: "warning",
})
},
// 打开遮罩层 // 打开遮罩层
loading(content) { loading(content) {
loadingInstance = Loading.service({ loadingInstance = Loading.service({

View File

@ -111,7 +111,7 @@ export default {
}, },
/** 强退按钮操作 */ /** 强退按钮操作 */
handleForceLogout(row) { handleForceLogout(row) {
this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的数据项').then(function() { this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户').then(function() {
return forceLogout(row.tokenId); return forceLogout(row.tokenId);
}).then(() => { }).then(() => {
this.getList(); this.getList();

View File

@ -596,7 +596,7 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
closeOnClickModal: false, closeOnClickModal: false,
inputPattern: /^.{5,20}$/, inputPattern: /^.{5,20}$/,
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间", inputErrorMessage: "用户密码长度必须介于 5 和 20 之间"
}).then(({ value }) => { }).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => { resetUserPwd(row.userId, value).then(response => {
this.$modal.msgSuccess("修改成功,新密码是:" + value); this.$modal.msgSuccess("修改成功,新密码是:" + value);

View File

@ -11,7 +11,6 @@
<el-input placeholder="请输入" v-model="info.tableComment" /> <el-input placeholder="请输入" v-model="info.tableComment" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="实体类名称" prop="className"> <el-form-item label="实体类名称" prop="className">
<el-input placeholder="请输入" v-model="info.className" /> <el-input placeholder="请输入" v-model="info.className" />
@ -30,9 +29,9 @@
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
<script> <script>
export default { export default {
name: "BasicInfoForm",
props: { props: {
info: { info: {
type: Object, type: Object,

View File

@ -124,6 +124,7 @@
</el-form> </el-form>
</el-card> </el-card>
</template> </template>
<script> <script>
import { getGenTable, updateGenTable } from "@/api/tool/gen"; import { getGenTable, updateGenTable } from "@/api/tool/gen";
import { optionselect as getDictOptionselect } from "@/api/system/dict/type"; import { optionselect as getDictOptionselect } from "@/api/system/dict/type";

View File

@ -11,7 +11,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="packageName"> <el-form-item prop="packageName">
<span slot="label"> <span slot="label">
@ -213,12 +212,12 @@
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
<script> <script>
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "BasicInfoForm",
components: { Treeselect }, components: { Treeselect },
props: { props: {
info: { info: {