feat: 新增退出登录接口,新增全局接口封装,修改登录接口内容

This commit is contained in:
奔跑的面条
2022-05-21 17:31:01 +08:00
parent 92e1ec05d2
commit b6143bc75e
15 changed files with 161 additions and 35 deletions
@@ -45,7 +45,7 @@ export const useDataListInit = () => {
onPositiveCallback: () =>
new Promise(res => setTimeout(() => res(1), 1000)),
promiseResCallback: (e: any) => {
window.$message.success('删除成功')
window['$message'].success('删除成功')
list.value.splice(index, 1)
}
})
@@ -18,7 +18,7 @@
:disabled="item.disabled"
v-for="item in typeList"
:key="item.key"
@click="btnHandle"
@click="btnHandle(item.key)"
>
<component :is="item.title"></component>
<template #icon>
@@ -35,7 +35,7 @@
</template>
<script lang="ts" setup>
import { watch, reactive } from 'vue'
import { watch } from 'vue'
import { icon } from '@/plugins'
import { PageEnum, ChartEnum } from '@/enums/pageEnum'
import { fetchPathByName, routerTurnByPath, renderLang, getUUID } from '@/utils'
@@ -48,7 +48,7 @@ const props = defineProps({
show: Boolean
})
const typeList = reactive([
const typeList = [
{
title: renderLang('project.new_project'),
key: ChartEnum.CHART_HOME_NAME,
@@ -67,7 +67,7 @@ const typeList = reactive([
icon: StoreIcon,
disabled: true
}
])
]
// 解决点击模态层不会触发 @on-after-leave 的问题
watch(props, newValue => {
@@ -83,10 +83,14 @@ const closeHandle = () => {
// 处理按钮点击
const btnHandle = (key: string) => {
closeHandle()
const id = getUUID()
const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href')
routerTurnByPath(path, [id], undefined, true)
switch (key) {
case ChartEnum.CHART_HOME_NAME:
const id = getUUID()
const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href')
routerTurnByPath(path, [id], undefined, true)
closeHandle()
break;
}
}
</script>
<style lang="scss" scoped>