mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-15 07:03:48 +08:00
v3.0.0
This commit is contained in:
@@ -18,9 +18,6 @@
|
||||
</div>
|
||||
<template #overlay>
|
||||
<a-menu :class="['avatar-menu']">
|
||||
<a-menu-item @click="onRefresh">
|
||||
<span>刷新权限</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="showUpdatePwdModal">
|
||||
<span>修改密码</span>
|
||||
</a-menu-item>
|
||||
@@ -34,7 +31,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref, onMounted } from 'vue';
|
||||
import { loginApi } from '/@/api/system/login/login-api';
|
||||
import { loginApi } from '/src/api/system/login-api';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { clearAllCoolies } from '/@/utils/cookie-util';
|
||||
import { localClear } from '/@/utils/local-util';
|
||||
@@ -59,12 +56,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新用户信息(包含用户基础信息、权限信息等等)
|
||||
async function onRefresh() {
|
||||
await loginApi.refresh();
|
||||
location.reload();
|
||||
}
|
||||
|
||||
// ------------------------ 修改密码 ------------------------
|
||||
const resetPasswordRef = ref();
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<a-dropdown trigger="click" v-model:visible="show">
|
||||
<a-dropdown trigger="click" v-model:open="show">
|
||||
<div @click="fetchMessage">
|
||||
<a-badge count="12">
|
||||
<div style="width: 26px; height: 26px">
|
||||
@@ -110,7 +110,6 @@
|
||||
|
||||
.dropdown-tabs {
|
||||
background-color: @base-bg-color;
|
||||
box-shadow: 0 2px 8px @shadow-color;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" title="修改密码" ok-text="确认" cancel-text="取消" @ok="updatePwd" @cancel="cancelModal">
|
||||
<a-modal :open="visible" title="修改密码" ok-text="确认" cancel-text="取消" @ok="updatePwd" @cancel="cancelModal">
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }">
|
||||
<a-form-item label="原密码" name="oldPassword">
|
||||
<a-input v-model:value.trim="form.oldPassword" type="password" placeholder="请输入原密码" />
|
||||
@@ -25,19 +25,19 @@
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { employeeApi } from '/@/api/system/employee/employee-api';
|
||||
import { employeeApi } from '/src/api/system/employee-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
const visible = ref(false);
|
||||
const formRef = ref();
|
||||
const tips = '字母(不限大小写)+数字组合,6-15位'; //校验规则
|
||||
const reg = /(^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,15}$)/; //校验正则
|
||||
const tips = '密码长度8-20位且包含大写字母、小写字母、数字三种'; //校验规则
|
||||
const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,20}$/;
|
||||
|
||||
const rules = {
|
||||
oldPassword: [{ required: true, message: '请输入原密码' }],
|
||||
newPassword: [{ type: 'string', pattern: reg, message: '密码格式错误' }],
|
||||
confirmPwd: [{ type: 'string', pattern: reg, message: '请输入确认密码' }],
|
||||
newPassword: [{ type: 'string', pattern: reg, message: '密码格式错误' }],
|
||||
confirmPwd: [{ type: 'string', pattern: reg, message: '请输入确认密码' }],
|
||||
};
|
||||
|
||||
const formDefault = {
|
||||
@@ -75,6 +75,9 @@
|
||||
|
||||
function showModal() {
|
||||
visible.value = true;
|
||||
form.oldPassword = '';
|
||||
form.newPassword = '';
|
||||
form.confirmPwd = '';
|
||||
}
|
||||
|
||||
function cancelModal() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<a-drawer :title="$t('setting.title')" placement="right" :visible="visible" @close="close">
|
||||
<a-drawer :title="$t('setting.title')" placement="right" :open="visible" @close="close">
|
||||
<a-form layout="horizontal" :label-col="{ span: 8 }">
|
||||
<a-form-item label="语言/Language">
|
||||
<a-select v-model:value="formState.language" @change="changeLanguage" style="width: 120px">
|
||||
@@ -27,6 +27,10 @@
|
||||
<a-input-number @change="changeSideMenuWidth" v-model:value="formState.sideMenuWidth" :min="1" />
|
||||
像素(px)
|
||||
</a-form-item>
|
||||
<a-form-item :label="$t('setting.page.width')" v-if="formState.layout === LAYOUT_ENUM.TOP.value">
|
||||
<a-input @change="changePageWidth" v-model:value="formState.pageWidth" />
|
||||
像素(px)或者 百分比
|
||||
</a-form-item>
|
||||
<a-form-item :label="$t('setting.menu.theme')">
|
||||
<a-radio-group v-model:value="formState.sideMenuTheme" button-style="solid" @change="changeMenuTheme">
|
||||
<a-radio-button value="dark">Dark</a-radio-button>
|
||||
@@ -45,6 +49,9 @@
|
||||
<a-form-item :label="$t('setting.helpdoc')">
|
||||
<a-switch @change="changeHelpDocFlag" v-model:checked="formState.helpDocFlag" checked-children="显示" un-checked-children="隐藏" />
|
||||
</a-form-item>
|
||||
<a-form-item :label="$t('setting.watermark')">
|
||||
<a-switch @change="changeWatermarkFlag" v-model:checked="formState.watermarkFlag" checked-children="显示" un-checked-children="隐藏" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<div class="footer">
|
||||
<a-button style="margin-right: 8px" type="primary" @click="copy">复制配置信息</a-button>
|
||||
@@ -121,6 +128,8 @@
|
||||
language: appConfigStore.language,
|
||||
// 布局: side 或者 side-expand
|
||||
layout: appConfigStore.layout,
|
||||
// 页面宽度
|
||||
pageWidth: appConfigStore.pageWidth,
|
||||
// 侧边菜单宽度
|
||||
sideMenuWidth: appConfigStore.sideMenuWidth,
|
||||
// 菜单主题
|
||||
@@ -133,6 +142,8 @@
|
||||
footerFlag: appConfigStore.footerFlag,
|
||||
// 帮助文档
|
||||
helpDocFlag: appConfigStore.helpDocFlag,
|
||||
// 水印
|
||||
watermarkFlag: appConfigStore.watermarkFlag,
|
||||
};
|
||||
|
||||
let formState = reactive({ ...formValue });
|
||||
@@ -156,6 +167,13 @@
|
||||
sideMenuWidth: value,
|
||||
});
|
||||
}
|
||||
|
||||
function changePageWidth(e) {
|
||||
appConfigStore.$patch({
|
||||
pageWidth: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
function changeMenuTheme(e) {
|
||||
appConfigStore.$patch({
|
||||
sideMenuTheme: e.target.value,
|
||||
@@ -185,6 +203,12 @@
|
||||
helpDocFlag: e,
|
||||
});
|
||||
}
|
||||
|
||||
function changeWatermarkFlag(e) {
|
||||
appConfigStore.$patch({
|
||||
watermarkFlag: e,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.footer {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<a-input-search
|
||||
@click="search"
|
||||
style="margin-right: 30px; width: 250px"
|
||||
placeholder="1024创新实验室、小镇程序员"
|
||||
placeholder="搜索:六边形工程师、1024"
|
||||
enter-button="搜索"
|
||||
size="small"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user