优化 登录

bak
Dragon 1 year ago
parent 34ccab52bd
commit 7c99c24cba

@ -29,7 +29,7 @@ const formRefSure = ref()
const message = useMessage()
const loading = ref(false)
const flag = ref(false)
const flag = ref(true)
const formForget: FormForget = reactive({
agentcode: '三方系统标识8',
loginname: '13311111111',
@ -111,7 +111,6 @@ function handleSure(e) {
formRefSure.value.validate(async (errors) => {
if (!errors) {
const { newPassword, rePasswrod, loginname } = formSure
message.loading('登录中...')
loading.value = true
const params = {
@ -122,7 +121,11 @@ function handleSure(e) {
try {
const res = await updateSUser(params)
console.log(res)
if (res.code === 'OK')
message.success('修改成功')
else
message.error(res.message)
}
finally {
loading.value = false
@ -150,11 +153,13 @@ function computedFormSure() {
return !formSure.newPassword || !formSure.rePasswrod
}
async function sendCode(value) {
if (!flag.value)
return
flag.value = false
const res = await getCode({
phone: 13311111111,
agentcode: '三方系统标识8',
})
console.log(res)
startCount()
}
@ -166,7 +171,7 @@ function startCount() {
if (time === 0) {
clearInterval(timer)
countTime.value = '获取验证码'
flag.value = false
flag.value = true
}
}, 1000)
}

@ -35,6 +35,8 @@ const userStore = useUserStore()
const router = useRouter()
const route = useRoute()
const show = ref(false)
const flag = ref(true)
const formInline: FormState = reactive({
enterprisecode: '三方系统标识8',
username: '13311111111',
@ -181,6 +183,10 @@ function computedForm() {
}
async function sendCode(value) {
if (!flag.value)
return
flag.value = false
const res = await getCode({
phone: 13311111111,
agentcode: '三方系统标识8',
@ -196,7 +202,7 @@ function startCount() {
if (time === 0) {
clearInterval(timer)
countTime.value = '重新获取'
// this.flag = false;
flag.value = true
}
}, 1000)
}

@ -1,43 +1,11 @@
<script lang="ts" setup>
import { reactive, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useMessage } from 'naive-ui'
import captcha from './captcha.vue'
import { ref } from 'vue'
import Login from './components/Login.vue'
import Forget from './components/Forget.vue'
import { PageEnum } from '@/enums/pageEnum'
import { useUserStore } from '@/store/modules/user'
import { ResultEnum } from '@/enums/httpEnum'
import { getFilter, setFilter } from '@/api/home/filter'
import { getConfig } from '@/api/system/user'
import { asideMap } from '@/config/aside'
interface FormState {
enterprisecode?: string
username: string
password: string
captcha: string
}
const formRef = ref()
const message = useMessage()
const loading = ref(false)
const autoLogin = ref(true)
const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME
const userStore = useUserStore()
const router = useRouter()
const route = useRoute()
const show = ref(true)
const showForget = ref(true)
const show = ref(false)
const ifLogin = ref(true)
const formInline: FormState = reactive({
enterprisecode: '三方系统标识8',
username: '13311111111',
password: '123456',
captcha: '',
})
function showLogin() {
show.value = true
}

@ -16,10 +16,9 @@ const state: any = reactive({
detail: {},
})
const { detail } = toRefs(state)
const taskDetailInfo = ref<any>({})
async function getDetail() {
const res = await msgOne({ id: props.id })
console.log(res)
if (!state.detail.readFlag)
clearMsg()

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { reactive, ref, toRefs } from 'vue'
import { format } from 'date-fns'
import { getMessageList, readAllMsg } from '@/api/message/message'
import { getMessageList, readAllMsg, readMsg } from '@/api/message/message'
import iconApproveActive from '@/assets/images/message/approve-active.png'
import iconApprove from '@/assets/images/message/approve.png'
import iconSystemActive from '@/assets/images/message/system-active.png'
@ -69,12 +69,15 @@ function switchTab(type: number) {
}
function goDetail(item) {
if (tab.value === 1) {
if (tab.value === 1)
clearMsgOne(item.id)
}
else {
else
emit('goDetail', item.id)
}
async function clearMsgOne(id) {
const res = await readMsg({ msgid: id })
}
function getMore() {

Loading…
Cancel
Save