From a6e5f9e2da4338f53e4e3839c4d679135990dc81 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Fri, 12 Sep 2025 15:17:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=A8=A1=E6=80=81=E7=AA=97?= =?UTF-8?q?=E8=B7=B3=E5=AE=9E=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user/user.js | 7 +++++++ pages/index/index.vue | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/api/user/user.js b/api/user/user.js index 0dad437..da6c62f 100644 --- a/api/user/user.js +++ b/api/user/user.js @@ -1,6 +1,7 @@ import request from '@/utils/request' import { uploadFile } from '@/utils/request.js' +import { exp } from 'qrcode/lib/core/galois-field' /** * 获取用户信息 @@ -233,3 +234,9 @@ export function clearLocalUserId() { uni.removeStorageSync('userId') console.log('本地用户ID已清除') } + +export function getIsRealName() { + return request({ + url: '/app/user/isReal', + }) +} diff --git a/pages/index/index.vue b/pages/index/index.vue index 9213645..5aae8e6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -59,6 +59,7 @@ import { getNewAnnouncement } from '../../api/article/article.js' import { getBannerList } from '../../api/banner/banner.js' import { getDeviceList } from '../../api/device/device.js' import { renewDevice, getPeriodPackages, getPeriodPackagesByTypeId } from '../../api/lease/lease.js' +import { getIsRealName } from '../../api' export default { components: { @@ -70,6 +71,7 @@ export default { data() { return { // 基础配置 + isRealName: false, indicatorDots: true, autoplay: true, interval: 2000, @@ -105,6 +107,7 @@ export default { this.fetchAnnouncement() this.fetchBannerList() this.fetchDeviceList() + this.goToRealName() }, onShow() { @@ -114,6 +117,25 @@ export default { }, methods: { + async goToRealName() { + const res = await getIsRealName() + if (!res.data) { + uni.showModal({ + title: '提示', + content: '需要租赁,请先实名', + showCancel: true, + confirmText: '去实名', + cancelText: '暂不', + success: function (res) { + if (res.confirm) { + uni.navigateTo({ + url: '/pages/realNameAuthentication/realNameAuthentication', + }) + } + }, + }) + } + }, // 获取最新公告 async fetchAnnouncement() { try {