Merge branch 'abp' of https://gitee.com/ccnetcore/Yi into abp
This commit is contained in:
@@ -63,3 +63,13 @@ export function getCodePhone(data) {
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录验证码
|
||||
*/
|
||||
export function getLoginCode() {
|
||||
return request({
|
||||
url: `/account/captcha-image`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
|
||||
<template class="back-color">
|
||||
|
||||
<div class="content-main">
|
||||
<RouterView />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.body-main {
|
||||
min-height: 10rem;
|
||||
min-width: 10rem;
|
||||
background-color:#F0F2F5;
|
||||
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
.content-main {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 1300px;
|
||||
min-height: 1150px;
|
||||
}
|
||||
</style>
|
||||
@@ -123,7 +123,7 @@ const isLogin = getToken("AccessToken") ? true : false;
|
||||
<style scoped lang="scss">
|
||||
.header {
|
||||
padding: 0 100px;
|
||||
width: 1200px;
|
||||
width: 1300px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -14,6 +14,7 @@ const useUserStore = defineStore("user", {
|
||||
icon: null,
|
||||
roles: [],
|
||||
permissions: [],
|
||||
hasPermissions: false,
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
@@ -42,18 +43,22 @@ const useUserStore = defineStore("user", {
|
||||
getUserDetailInfo()
|
||||
.then((response) => {
|
||||
const res = response.data;
|
||||
|
||||
const user = res.user;
|
||||
console.log(user, "user");
|
||||
const avatar =
|
||||
user.icon == "" || user.icon == null
|
||||
? "/favicon.ico"
|
||||
: import.meta.env.VITE_APP_BASEAPI + "/file/" + user.icon;
|
||||
console.log(avatar, "avatar");
|
||||
const all_permission = "*:*:*";
|
||||
if (res.roleCodes && res.roleCodes.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.roleCodes;
|
||||
this.permissions = res.permissionCodes;
|
||||
this.hasPermissions = res.permissionCodes.some((permission) => {
|
||||
return (
|
||||
all_permission === permission ||
|
||||
permissionFlag.includes(permission)
|
||||
);
|
||||
});
|
||||
// this.roles = ["admin"];
|
||||
// this.permissions=["*:*:*"]
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="width: 90%; min-width: 1200px">
|
||||
<div class="article-box">
|
||||
<!-- <div style="width: 1200px;"> -->
|
||||
<el-row :gutter="20" class="top-div">
|
||||
<el-col :span="5">
|
||||
@@ -383,6 +383,9 @@ watch(
|
||||
);
|
||||
</script>
|
||||
<style scoped>
|
||||
.article-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.comment {
|
||||
min-height: 40rem;
|
||||
}
|
||||
@@ -467,4 +470,5 @@ h2 {
|
||||
.breadcrumb {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="width: 1200px" class="body-div">
|
||||
<div class="discuss-box">
|
||||
<div class="header">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="标题:">
|
||||
@@ -20,11 +20,8 @@
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="enterEditArticle"
|
||||
type="primary"
|
||||
v-hasPer="['bbs:discuss:add']"
|
||||
>分享</el-button
|
||||
<el-button @click="enterEditArticle" type="primary"
|
||||
>发布主题</el-button
|
||||
>
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
@@ -183,14 +180,17 @@ watch(
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
.discuss-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.el-pagination {
|
||||
margin: 2rem 0rem 2rem 0rem;
|
||||
justify-content: right;
|
||||
}
|
||||
.body-div {
|
||||
/* .body-div {
|
||||
min-height: 1000px;
|
||||
}
|
||||
} */
|
||||
.el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: var(--el-color-primary);
|
||||
@@ -244,4 +244,5 @@ watch(
|
||||
.el-divider {
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -44,12 +44,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <h2> 登录-欢迎</h2>
|
||||
<el-input v-model="loginForm.userName" placeholder="用户名" />
|
||||
<el-input v-model="loginForm.password" placeholder="密码" show-password />
|
||||
<el-button class="login-btn" type="primary" @click="login">登录</el-button>
|
||||
<br>
|
||||
<el-button class="login-btn" type="primary" @click="guestlogin">游客临时登录</el-button> -->
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="width: 1200px">
|
||||
<div class="home-box">
|
||||
<el-row :gutter="20" class="top-div">
|
||||
<el-col :span="17">
|
||||
<div class="scrollbar">
|
||||
@@ -157,7 +157,10 @@ const statisOptions = computed(() => {
|
||||
};
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
.home-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.introduce {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
font-size: small;
|
||||
@@ -201,4 +204,5 @@ const statisOptions = computed(() => {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -40,6 +40,25 @@
|
||||
show-password
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="验证码" class="title-item"></el-form-item>
|
||||
<div class="flex-between">
|
||||
<el-col :span="18">
|
||||
<el-form-item prop="phone">
|
||||
<el-input
|
||||
size="large"
|
||||
type="text"
|
||||
v-model.trim="loginForm.code"
|
||||
placeholder="请输入验证码"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-image
|
||||
@click="handleGetCode"
|
||||
style="width: 120px; height: 40px; cursor: pointer"
|
||||
:src="codeImageURL"
|
||||
:fit="fit"
|
||||
/>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-form
|
||||
class="registerForm"
|
||||
@@ -136,10 +155,11 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import useAuths from "@/hooks/useAuths";
|
||||
import { getCodePhone } from "@/apis/accountApi";
|
||||
import { getLoginCode } from "@/apis/auth";
|
||||
|
||||
const { loginFun, registerFun } = useAuths();
|
||||
const router = useRouter();
|
||||
@@ -175,6 +195,11 @@ const login = async (formEl) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
// 获取图片验证码
|
||||
const codeImageURL = ref("");
|
||||
const handleGetCode = () => {
|
||||
getImageCode();
|
||||
};
|
||||
|
||||
// 注册逻辑
|
||||
const isRegister = ref(true);
|
||||
@@ -238,6 +263,15 @@ const captcha = async () => {
|
||||
const handleSignInNow = () => {
|
||||
isRegister.value = !isRegister.value;
|
||||
};
|
||||
|
||||
const getImageCode = async () => {
|
||||
const { data } = await getLoginCode();
|
||||
codeImageURL.value = "data:image/jpg;base64," + data.img;
|
||||
loginForm.uuid = data.uuid;
|
||||
};
|
||||
onMounted(async () => {
|
||||
await getImageCode();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.login {
|
||||
|
||||
Reference in New Issue
Block a user