Skip to content

Commit

Permalink
feat: 更新 package.json 以使用 pnpm 作为包管理器,优化登录组件和用户地图功能
Browse files Browse the repository at this point in the history
  • Loading branch information
IceyWu committed Dec 8, 2024
1 parent bc0f713 commit d9976f1
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 33 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "lp",
"type": "module",
"version": "0.0.12",
"packageManager": "[email protected]",
"description": "Record your memories and craft your own masterpiece of life",
"author": "IceyWu <https://github.com/IceyWu/>",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Login/LoginForm.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ElMessage } from 'element-plus'
import { useRequest, useResettaleRef } from 'vue-hooks-pure'
import { useResettaleRef } from 'vue-hooks-pure'
import { register, resetPassword, sendCode } from '~/api/admin'
import { useUserStore } from '~/stores/user'
import { requestTo } from '~/utils/http/tool'
Expand Down
47 changes: 26 additions & 21 deletions src/components/Login/Loginabout.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<script setup lang="ts">
import { requestTo } from '@/utils/http/tool'
import { isObject, removeEmptyValues } from '@iceywu/utils'
import { c } from 'node_modules/vite/dist/node/types.d-aGj9QkWt';
import { updateUserInfo } from '~/api/admin'
import { useUserStore } from '~/stores/user'
import { requestTo } from '@/utils/http/tool'
const emit = defineEmits(['close', 'ok'])
const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore)
Expand Down Expand Up @@ -93,7 +92,7 @@ async function updateUserInfoFunc(fileMd5: string) {
// params['avatarFileMd5'] = fileMd5
// }
params[editTarget.value] = fileMd5
console.log('🐳-----params---77--', params);
console.log('🐳-----params---77--', params)
// return
const { code, msg, result } = ({} = await updateUserInfo(params).catch(
(err) => {
Expand All @@ -109,28 +108,29 @@ async function updateUserInfoFunc(fileMd5: string) {
}
updateLoading.value = false
}
const emit = defineEmits(['close', "ok"])
const handleCancel = () => {
console.log('💗handleCancel---------->');
function handleCancel() {
console.log('💗handleCancel---------->')
emit('close')
};
const handleOk = async () => {
}
async function handleOk() {
const params = removeEmptyValues(formData.value)
console.log('🎁-----formData.value-----', formData.value);
console.log('🎁-----formData.value-----', formData.value)
const [err, data] = await requestTo(updateUserInfo(params))
if (!err) {
console.log('🎉-----data-----', data);
console.log('🎉-----data-----', data)
userStore.setUserInfo(data)
// handleCancel()
// emit('close')
emit('close')
}
};
}
</script>

<template>
<clipperDialog ref="clipperRef" :type="clipperData.type" :allow-type-list="clipperData.allowTypeList"
:limit-size="clipperData.limitSize" :preview-width="clipperData.previewWidth" @confirm="onConfirm" />
<clipperDialog
ref="clipperRef" :type="clipperData.type" :allow-type-list="clipperData.allowTypeList"
:limit-size="clipperData.limitSize" :preview-width="clipperData.previewWidth" @confirm="onConfirm"
/>

<div class="dialog-content">
<div class="dialog-title">编辑资料</div>
Expand All @@ -153,17 +153,22 @@ const handleOk = async () => {
<div class="Cancel dialog-btn" @click="handleCancel">取消</div>
<!-- <div class="Confirm dialog-btn" @click="handleOk">保存</div> -->
<button
class="relative flex items-center px-13 py-1 overflow-hidden font-medium transition-all rounded-md group bg-gradient-to-br from-[#ffddef] via-[#faf0eb] to-[#f6fde7]">
class="relative flex items-center px-13 py-1 overflow-hidden font-medium transition-all rounded-md group bg-gradient-to-br from-[#ffddef] via-[#faf0eb] to-[#f6fde7]"
>
<span
class="absolute top-0 right-0 inline-block w-4 h-4 transition-all duration-500 ease-in-out rounded group-hover:-mr-4 group-hover:-mt-4 bg-gradient-to-br from-[#ffddef] via-[#faf0eb] to-[#f6fde7]">
<span class="absolute top-0 right-0 w-5 h-5 rotate-45 translate-x-1/2 -translate-y-1/2 bg-white"></span>
class="absolute top-0 right-0 inline-block w-4 h-4 transition-all duration-500 ease-in-out rounded group-hover:-mr-4 group-hover:-mt-4 bg-gradient-to-br from-[#ffddef] via-[#faf0eb] to-[#f6fde7]"
>
<span class="absolute top-0 right-0 w-5 h-5 rotate-45 translate-x-1/2 -translate-y-1/2 bg-white" />
</span>
<span
class="absolute bottom-0 rotate-180 left-0 inline-block w-4 h-4 transition-all duration-500 ease-in-out rounded group-hover:-ml-4 group-hover:-mb-4 bg-gradient-to-br from-[#ffddef] via-[#faf0eb] to-[#f6fde7]">
<span class="absolute top-0 right-0 w-5 h-5 rotate-45 translate-x-1/2 -translate-y-1/2 bg-white"></span>
class="absolute bottom-0 rotate-180 left-0 inline-block w-4 h-4 transition-all duration-500 ease-in-out rounded group-hover:-ml-4 group-hover:-mb-4 bg-gradient-to-br from-[#ffddef] via-[#faf0eb] to-[#f6fde7]"
>
<span class="absolute top-0 right-0 w-5 h-5 rotate-45 translate-x-1/2 -translate-y-1/2 bg-white" />
</span>
<span @click="handleOk"
class="relative w-full text-left text-[#e990ba] transition-colors duration-200 ease-in-out group-hover:text-[#d67ca4]">
<span
class="relative w-full text-left text-[#e990ba] transition-colors duration-200 ease-in-out group-hover:text-[#d67ca4]"
@click="handleOk"
>
保存
</span>
</button>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ function clickTab(item, index) {
<template>
<div class="slider">
<div class="slider__list">
<div v-for="(item, index) in showTabList" :key="index" class="slider__item" :class="[
<div
v-for="(item, index) in showTabList" :key="index" class="slider__item" :class="[
isDark ? 'slider__item-dark' : '',
index === chooseIndex ? 'bg-[#f8f8f8] dark:bg-[#333]' : ' ',
]" @click="clickTab(item, index)">
]" @click="clickTab(item, index)"
>
<router-link :to="item.path" class="slider__link" :class="isDark ? 'slider__link-dark' : ''">
<div class="slider__icon" :class="item.icon">
🐇
Expand Down
5 changes: 1 addition & 4 deletions src/pages/mine/components/UserMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ async function getData() {
// }
// if (err)
// getDataLoading.value = false
// const res = (await requestTo(topicFindAll(params)))[1] || {}
const [err,res] = (await requestTo(topicFindAll(params)))
console.log('🌳-----res-----', res);
console.log('🐬-----err-----', err);
const res = (await requestTo(topicFindAll(params)))[1] || {}
dataList.value = res.data || []
getImgsInfo()
Expand Down
14 changes: 9 additions & 5 deletions src/pages/mine/indexs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import Loginabout from '@/components/Login/Loginabout.vue'
import { isObject } from '@iceywu/utils'
import { ElMessage } from 'element-plus'
import { usePopup } from 'vue-hooks-pure'
import { getMyInfo, updateUserInfo } from '~/api/admin'
import { useUserStore } from '~/stores/user'
import { usePopup } from 'vue-hooks-pure';
import UserBottom from './components/UserBottom.vue'
Expand Down Expand Up @@ -119,8 +119,10 @@ onMounted(() => {

<template>
<!-- 更换背景 -->
<clipperDialog ref="clipperRef" :type="clipperData.type" :allow-type-list="clipperData.allowTypeList"
:limit-size="clipperData.limitSize" :preview-width="clipperData.previewWidth" @confirm="onConfirm" />
<clipperDialog
ref="clipperRef" :type="clipperData.type" :allow-type-list="clipperData.allowTypeList"
:limit-size="clipperData.limitSize" :preview-width="clipperData.previewWidth" @confirm="onConfirm"
/>
<!-- 编辑个人信息 -->
<!-- <Loginabout v-if="true" v-model="isShowDialog" /> -->
<div class="Personal-Center h-full w-full">
Expand All @@ -146,10 +148,12 @@ onMounted(() => {
</div>
</div>
</div>
<div class="backgrImg" :style="{
<div
class="backgrImg" :style="{
backgroundImage: `url('${userBackground}')`,
backgroundSize: 'cover',
}" @click="openUpload">
}" @click="openUpload"
>
<div class="top_Gradient" />
<div class="right_Gradient" />
<div class="left_Gradient" />
Expand Down

0 comments on commit d9976f1

Please sign in to comment.