mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-04-23 03:24:34 +08:00
修正部分API授权
This commit is contained in:
@@ -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