Commit 2dd2fbbf authored by 张伯涛's avatar 张伯涛

修改

parent 3b44e346
...@@ -31,17 +31,27 @@ router.beforeEach(async (to, from, next) => { ...@@ -31,17 +31,27 @@ router.beforeEach(async (to, from, next) => {
} else { } else {
try { try {
const { permissions } = await userStore.getUserInfo(); const { permissions } = await userStore.getUserInfo();
if (permissions && permissions.length > 0) { //'/controlPlatform/control'登录后的跳转的特殊路由
if (to.path === "/controlPlatform/control") {
if (permissions && permissions.length > 0) {
const accessRoutes = await userStore.generateRoutes();
accessRoutes.forEach((route) => {
router.addRoute(route);
});
next({ path: accessRoutes[0].children?.[0].path, replace: true }); // 跳转登录用户的第一个菜单
// next({ ...to, replace: true });
} else {
userStore.logout().then((_) => {
alert("用户无权限");
next(`/login`);
});
}
} else {
const accessRoutes = await userStore.generateRoutes(); const accessRoutes = await userStore.generateRoutes();
accessRoutes.forEach((route) => { accessRoutes.forEach((route) => {
router.addRoute(route); router.addRoute(route);
}); });
next({ ...to, replace: true }); next({ ...to, replace: true });
} else {
userStore.logout().then((_) => {
alert("用户无权限");
next(`/login`);
});
} }
} catch (error) { } catch (error) {
// 移除 token 并跳转登录页 // 移除 token 并跳转登录页
......
...@@ -69,93 +69,93 @@ ...@@ -69,93 +69,93 @@
</el-form-item> </el-form-item>
</el-tooltip> </el-tooltip>
<!-- 验证码 --> <!-- &lt;!&ndash; 验证码 &ndash;&gt;-->
<div v-if="captchaType === 'MATH' || captchaType === 'CHAR'"> <!-- <div v-if="captchaType === 'MATH' || captchaType === 'CHAR'">-->
<el-form-item prop="code"> <!-- <el-form-item prop="code">-->
<span class="p-2"> <!-- <span class="p-2">-->
<svg-icon icon-class="captcha" /> <!-- <svg-icon icon-class="captcha" />-->
</span> <!-- </span>-->
<el-input <!-- <el-input-->
v-model="loginData.code" <!-- v-model="loginData.code"-->
auto-complete="off" <!-- auto-complete="off"-->
:placeholder="$t('login.captchaCode')" <!-- :placeholder="$t('login.captchaCode')"-->
class="w-[60%]" <!-- class="w-[60%]"-->
@keyup.enter="handleLogin" <!-- @keyup.enter="handleLogin"-->
/> <!-- />-->
<div class="captcha"> <!-- <div class="captcha">-->
<el-image <!-- <el-image-->
:src="captchaBase64" <!-- :src="captchaBase64"-->
@click="getCaptcha" <!-- @click="getCaptcha"-->
:style="{ height: captchaHeight }" <!-- :style="{ height: captchaHeight }"-->
class="w-[120px] h-[48px] cursor-pointer" <!-- class="w-[120px] h-[48px] cursor-pointer"-->
> <!-- >-->
<template #error> <!-- <template #error>-->
<div class="image-slot"> <!-- <div class="image-slot">-->
<i-ep-picture /> <!-- <i-ep-picture />-->
</div> <!-- </div>-->
</template> <!-- </template>-->
</el-image> <!-- </el-image>-->
</div> <!-- </div>-->
</el-form-item> <!-- </el-form-item>-->
</div> <!-- </div>-->
<el-form-item <!-- <el-form-item-->
v-if="captchaType === 'BLOCK' || captchaType === 'WORD'" <!-- v-if="captchaType === 'BLOCK' || captchaType === 'WORD'"-->
prop="code" <!-- prop="code"-->
> <!-- >-->
<div <!-- <div-->
class="my_btn" <!-- class="my_btn"-->
@click=" <!-- @click="-->
() => { <!-- () => {-->
if (!verifyFlag) { <!-- if (!verifyFlag) {-->
verifyShowFlag = true; <!-- verifyShowFlag = true;-->
} <!-- }-->
} <!-- }-->
" <!-- "-->
> <!-- >-->
<div <!-- <div-->
class="my_radar_btn" <!-- class="my_radar_btn"-->
:class="[ <!-- :class="[-->
verifyFlag ? 'my_radar_btn_success' : 'my_radar_btn_verify', <!-- verifyFlag ? 'my_radar_btn_success' : 'my_radar_btn_verify',-->
]" <!-- ]"-->
> <!-- >-->
<div class="my_radar_tip"> <!-- <div class="my_radar_tip">-->
<el-popover <!-- <el-popover-->
:visible="verifyShowFlag" <!-- :visible="verifyShowFlag"-->
placement="right" <!-- placement="right"-->
popper-class="verifyPopover" <!-- popper-class="verifyPopover"-->
width="345" <!-- width="345"-->
> <!-- >-->
<Verify <!-- <Verify-->
ref="verify" <!-- ref="verify"-->
:mode="'fixed'" <!-- :mode="'fixed'"-->
:captcha-type="captchaType" <!-- :captcha-type="captchaType"-->
:img-size="{ width: '323px', height: '155px' }" <!-- :img-size="{ width: '323px', height: '155px' }"-->
@success="capctchaCheckSuccess" <!-- @success="capctchaCheckSuccess"-->
/> <!-- />-->
<template #reference> <!-- <template #reference>-->
<el-button v-if="!verifyFlag" class="my_radar_tip_blue" /> <!-- <el-button v-if="!verifyFlag" class="my_radar_tip_blue" />-->
<div v-if="verifyFlag" class="geetest_success_box"> <!-- <div v-if="verifyFlag" class="geetest_success_box">-->
<div class="geetest_success_show"> <!-- <div class="geetest_success_show">-->
<div class="geetest_success_pie"></div> <!-- <div class="geetest_success_pie"></div>-->
<div class="geetest_success_filter"></div> <!-- <div class="geetest_success_filter"></div>-->
<div class="geetest_success_mask"></div> <!-- <div class="geetest_success_mask"></div>-->
</div> <!-- </div>-->
<div class="geetest_success_correct"> <!-- <div class="geetest_success_correct">-->
<div class="geetest_success_icon"></div> <!-- <div class="geetest_success_icon"></div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</template> <!-- </template>-->
</el-popover> <!-- </el-popover>-->
</div> <!-- </div>-->
<div class="my_radar_text"> <!-- <div class="my_radar_text">-->
{{ verifyFlag ? "验证成功" : "点击按钮进行验证" }} <!-- {{ verifyFlag ? "验证成功" : "点击按钮进行验证" }}-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</el-form-item> <!-- </el-form-item>-->
<el-button <el-button
:loading="loading" :loading="loading"
...@@ -355,13 +355,16 @@ function successLogin() { ...@@ -355,13 +355,16 @@ function successLogin() {
}, },
{} {}
); );
router.push({ path: "/system/user", query: otherQueryParams }); router.push({
path: "/controlPlatform/control",
query: otherQueryParams,
});
}) })
.catch(() => { .catch(() => {
loading.value = false; loading.value = false;
verifyFlag.value = false; verifyFlag.value = false;
// 验证失败,重新生成验证码 // 验证失败,重新生成验证码
getCaptcha(); // getCaptcha();
}) })
.finally(() => { .finally(() => {
loading.value = false; loading.value = false;
...@@ -374,7 +377,7 @@ function capctchaCheckSuccess(params: any) { ...@@ -374,7 +377,7 @@ function capctchaCheckSuccess(params: any) {
} }
onMounted(() => { onMounted(() => {
getCaptcha(); // getCaptcha();
// 主题初始化 // 主题初始化
const theme = useSettingsStore().theme; const theme = useSettingsStore().theme;
......
...@@ -124,8 +124,8 @@ const rules = reactive({ ...@@ -124,8 +124,8 @@ const rules = reactive({
}); });
/** 点击搜索按钮*/ /** 点击搜索按钮*/
function clickQueryBtn() { function clickQueryBtn() {
queryParams.pageNum = 1 queryParams.pageNum = 1;
handleQuery() handleQuery();
} }
/** 查询 */ /** 查询 */
function handleQuery() { function handleQuery() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment