update
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
31
src/components/upload/UploadSlot.vue
Normal file
31
src/components/upload/UploadSlot.vue
Normal 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>
|
||||
Reference in New Issue
Block a user