Merge branch 'abp' of https://gitee.com/ccnetcore/Yi into abp
This commit is contained in:
13
Yi.Bbs.Vue3/src/apis/dictionaryApi.js
Normal file
13
Yi.Bbs.Vue3/src/apis/dictionaryApi.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import request from "@/config/axios/service";
|
||||
|
||||
/**
|
||||
* 根据字典类型获取字典列表
|
||||
* @param {*} dicType 字典类型
|
||||
* @returns
|
||||
*/
|
||||
export function getDictionaryList(dicType) {
|
||||
return request({
|
||||
url: `/dictionary/dic-type/${dicType}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
@@ -1,28 +1,51 @@
|
||||
<template>
|
||||
<el-scrollbar>
|
||||
<el-scrollbar>
|
||||
<div class="scrollbar-flex-content">
|
||||
<p v-for="item in 50" :key="item" class="scrollbar-item">
|
||||
推荐
|
||||
</p>
|
||||
<div v-for="item in recommendList" :key="item.id" class="scrollbar-item">
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
:content="item.dictLabel"
|
||||
placement="top"
|
||||
v-if="item.dictLabel.length > 5"
|
||||
>
|
||||
{{ item.dictLabel.slice(0, 5) + "..." }}
|
||||
</el-tooltip>
|
||||
<span v-else>
|
||||
{{ item.dictLabel }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
<style scoped>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { getDictionaryList } from "@/apis/dictionaryApi.js";
|
||||
|
||||
const recommendList = ref([]);
|
||||
onMounted(async () => {
|
||||
const { data } = await getDictionaryList("bbs_type_lable");
|
||||
recommendList.value = data;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scrollbar-flex-content {
|
||||
display: flex;
|
||||
}
|
||||
.scrollbar-item {
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 4rem;
|
||||
height: 2.6rem;
|
||||
margin: 0 0.2rem ;
|
||||
margin: 0 0.2rem;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
background-color:#FAFAFA;
|
||||
background-color: #fafafa;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import axios from "axios";
|
||||
import router from "@/router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { config } from "@/config/axios/config";
|
||||
import { Session } from "@/utils/storage";
|
||||
@@ -57,11 +58,14 @@ service.interceptors.response.use(
|
||||
} else {
|
||||
const res = error.response || {};
|
||||
const status = Number(res.status) || 200;
|
||||
const message = res.data.error.message;
|
||||
const message = res?.data?.error?.message;
|
||||
if (status === 401) {
|
||||
ElMessage({
|
||||
type: "danger",
|
||||
message,
|
||||
ElMessageBox.confirm("该功能需要登陆后享有,是否立即登录?", "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
router.push("/login");
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import App from "./App.vue";
|
||||
import router from "./router";
|
||||
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
||||
|
||||
import "element-plus/dist/index.css";
|
||||
import "./assets/main.css";
|
||||
import "@/assets/styles/index.scss"; // global css
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<RouterLink to="/register"> 没有账号?前往注册</RouterLink>
|
||||
<!-- <RouterLink to="/register"> 没有账号?前往注册</RouterLink> -->
|
||||
<button class="login-btn" @click="login(loginFormRef)">登 录</button>
|
||||
<button class="login-btn" @click="guestlogin">访客</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user