在个人中心页添加录入入口

This commit is contained in:
WindowBird 2025-09-19 14:14:18 +08:00
parent 61bcbce7e6
commit 4d6c204d52
2 changed files with 37 additions and 23 deletions

View File

@ -1,5 +1,6 @@
// 认证相关API // 认证相关API
import { post } from '@/utils/request' import { post } from "@/utils/request";
import request from "../../utils/request";
/** /**
* 微信登录 * 微信登录
@ -9,11 +10,11 @@ import { post } from '@/utils/request'
* @returns {Promise} 返回登录结果 * @returns {Promise} 返回登录结果
*/ */
export function wxLogin(data) { export function wxLogin(data) {
return post('/wxLogin', data, { return post("/wxLogin", data, {
noToken: true, noToken: true,
showLoading: true, showLoading: true,
loadingText: '登录中...', loadingText: "登录中...",
}) });
} }
/** /**
@ -22,11 +23,11 @@ export function wxLogin(data) {
* @returns {Promise} 返回登录结果 * @returns {Promise} 返回登录结果
*/ */
export function userLogin(data) { export function userLogin(data) {
return post('/user/login', data, { return post("/user/login", data, {
noToken: true, noToken: true,
showLoading: true, showLoading: true,
loadingText: '登录中...', loadingText: "登录中...",
}) });
} }
/** /**
@ -34,7 +35,7 @@ export function userLogin(data) {
* @returns {Promise} 返回登出结果 * @returns {Promise} 返回登出结果
*/ */
export function userLogout() { export function userLogout() {
return post('/user/logout') return post("/user/logout");
} }
/** /**
@ -43,5 +44,11 @@ export function userLogout() {
* @returns {Promise} 返回刷新结果 * @returns {Promise} 返回刷新结果
*/ */
export function refreshToken(refreshToken) { export function refreshToken(refreshToken) {
return post('/user/refresh', { refreshToken }, { noToken: true }) return post("/user/refresh", { refreshToken }, { noToken: true });
}
export function isSysAdmin() {
return request({
url: "/app/user/isSysAdmin",
});
} }

View File

@ -19,19 +19,19 @@
<!-- 功能菜单区域 --> <!-- 功能菜单区域 -->
<view class="menu-section"> <view class="menu-section">
<view <view v-for="(item, index) in menuItems" :key="index" class="menu-item">
v-for="(item, index) in menuItems" <template
:key="index" v-if="item.title !== '牌位录入' || SysAdmin === true"
class="menu-item" @click="handleMenuClick(item)"
@click="handleMenuClick(item)" >
> <view class="menu-icon">
<view class="menu-icon"> <image :src="item.icon" mode="aspectFit" />
<image :src="item.icon" mode="aspectFit" /> </view>
</view> <text class="menu-text">{{ item.title }}</text>
<text class="menu-text">{{ item.title }}</text> <view class="menu-arrow">
<view class="menu-arrow"> <image :src="CommonEnum.RIGHT_CHEVRON" mode="aspectFit" />
<image :src="CommonEnum.RIGHT_CHEVRON" mode="aspectFit" /> </view>
</view> </template>
</view> </view>
</view> </view>
</view> </view>
@ -41,6 +41,7 @@
<script> <script>
import { CommonEnum } from "@/enum/common.js"; import { CommonEnum } from "@/enum/common.js";
import { getUserInfo } from "@/api/personalCenter/index.js"; import { getUserInfo } from "@/api/personalCenter/index.js";
import { isSysAdmin } from "../../api/auth/auth";
export default { export default {
data() { data() {
@ -80,7 +81,7 @@ export default {
path: "/pages/personalCenter/prayerRecords", path: "/pages/personalCenter/prayerRecords",
}, },
{ {
title: "寺庙活动", title: "牌位录入",
icon: CommonEnum.MY_ACTIVITY, icon: CommonEnum.MY_ACTIVITY,
path: "/pages/personalCenter/templeActivities", path: "/pages/personalCenter/templeActivities",
}, },
@ -90,8 +91,14 @@ export default {
onLoad() { onLoad() {
// //
this.loadUserInfo(); this.loadUserInfo();
this.getIsSysAdmin();
}, },
methods: { methods: {
async getIsSysAdmin() {
const res = await isSysAdmin();
this.SysAdmin = res.data;
console.log("isSystem", this.SysAdmin);
},
// //
async loadUserInfo() { async loadUserInfo() {
try { try {