|
|
@@ -130,10 +130,11 @@
|
|
|
<el-collapse v-model="workName" accordion>
|
|
|
<el-collapse-item :title="item.issueTitle || `${index + 1}、${item.question}`" :name="item.id"
|
|
|
v-for="(item, index) in workList" :key="index">
|
|
|
- <template #title >
|
|
|
+ <template #title>
|
|
|
<div class="work-head">
|
|
|
<img v-if="activeName == 2" src="/src/assets/imgs/my/Q@2x.png" alt="">
|
|
|
- <div class="">{{ `${ activeName == 2 ? (index + 1) + '、' : '' }` }}{{ item.issueTitle || item.question }}</div>
|
|
|
+ <div class="">{{ `${activeName == 2 ? (index + 1) + '、' : ''}` }}{{ item.issueTitle ||
|
|
|
+ item.question }}</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="work-content">
|
|
|
@@ -155,7 +156,7 @@
|
|
|
<div class="dialog-footer flex-center">
|
|
|
<el-button @click="resetForm">{{ $t('common.cancel') }}</el-button>
|
|
|
<el-button class="gradient" type="primary" @click="submitForm(ruleFormRef)">{{ $t('common.confirm')
|
|
|
- }}</el-button>
|
|
|
+ }}</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
@@ -183,6 +184,9 @@
|
|
|
}" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="16">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="登录手机号">
|
|
|
<el-input :disabled="userInfo.userPhone ? true : false" v-model="userInfo.userPhone"
|
|
|
@@ -191,25 +195,40 @@
|
|
|
}" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12" v-if="!appStore?.userInfo?.userPhone">
|
|
|
+ <el-form-item label="验证码" prop="verifyCode">
|
|
|
+ <el-input v-model="userInfo.verifyCode" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
+ :input-style="{
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ }">
|
|
|
+ <template #append>
|
|
|
+ <el-button :disabled="smsCountdown > 0" @click="sendSmsCode" style="width:120px" maxlength="6"
|
|
|
+ :class="{ 'countdown-btn': smsCountdown > 0 }" size="small">
|
|
|
+ {{ smsCountdown > 0 ? `${smsCountdown}s` : $t('login.sendCaptcha') }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </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"
|
|
|
+ <el-input v-model="userInfo.email" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
}" />
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="12" v-if="!appStore?.userInfo?.email">
|
|
|
<el-form-item label="验证码" prop="verifyCode">
|
|
|
<el-input v-model="userInfo.verifyCode" :placeholder="$t('common.placeholderInput')" class="inputStyle"
|
|
|
:input-style="{
|
|
|
backgroundColor: 'transparent',
|
|
|
}">
|
|
|
<template #append>
|
|
|
- <el-button type="primary" :disabled="smsCountdown > 0" @click="sendSmsCode" style="width:140px"
|
|
|
+ <el-button :disabled="smsCountdown > 0" @click="sendSmsCode" style="width:120px" maxlength="6"
|
|
|
:class="{ 'countdown-btn': smsCountdown > 0 }" size="small">
|
|
|
{{ smsCountdown > 0 ? `${smsCountdown}s` : $t('login.sendCaptcha') }}
|
|
|
</el-button>
|
|
|
@@ -226,7 +245,10 @@
|
|
|
backgroundColor: 'transparent',
|
|
|
}">
|
|
|
<template #append>
|
|
|
- <el-button :icon="Refresh" />
|
|
|
+ <el-tooltip class="box-item" effect="dark" content="同步生成n8n账号" placement="top">
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -249,7 +271,10 @@
|
|
|
backgroundColor: 'transparent',
|
|
|
}">
|
|
|
<template #append>
|
|
|
- <el-button :icon="Refresh" />
|
|
|
+ <el-tooltip class="box-item" effect="dark" content="同步生成Coze账号" placement="top">
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -272,7 +297,10 @@
|
|
|
backgroundColor: 'transparent',
|
|
|
}">
|
|
|
<template #append>
|
|
|
- <el-button :icon="Refresh" />
|
|
|
+ <el-tooltip class="box-item" effect="dark" content="同步生成Dify账号" placement="top">
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -295,7 +323,10 @@
|
|
|
backgroundColor: 'transparent',
|
|
|
}">
|
|
|
<template #append>
|
|
|
- <el-button :icon="Refresh" />
|
|
|
+ <el-tooltip class="box-item" effect="dark" content="同步生成FastGpt账号" placement="top">
|
|
|
+ <el-button :icon="Refresh" />
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -355,7 +386,7 @@ import type { InputInstance } from 'element-plus'
|
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
-import { getUserInfo, updateUserInfo } from '@/api/auth.js'
|
|
|
+import { getUserInfo, updateUserInfo,getSmsCode,getEmailCode } from '@/api/auth.js'
|
|
|
|
|
|
import { checkIn, queryCollectCount, issue, issueList, faqList, getfaq } from '@/api/my.js'
|
|
|
|
|
|
@@ -562,27 +593,39 @@ const smsCountdown = ref(0)
|
|
|
const passwordresetCountdown = ref(0)
|
|
|
const emailCountdown = ref(0)
|
|
|
|
|
|
+// 正则表达式
|
|
|
+const PHONE_REGEX = /^1[3-9]\d{9}$/;
|
|
|
+const EMAIL_REGEX = /^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+$/;
|
|
|
+const isPasswordPhone = computed(() => {
|
|
|
+ return PHONE_REGEX.test(passwordForm.account);
|
|
|
+});
|
|
|
+
|
|
|
+const isPasswordEmail = computed(() => {
|
|
|
+ return EMAIL_REGEX.test(passwordForm.account);
|
|
|
+});
|
|
|
+
|
|
|
// 发送短信验证码
|
|
|
const sendSmsCode = async () => {
|
|
|
- if (!smsForm.account) {
|
|
|
- ElMessage.warning('请先输入手机号或邮箱')
|
|
|
+ let account = appStore?.userInfo?.userPhone ? userInfo.value.email : userInfo.value.userPhone
|
|
|
+ if (!account) {
|
|
|
+ DGTMessage.warning('请先输入手机号或邮箱')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 验证手机号格式
|
|
|
- if (!PHONE_REGEX.test(smsForm.account) && !EMAIL_REGEX.test(smsForm.account)) {
|
|
|
- ElMessage.warning('请输入正确的手机号或邮箱')
|
|
|
+ // 验证手机号格式
|
|
|
+ if (!PHONE_REGEX.test(account) && !EMAIL_REGEX.test(account)) {
|
|
|
+ DGTMessage.warning('请输入正确的手机号或邮箱')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
let res = null;
|
|
|
- if (PHONE_REGEX.test(smsForm.account)) {
|
|
|
+ if (PHONE_REGEX.test(account)) {
|
|
|
res = await getSmsCode({
|
|
|
- phone: smsForm.account
|
|
|
+ phone: account
|
|
|
})
|
|
|
- } else if (EMAIL_REGEX.test(smsForm.account)) {
|
|
|
+ } else if (EMAIL_REGEX.test(account)) {
|
|
|
res = await getEmailCode({
|
|
|
- email: smsForm.account
|
|
|
+ email: account
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -591,7 +634,7 @@ const sendSmsCode = async () => {
|
|
|
}
|
|
|
|
|
|
// 模拟发送验证码
|
|
|
- ElMessage.success('验证码发送成功')
|
|
|
+ DGTMessage.success('验证码发送成功')
|
|
|
|
|
|
// 开始倒计时
|
|
|
smsCountdown.value = 60
|
|
|
@@ -646,11 +689,18 @@ const submitForm = async (formEl) => {
|
|
|
|
|
|
// 更新用户信息
|
|
|
const handleConfirm = async () => {
|
|
|
+
|
|
|
+
|
|
|
+ // bindType verifyCode
|
|
|
+ if (!appStore.userInfo.userPhone || !appStore.userInfo.email) {
|
|
|
+ userInfo.value.bindType = appStore.userInfo.userPhone ? 'email' : 'phone'
|
|
|
+ }
|
|
|
+ let obj = !appStore.userInfo.userPhone || !appStore.userInfo.email ? {email:userInfo.value.email,bindType:userInfo.value.bindType,userPhone: userInfo.value.userPhone} : {}
|
|
|
let res = await updateUserInfo({
|
|
|
nickName: userInfo.value.nickName,
|
|
|
userAvatar: coverImage.value.map(item => item.url).join(';'),
|
|
|
skillTags: dynamicTags.value.join(','),
|
|
|
- userPhone: userInfo.value.userPhone,
|
|
|
+ ...obj
|
|
|
})
|
|
|
if (res.code === 200) {
|
|
|
appStore.USERINFO();
|
|
|
@@ -946,7 +996,7 @@ div {
|
|
|
border: 1px solid #F2F6FC;
|
|
|
|
|
|
:deep(.el-input__wrapper) {
|
|
|
- background-color: transparent;
|
|
|
+ // background-color: transparent;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -972,18 +1022,21 @@ div {
|
|
|
height: 24px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.work-head {
|
|
|
display: flex;
|
|
|
color: #333333;
|
|
|
font-size: 18px;
|
|
|
font-weight: bold;
|
|
|
align-items: center;
|
|
|
+
|
|
|
img {
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
margin-right: 8px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.work-content {
|
|
|
padding: 16px;
|
|
|
background: #F5F7FA;
|
|
|
@@ -992,6 +1045,7 @@ div {
|
|
|
line-height: 24px;
|
|
|
font-size: 16px;
|
|
|
display: flex;
|
|
|
+
|
|
|
img {
|
|
|
width: 24px;
|
|
|
height: 24px;
|