This commit is contained in:
2025-04-30 16:43:52 +08:00
parent b1bb0e63f5
commit 1a7886450d
14 changed files with 276 additions and 53 deletions

View File

@@ -3,7 +3,7 @@ import {useSystemStore} from "../../pinia/SystemStore/index.js";
import {useUserStore} from "../../pinia/UserStore/index.js";
const SystemStore = useSystemStore();
const {logout} = useUserStore();
const UserStore = useUserStore();
</script>
<template>
@@ -16,11 +16,11 @@ const {logout} = useUserStore();
<a-dropdown>
<a-link
:hoverable="false">
15709267061
{{ UserStore.userInfo.nickname || UserStore.userInfo.mobile }}
<icon-down/>
</a-link>
<template #content>
<a-doption @click="logout">退出登陆</a-doption>
<a-doption @click="UserStore.logout">退出登陆</a-doption>
</template>
</a-dropdown>
</div>

View File

@@ -4,11 +4,15 @@ import {Message, Notification} from "@arco-design/web-vue";
import Api from "../../api/index.js";
const verificationCode = defineModel('verificationCode', {type: String});
const {mobile, api} = defineProps({
const {mobile, api, type} = defineProps({
mobile: {
type: String,
default: null,
},
type: {
type: Number,
default: null,
},
api: {
type: Function,
default: Api.admin.sendSms
@@ -21,7 +25,7 @@ let timer = null;
const verifyPhone = async () => {
if (/^1[3-9]\d{9}$/.test(mobile)) {
if (timer === null) {
const {msg, code} = await api(mobile);
const {msg, code} = await api(mobile, type);
if (code === 1) Message.success(msg);
time.value = 10;
timer = setInterval(() => {

View File

@@ -0,0 +1,31 @@
<script setup>
import Api from "../../api/index.js";
const emits = defineEmits(['success']);
const upload = (e) => {
const file = e.target.files[0];
Api.system.uploadFile2(file).then(({data}) => {
emits('success', data);
});
}
const createInput = () => {
const input = document.createElement('input');
input.type = 'file';
input.onchange = upload;
input.style.display = 'none';
document.body.append(input);
input.click();
}
</script>
<template>
<div @click="createInput">
<slot></slot>
</div>
</template>
<style scoped lang="scss">
</style>