在个人中心页添加录入入口
This commit is contained in:
parent
61bcbce7e6
commit
4d6c204d52
|
|
@ -1,5 +1,6 @@
|
|||
// 认证相关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} 返回登录结果
|
||||
*/
|
||||
export function wxLogin(data) {
|
||||
return post('/wxLogin', data, {
|
||||
return post("/wxLogin", data, {
|
||||
noToken: true,
|
||||
showLoading: true,
|
||||
loadingText: '登录中...',
|
||||
})
|
||||
loadingText: "登录中...",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -22,11 +23,11 @@ export function wxLogin(data) {
|
|||
* @returns {Promise} 返回登录结果
|
||||
*/
|
||||
export function userLogin(data) {
|
||||
return post('/user/login', data, {
|
||||
return post("/user/login", data, {
|
||||
noToken: true,
|
||||
showLoading: true,
|
||||
loadingText: '登录中...',
|
||||
})
|
||||
loadingText: "登录中...",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -34,7 +35,7 @@ export function userLogin(data) {
|
|||
* @returns {Promise} 返回登出结果
|
||||
*/
|
||||
export function userLogout() {
|
||||
return post('/user/logout')
|
||||
return post("/user/logout");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,5 +44,11 @@ export function userLogout() {
|
|||
* @returns {Promise} 返回刷新结果
|
||||
*/
|
||||
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",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,9 @@
|
|||
|
||||
<!-- 功能菜单区域 -->
|
||||
<view class="menu-section">
|
||||
<view
|
||||
v-for="(item, index) in menuItems"
|
||||
:key="index"
|
||||
class="menu-item"
|
||||
<view v-for="(item, index) in menuItems" :key="index" class="menu-item">
|
||||
<template
|
||||
v-if="item.title !== '牌位录入' || SysAdmin === true"
|
||||
@click="handleMenuClick(item)"
|
||||
>
|
||||
<view class="menu-icon">
|
||||
|
|
@ -32,6 +31,7 @@
|
|||
<view class="menu-arrow">
|
||||
<image :src="CommonEnum.RIGHT_CHEVRON" mode="aspectFit" />
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -41,6 +41,7 @@
|
|||
<script>
|
||||
import { CommonEnum } from "@/enum/common.js";
|
||||
import { getUserInfo } from "@/api/personalCenter/index.js";
|
||||
import { isSysAdmin } from "../../api/auth/auth";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -80,7 +81,7 @@ export default {
|
|||
path: "/pages/personalCenter/prayerRecords",
|
||||
},
|
||||
{
|
||||
title: "寺庙活动",
|
||||
title: "牌位录入",
|
||||
icon: CommonEnum.MY_ACTIVITY,
|
||||
path: "/pages/personalCenter/templeActivities",
|
||||
},
|
||||
|
|
@ -90,8 +91,14 @@ export default {
|
|||
onLoad() {
|
||||
// 页面加载时获取用户信息
|
||||
this.loadUserInfo();
|
||||
this.getIsSysAdmin();
|
||||
},
|
||||
methods: {
|
||||
async getIsSysAdmin() {
|
||||
const res = await isSysAdmin();
|
||||
this.SysAdmin = res.data;
|
||||
console.log("isSystem", this.SysAdmin);
|
||||
},
|
||||
// 加载用户信息
|
||||
async loadUserInfo() {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user