-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
180 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,17 @@ const userInfo = { | |
power: 'admin', | ||
}; | ||
|
||
const userInfo2 = { | ||
name: 'test', | ||
userid: '00000002', | ||
email: '[email protected]', | ||
signature: '小啊小啊浪', | ||
introduction: '一个只会喝蜂蜜绿的小前端', | ||
title: '咪咪咪', | ||
token: '', | ||
power: 'test', | ||
}; | ||
|
||
export default [ | ||
{ | ||
url: '/mock_api/login', | ||
|
@@ -25,9 +36,16 @@ export default [ | |
code: 1, | ||
message: 'ok', | ||
}; | ||
} else if (username == 'test' && password == 'test123') { | ||
userInfo2.token = genID(16); | ||
return { | ||
data: userInfo2, | ||
code: 1, | ||
message: 'ok', | ||
}; | ||
} else { | ||
return { | ||
data: userInfo, | ||
data: null, | ||
code: -1, | ||
message: '账号密码错误', | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<div class="account"> | ||
<el-dropdown trigger="click" @command="command"> | ||
<img src="@/assets/login/logo.png" class="wave" /> | ||
<template #dropdown> | ||
<el-dropdown-menu> | ||
<el-dropdown-item command="signOut">退出登录</el-dropdown-item> | ||
</el-dropdown-menu> | ||
</template> | ||
</el-dropdown> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useRouter } from 'vue-router'; | ||
const router = useRouter(); | ||
const command = (value: string) => { | ||
console.log(value); | ||
if (value === 'signOut') { | ||
localStorage.removeItem('userInfo'); | ||
router.push('/login'); | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.account { | ||
margin-left: 12px; | ||
.wave { | ||
width: 30px; | ||
height: 30px; | ||
border-radius: 50%; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { withInstall } from '@/utils'; | ||
import appLocale from './AppLocale.vue'; | ||
import appTheme from './AppTheme.vue'; | ||
import appAccount from './AppAccount.vue'; | ||
|
||
export const AppLocale = withInstall(appLocale); | ||
export const AppTheme = withInstall(appTheme); | ||
export const AppAccount = withInstall(appAccount); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.