mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-04-22 02:54:28 +08:00
修正部分API授权
This commit is contained in:
@@ -46,7 +46,6 @@ const calcSpan = () => {
|
||||
span.value = 1
|
||||
return
|
||||
}
|
||||
console.log(cols)
|
||||
while (cols > 1) {
|
||||
if (24 % cols === 0) {
|
||||
span.value = 24 / cols
|
||||
|
||||
@@ -90,13 +90,19 @@
|
||||
<div class="qr-code-container">
|
||||
<div class="qr-code-wrapper w-[200px] h-[200px] mx-auto" v-loading="qrcodeLoading">
|
||||
<img :src="wechatLoginQRCode" class="qr-frame" v-if="wechatLoginQRCode" />
|
||||
<div
|
||||
v-else
|
||||
class="w-[200px] h-[200px] flex justify-center items-center text-green-600"
|
||||
>
|
||||
<i class="iconfont icon-wechat !text-3xl"></i>
|
||||
</div>
|
||||
<!-- 二维码过期蒙版 -->
|
||||
<div v-if="qrcodeExpired" class="qr-expired-mask">
|
||||
<div class="expired-content">
|
||||
<i class="iconfont icon-refresh-ccw expired-icon"></i>
|
||||
<p class="expired-text">二维码已过期</p>
|
||||
<button
|
||||
@click="getWechatLoginURL"
|
||||
@click="getWxLoginURL"
|
||||
class="bg-gray-200 text-gray-600 px-2.5 py-1 rounded-md hover:bg-gray-300"
|
||||
>
|
||||
<i class="iconfont icon-refresh text-lg"></i>
|
||||
@@ -443,7 +449,7 @@ onMounted(() => {
|
||||
// 监听登录标签页切换
|
||||
watch(loginActiveName, (newValue) => {
|
||||
if (newValue === 'wechat') {
|
||||
getWechatLoginURL()
|
||||
getWxLoginURL()
|
||||
} else {
|
||||
// 其他登录方式,清除定时器
|
||||
if (pollingTimer.value) {
|
||||
@@ -458,7 +464,7 @@ watch(loginActiveName, (newValue) => {
|
||||
const handleTabClick = (tab) => {
|
||||
// CustomTabs组件传递的是tab对象,包含paneName属性
|
||||
if (tab.paneName === 'wechat') {
|
||||
getWechatLoginURL()
|
||||
getWxLoginURL()
|
||||
} else {
|
||||
// 其他登录方式,清除定时器
|
||||
if (pollingTimer.value) {
|
||||
@@ -479,7 +485,7 @@ const submit = (verifyData) => {
|
||||
}
|
||||
|
||||
// 获取微信登录 URL
|
||||
const getWechatLoginURL = () => {
|
||||
const getWxLoginURL = () => {
|
||||
wechatLoginQRCode.value = ''
|
||||
qrcodeLoading.value = true
|
||||
qrcodeExpired.value = false
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<el-select
|
||||
v-model="roleId"
|
||||
filterable
|
||||
placeholder="角色"
|
||||
placeholder="应用"
|
||||
@change="_newChat"
|
||||
class="role-select"
|
||||
style="width: 150px"
|
||||
@@ -306,7 +306,7 @@
|
||||
</div>
|
||||
<div class="flex-between">
|
||||
<div class="flex little-btns">
|
||||
<span class="tool-item-btn" @click="realtimeChat">
|
||||
<!-- <span class="tool-item-btn" @click="realtimeChat">
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
@@ -316,7 +316,7 @@
|
||||
>
|
||||
<i class="iconfont icon-mic-bold"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</span> -->
|
||||
|
||||
<span class="tool-item-btn">
|
||||
<el-tooltip class="box-item" effect="dark" content="上传附件">
|
||||
@@ -662,7 +662,7 @@ const initData = async () => {
|
||||
// 获取角色列表
|
||||
const roleRes = await httpGet('/api/app/list')
|
||||
roles.value = roleRes.data
|
||||
if (roles.value.length > 0) {
|
||||
if (roles.value.length > 0 && !roleId.value) {
|
||||
roleId.value = roles.value[0].id
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="user-avatar" v-if="isLogin" @click="router.push('profile')">
|
||||
<van-image :src="userAvatar" round width="40" height="40" />
|
||||
</div>
|
||||
<div class="login-btn" v-else @click="router.push('login')">
|
||||
<div class="login-btn" v-else @click="router.push('/login')">
|
||||
<van-button size="small" type="primary" round>登录</van-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="profile-header">
|
||||
<div class="header-bg"></div>
|
||||
<div class="header-content">
|
||||
<div class="user-info" v-if="isLogin">
|
||||
<div class="user-info">
|
||||
<div class="avatar-container">
|
||||
<van-image :src="fileList[0].url" round width="80" height="80" />
|
||||
</div>
|
||||
@@ -15,20 +15,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-prompt" v-else>
|
||||
<button
|
||||
class="py-3 px-5 bg-gradient-to-r from-green-400 to-blue-400 text-white rounded-xl disabled:from-gray-400 disabled:to-gray-400 disabled:cursor-not-allowed hover:from-green-500 hover:to-blue-500 transition-all duration-200 flex items-center justify-center space-x-2"
|
||||
@click="router.push('/login')"
|
||||
>
|
||||
立即登录
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-content">
|
||||
<!-- 快捷操作 -->
|
||||
<div class="quick-actions" v-if="isLogin">
|
||||
<div class="quick-actions">
|
||||
<h3 class="section-title">快捷操作</h3>
|
||||
<van-row :gutter="12">
|
||||
<van-col :span="8">
|
||||
@@ -59,7 +51,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 我的服务 -->
|
||||
<div class="menu-section" v-if="isLogin">
|
||||
<div class="menu-section">
|
||||
<h3 class="section-title">我的服务</h3>
|
||||
<van-cell-group>
|
||||
<van-cell title="绑定邮箱" is-link @click="showBindEmailDialog = true">
|
||||
@@ -91,7 +83,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 退出登录 -->
|
||||
<div class="logout-section" v-if="isLogin">
|
||||
<div class="logout-section">
|
||||
<van-button size="large" block type="danger" plain @click="showLogoutConfirm = true">
|
||||
退出登录
|
||||
</van-button>
|
||||
@@ -206,7 +198,6 @@ import { checkSession, getSystemInfo } from '@/store/cache'
|
||||
import { removeUserToken } from '@/store/session'
|
||||
import { useSharedStore } from '@/store/sharedata'
|
||||
import { httpGet, httpPost } from '@/utils/http'
|
||||
import { showLoginDialog } from '@/utils/libs'
|
||||
import { showFailToast, showLoadingToast, showSuccessToast } from 'vant'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -229,7 +220,6 @@ const fileList = ref([
|
||||
])
|
||||
|
||||
const router = useRouter()
|
||||
const isLogin = ref(false)
|
||||
const showSettings = ref(false)
|
||||
const showPasswordDialog = ref(false)
|
||||
const showBindEmailDialog = ref(false)
|
||||
@@ -272,7 +262,6 @@ onMounted(() => {
|
||||
|
||||
checkSession()
|
||||
.then((user) => {
|
||||
isLogin.value = true
|
||||
form.value = { ...form.value, ...user }
|
||||
fileList.value[0].url = user.avatar || '/images/avatar/default.jpg'
|
||||
|
||||
@@ -280,7 +269,7 @@ onMounted(() => {
|
||||
fetchUserProfile()
|
||||
})
|
||||
.catch(() => {
|
||||
isLogin.value = false
|
||||
router.push('/login')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -356,9 +345,8 @@ const logout = function () {
|
||||
.then(() => {
|
||||
removeUserToken()
|
||||
store.setIsLogin(false)
|
||||
isLogin.value = false
|
||||
showSuccessToast('退出登录成功')
|
||||
showLogoutConfirm.value = false
|
||||
router.push('/login')
|
||||
|
||||
// 清除用户数据
|
||||
form.value = {
|
||||
|
||||
Reference in New Issue
Block a user