refactor: 更换 ESLint 配置为 @antfu/eslint-config

This commit is contained in:
2024-05-10 22:29:45 +08:00
parent 5101dd12d9
commit bfc8e42bad
148 changed files with 7314 additions and 5046 deletions

View File

@@ -19,8 +19,8 @@
<script setup lang="ts">
// import { getSmsCaptcha, getEmailCaptcha, updateUserEmail, updateUserPhone } from '@/apis'
import { updateUserPassword } from '@/apis'
import { Message } from '@arco-design/web-vue'
import { updateUserPassword } from '@/apis'
import { encryptByRsa } from '@/utils/encrypt'
import { useUserStore } from '@/stores'
import { type Columns, GiForm } from '@/components/GiForm'
@@ -117,13 +117,6 @@ const { form, resetForm } = useForm({
rePassword: ''
})
// 重置
const reset = () => {
formRef.value?.formRef?.resetFields()
resetForm()
resetCaptcha()
}
const captchaTimer = ref()
const captchaTime = ref(60)
const captchaBtnName = ref('获取验证码')
@@ -136,6 +129,13 @@ const resetCaptcha = () => {
captchaDisable.value = false
}
// 重置
const reset = () => {
formRef.value?.formRef?.resetFields()
resetForm()
resetCaptcha()
}
const captchaLoading = ref(false)
// 获取验证码
const onCaptcha = async () => {

View File

@@ -95,10 +95,10 @@
</template>
<script setup lang="ts">
import { uploadAvatar } from '@/apis'
import BasicInfoUpdateModal from './BasicInfoUpdateModal.vue'
import { Message, type FileItem } from '@arco-design/web-vue'
import { type FileItem, Message } from '@arco-design/web-vue'
import { VueCropper } from 'vue-cropper'
import BasicInfoUpdateModal from './BasicInfoUpdateModal.vue'
import { uploadAvatar } from '@/apis'
import 'vue-cropper/dist/index.css'
import { useUserStore } from '@/stores'
import getAvatar from '@/utils/avatar'

View File

@@ -5,9 +5,9 @@
</template>
<script setup lang="ts">
import { updateUserBaseInfo } from '@/apis'
import { Message } from '@arco-design/web-vue'
import { GiForm, type Columns } from '@/components/GiForm'
import { updateUserBaseInfo } from '@/apis'
import { type Columns, GiForm } from '@/components/GiForm'
import { useForm } from '@/hooks'
import { useUserStore } from '@/stores'

View File

@@ -19,7 +19,7 @@
</div>
<div class="btn-wrapper">
<a-button
v-if="item.jumpMode == 'modal'"
v-if="item.jumpMode === 'modal'"
class="btn"
:type="item.status ? 'secondary' : 'primary'"
@click="onUpdate(item.type, item.status)"
@@ -35,9 +35,9 @@
</template>
<script lang="ts" setup>
import { listOption, type OptionResp, type SecurityConfigResp } from '@/apis'
import type { ModeItem } from '../type'
import VerifyModel from '../components/VerifyModel.vue'
import { type OptionResp, type SecurityConfigResp, listOption } from '@/apis'
import { useUserStore } from '@/stores'
const userStore = useUserStore()
@@ -48,7 +48,7 @@ modeList.value = [
{
title: '安全手机',
icon: 'phone-color',
value: `${userInfo.value.phone + ' ' || '手机号'}`,
value: `${`${userInfo.value.phone} ` || '手机号'}`,
subtitle: `可用于身份验证、密码找回、通知接收`,
type: 'phone',
jumpMode: 'modal',
@@ -58,7 +58,7 @@ modeList.value = [
{
title: '安全邮箱',
icon: 'email-color',
value: `${userInfo.value.email + ' ' || '邮箱'}`,
value: `${`${userInfo.value.email} ` || '邮箱'}`,
subtitle: `可用于身份验证、密码找回、通知接收`,
type: 'email',
jumpMode: 'modal',
@@ -96,7 +96,7 @@ const securityConfig = ref<SecurityConfigResp>({
const getDataList = async () => {
const { data } = await listOption({ code: Object.keys(securityConfig.value) })
securityConfig.value = data.reduce((obj: SecurityConfigResp, option: OptionResp) => {
obj[option.code] = { ...option, value: parseInt(option.value) }
obj[option.code] = { ...option, value: Number.parseInt(option.value) }
return obj
}, {})
}

View File

@@ -21,7 +21,7 @@
</div>
<div class="btn-wrapper">
<a-button
v-if="item.jumpMode == 'modal'"
v-if="item.jumpMode === 'modal'"
class="btn"
:type="item.status ? 'secondary' : 'primary'"
@click="onUpdate(item.type, item.status)"
@@ -29,7 +29,7 @@
{{ item.status ? '修改' : '绑定' }}
</a-button>
<a-button
v-else-if="item.jumpMode == 'link'"
v-else-if="item.jumpMode === 'link'"
class="btn"
:type="item.status ? 'secondary' : 'primary'"
@click="onBinding(item.type, item.status)"
@@ -44,13 +44,12 @@
</template>
<script setup lang="ts">
import { socialAuth, listUserSocial, unbindSocialAccount } from '@/apis'
import type { ModeItem } from '../type'
import VerifyModel from '../components/VerifyModel.vue'
import { listUserSocial, socialAuth, unbindSocialAccount } from '@/apis'
import { useUserStore } from '@/stores'
const userStore = useUserStore()
const userInfo = computed(() => userStore.userInfo)
const socialList = ref<any>([])
const modeList = ref<ModeItem[]>([])
@@ -58,18 +57,18 @@ modeList.value = [
{
title: '绑定 Gitee',
icon: 'gitee',
subtitle: `${socialList.value.some((el) => el == 'gitee') ? '' : '绑定后,'}可通过 Gitee 进行登录`,
subtitle: `${socialList.value.includes('gitee') ? '' : '绑定后,'}可通过 Gitee 进行登录`,
jumpMode: 'link',
type: 'gitee',
status: socialList.value.some((el) => el == 'gitee')
status: socialList.value.includes('gitee')
},
{
title: '绑定 GitHub',
icon: 'github',
subtitle: `${socialList.value.some((el) => el == 'gitee') ? '' : '绑定后,'}可通过 GitHub 进行登录`,
subtitle: `${socialList.value.includes('gitee') ? '' : '绑定后,'}可通过 GitHub 进行登录`,
type: 'github',
jumpMode: 'link',
status: socialList.value.some((el) => el == 'github')
status: socialList.value.includes('github')
}
]
@@ -81,7 +80,7 @@ const onBinding = (type: string, status: boolean) => {
})
} else {
unbindSocialAccount(type).then((res) => {
if (res.code == 200) {
if (res.code === 200) {
userStore.getInfo()
}
})