📝 添加初始账户登录警告

This commit is contained in:
chaos-zhu 2024-08-14 16:28:29 +08:00
parent a6c7ce7f99
commit dbca45a9ce
2 changed files with 14 additions and 3 deletions

View File

@ -83,7 +83,7 @@ import { RSAEncrypt } from '@utils/index.js'
// import useStore from '@store/index'
// const router = useRouter()
const { proxy: { $store, $api, $message, $router } } = getCurrentInstance()
const { proxy: { $store, $api, $message, $messageBox, $router } } = getCurrentInstance()
const loginFormRefs = ref(null)
const isSession = ref(true)
@ -115,7 +115,18 @@ const handleLogin = () => {
$store.setJwtToken(token, isSession.value)
$store.setUser(loginName)
$message.success({ message: msg || 'success', center: true })
$router.push('/')
if (loginName === 'admin' && pwd === 'admin') {
$messageBox.confirm('请立即修改初始用户名及密码!防止恶意扫描!', '警告', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
})
.then(async () => {
$router.push('/setting')
})
} else{
$router.push('/')
}
})
.finally(() => {
loading.value = false

View File

@ -27,7 +27,7 @@
autocomplete="off"
/>
</el-form-item>
<el-form-item label="新用户名" prop="oldPwd">
<el-form-item label="新用户名" prop="newLoginName">
<el-input
v-model.trim="formData.newLoginName"
clearable