|
|
@@ -3,17 +3,19 @@
|
|
|
<Breadcrumb />
|
|
|
<div class="personal-head">
|
|
|
<div class="personal-head-left">
|
|
|
- <el-avatar :size="100" :src="appStore.avatarDefault" />
|
|
|
+ <el-avatar :size="100" :src="appStore.userInfo.userAvatar ? appStore.userInfo.userAvatar : appStore.avatarDefault" />
|
|
|
<div class="personal-user-info">
|
|
|
<div class="personal-username">
|
|
|
<div class="">{{ appStore.userInfo.nickName }}</div>
|
|
|
- <img src="/src/assets/imgs/my/vip@2x.png" alt="">
|
|
|
+ <template v-if="['0', '1', '2'].includes(appStore.userInfo.memberType)"></template>
|
|
|
+ <img :src="`/src/assets/imgs/my/vip${appStore.userInfo.memberType}@2x.png`" alt="">
|
|
|
<!-- memberType 会员类型memberType 会员类型分为企业会员(2)和个人会员(1)、免费会员(0) -->
|
|
|
</div>
|
|
|
<div class="personal-user-phone mt4">{{ $t('personalCenter.phoneNumber') }}:{{ appStore.userInfo.userPhone }}
|
|
|
</div>
|
|
|
- <div class="gap10 mt4" v-if="appStore.userInfo.skillTags">
|
|
|
- <el-button type="primary" size="large" plain>{{ appStore.userInfo.skillTags }}</el-button>
|
|
|
+ <div class="">{{ $t('personalCenter.vipEndTime') }}: {{ appStore.userInfo.memberExpire }}</div>
|
|
|
+ <div class="mt4" v-if="appStore.userInfo.skillTags">
|
|
|
+ <el-button v-for="(item,index) in appStore.userInfo.skillTags.split(',')" type="primary" plain>{{ item }}</el-button>
|
|
|
</div>
|
|
|
<div class="personal-user-list">
|
|
|
<div class="personal-user-li">
|
|
|
@@ -27,7 +29,7 @@
|
|
|
</div>
|
|
|
<div class="personal-user-line"></div>
|
|
|
<div class="personal-user-li">
|
|
|
- <span>0</span>
|
|
|
+ <span>{{ collectCount }}</span>
|
|
|
<span>{{ $t('common.collect') }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -75,54 +77,72 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="上传头像">
|
|
|
<!-- 图片类型 -->
|
|
|
- <FileUploader
|
|
|
- ref="fileUploader"
|
|
|
- accept="image/*"
|
|
|
- :multiple="false"
|
|
|
- :limit="1"
|
|
|
- :auto-upload="true"
|
|
|
- list-type="picture-card"
|
|
|
- :data="{ directory: 'workflow' }"
|
|
|
- buttonText=""
|
|
|
- v-model="coverImage"
|
|
|
- tip=""
|
|
|
- />
|
|
|
+ <FileUploader ref="fileUploader" accept="image/*" :multiple="false" :limit="1" :auto-upload="true"
|
|
|
+ list-type="picture-card" :data="{ directory: 'workflow' }" buttonText="" v-model="coverImage" tip="" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="昵称">
|
|
|
- <el-input v-model="userInfo.nickName" />
|
|
|
+ <el-input v-model="userInfo.nickName" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
+ :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="联系电话">
|
|
|
- <el-input v-model="userInfo.userPhone" />
|
|
|
+ <el-form-item label="登录手机号">
|
|
|
+ <el-input :readonly="userInfo.userPhone ? true : false" v-model="userInfo.userPhone"
|
|
|
+ :placeholder="$t('common.placeholderInput')" class="inputStyle" :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="n8n账号">
|
|
|
- <el-input v-model="userInfo.name" />
|
|
|
+ <el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
+ :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="Coze账号">
|
|
|
- <el-input v-model="userInfo.name" />
|
|
|
+ <el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
+ :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="Dify账号">
|
|
|
- <el-input v-model="userInfo.name" />
|
|
|
+ <el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
+ :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="FastGpt账号">
|
|
|
- <el-input v-model="userInfo.name" />
|
|
|
+ <el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
+ :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="16">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="登录邮箱">
|
|
|
+ <el-input v-model="userInfo.name" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
+ :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -134,9 +154,12 @@
|
|
|
{{ tag }}
|
|
|
</el-tag>
|
|
|
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"
|
|
|
- @keyup.enter="handleInputConfirm" @blur="handleInputConfirm" />
|
|
|
+ @keyup.enter="handleInputConfirm" @blur="handleInputConfirm" maxlength="5">
|
|
|
+ <template #append>
|
|
|
+ <el-button :icon="Plus" />
|
|
|
+ </template></el-input>
|
|
|
<el-button v-else class="button-new-tag" size="small" @click="showInput">
|
|
|
- + New Tag
|
|
|
+ + {{ $t('common.addTags') }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
@@ -146,7 +169,7 @@
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer flex-center">
|
|
|
<el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
- <el-button class="gradient" type="primary" @click="dialogVisible = false">
|
|
|
+ <el-button class="gradient" type="primary" @click="handleConfirm">
|
|
|
{{ $t('common.confirm') }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -157,6 +180,8 @@
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
+import { Plus } from '@element-plus/icons-vue'
|
|
|
+
|
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
|
|
|
|
import { ref, onMounted, computed, nextTick } from 'vue';
|
|
|
@@ -166,9 +191,9 @@ import type { InputInstance } from 'element-plus'
|
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
-import { getUserInfo } from '@/api/auth.js'
|
|
|
+import { getUserInfo,updateUserInfo } from '@/api/auth.js'
|
|
|
|
|
|
-import { checkIn } from '@/api/my.js'
|
|
|
+import { checkIn, queryCollectCount } from '@/api/my.js'
|
|
|
|
|
|
import DGTMessage from '@/utils/message'
|
|
|
|
|
|
@@ -265,7 +290,22 @@ const navIndex = computed(() => {
|
|
|
|
|
|
const userInfo = ref({})//用户信息
|
|
|
|
|
|
-const images = ref([]);
|
|
|
+const coverImage = ref([]);
|
|
|
+
|
|
|
+// 更新用户信息
|
|
|
+const handleConfirm = async () =>{
|
|
|
+ let res = await updateUserInfo({
|
|
|
+ nickName: userInfo.value.nickName,
|
|
|
+ userAvatar:coverImage.value.map(item => item.url).join(';'),
|
|
|
+ skillTags:dynamicTags.value.join(','),
|
|
|
+ userPhone:userInfo.value.userPhone,
|
|
|
+ })
|
|
|
+ if (res.code === 200) {
|
|
|
+ appStore.USERINFO();
|
|
|
+ DGTMessage.success(`${t('common.modify')}${t('common.success')}`)
|
|
|
+ dialogVisible.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
const toPath = (item: any, index: number) => {
|
|
|
if (item.path) {
|
|
|
@@ -283,9 +323,16 @@ const signIn = async () => {
|
|
|
// 获取用户信息
|
|
|
const getInfo = async () => {
|
|
|
let res = await getUserInfo();
|
|
|
+ if (res.user.userAvatar) {
|
|
|
+ coverImage.value = [{url:res.user.userAvatar}]
|
|
|
+ }
|
|
|
+ if (res.user.skillTags) {
|
|
|
+ dynamicTags.value = res.user.skillTags.split(',')
|
|
|
+ }
|
|
|
userInfo.value = res.user;
|
|
|
}
|
|
|
|
|
|
+const collectCount = ref(0)
|
|
|
|
|
|
const inputValue = ref('')
|
|
|
|
|
|
@@ -314,8 +361,14 @@ const handleInputConfirm = () => {
|
|
|
inputValue.value = ''
|
|
|
}
|
|
|
|
|
|
+const getCount = async () => {
|
|
|
+ let res = await queryCollectCount();
|
|
|
+ collectCount.value = res.data.collectCount;
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getInfo()
|
|
|
+ getCount()
|
|
|
})
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -352,7 +405,7 @@ div {
|
|
|
color: #333333;
|
|
|
|
|
|
img {
|
|
|
- width: 51px;
|
|
|
+ width: 68px;
|
|
|
height: 21px;
|
|
|
margin-left: 8px;
|
|
|
}
|
|
|
@@ -499,8 +552,20 @@ div {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.tags {
|
|
|
flex-wrap: wrap;
|
|
|
gap: 16px;
|
|
|
}
|
|
|
+
|
|
|
+.inputStyle {
|
|
|
+ width: 368px;
|
|
|
+ height: 36px;
|
|
|
+ background: #F5F7FA;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #F2F6FC;
|
|
|
+ ::v-deep .el-input__wrapper {
|
|
|
+ background-color: transparent;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|