diff --git a/.idea/vcs.xml b/.idea/vcs.xml index a57048e..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,5 @@ - \ No newline at end of file diff --git a/README.md b/README.md index b3d5ead..49837ea 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,10 @@ npm run preview Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. - ## 项目相关资料 + [后台地址](http://research.mcnetmart.com/NEBnKkdLDW.php) 账号:admin 密码:a147258" [原型图](https://eqbh1l.axshare.com) -[设计稿](https://lanhuapp.com/web/#/item/project/stage?tid=279a1988-b0b6-4aac-9ef2-c066ece4ddcf&pid=6cb69861-790d-4f5b-9e80-8c059a873c9a -) \ No newline at end of file +[设计稿](https://lanhuapp.com/web/#/item/project/stage?tid=279a1988-b0b6-4aac-9ef2-c066ece4ddcf&pid=6cb69861-790d-4f5b-9e80-8c059a873c9a ) diff --git a/api/Common.ts b/api/Common.ts index 555badb..15f72d3 100644 --- a/api/Common.ts +++ b/api/Common.ts @@ -5,6 +5,7 @@ export default new class Common extends Http> { private readonly upload = '/common/upload' private readonly caseList = '/cases/lists' private readonly bottomMenu = '/index/bottomMenu' + private readonly login_url = '/user/login' handleUpload(file: any) { const formData = new FormData(); formData.append('file', file) @@ -17,5 +18,9 @@ export default new class Common extends Http> { getBottomMenu() { return this.get(this.bottomMenu) } + login(data: any) { + return this.post(this.login_url,this.toFormData(data)) + } + } diff --git a/assets/images/testCode.jpg b/assets/images/testCode.jpg new file mode 100644 index 0000000..6f522f3 Binary files /dev/null and b/assets/images/testCode.jpg differ diff --git a/components/Header/Index.vue b/components/Header/Index.vue index dbdda02..fc1668d 100644 --- a/components/Header/Index.vue +++ b/components/Header/Index.vue @@ -1,50 +1,73 @@ @@ -57,13 +80,14 @@ $prefix-cls: '#{$name-prefix}-header-wrap'; :deep(.el-menu) { @apply bg-transparent; border-bottom: unset; + .el-menu-item { border-bottom: unset; //font-size: 20px; transition: font-size .5s; background-color: unset; @apply relative text-xl; - &:after{ + &:after { content: ''; width: 50%; height: 8px; @@ -73,36 +97,43 @@ $prefix-cls: '#{$name-prefix}-header-wrap'; transform: translateX(-50%); @apply bg-transparent absolute; } - &:hover{ + + &:hover { color: unset; } + &.is-active { color: #333 !important; @apply font-bold text-2xl; - &:after{ + &:after { @apply bg-black; } } } } - &.is-host{ + + &.is-host { :deep(.el-menu) { .el-menu-item { color: $white !important; - &:hover{ + + &:hover { color: unset; } + &.is-active { - &:after{ + &:after { @apply bg-white; } } } } - :deep(.yangliu-app-logo__title){ + + :deep(.yangliu-app-logo__title) { color: $white; } } + //height: 100px; } diff --git a/components/Login/Index.vue b/components/Login/Index.vue new file mode 100644 index 0000000..496271f --- /dev/null +++ b/components/Login/Index.vue @@ -0,0 +1,171 @@ + + + + diff --git a/components/Mai/Tab/Index.vue b/components/Mai/Tab/Index.vue index 8ea8b1f..6ceeca9 100644 --- a/components/Mai/Tab/Index.vue +++ b/components/Mai/Tab/Index.vue @@ -51,7 +51,7 @@ export default defineComponent({ ]} > {item.name} - + ))} diff --git a/composables/useAppStore.ts b/composables/useAppStore.ts index 6370337..80fe1e5 100644 --- a/composables/useAppStore.ts +++ b/composables/useAppStore.ts @@ -13,7 +13,7 @@ const useAppStore = defineStore('app', { getters:{ getMenuTheme: (state)=> state.menuTheme, - getBannerTitle: (state)=> state.bannerTitle + getBannerTitle: (state)=> state.bannerTitle, }, actions: { diff --git a/composables/useUserInfo.ts b/composables/useUserInfo.ts new file mode 100644 index 0000000..667225e --- /dev/null +++ b/composables/useUserInfo.ts @@ -0,0 +1,49 @@ +import {acceptHMRUpdate, createPinia, defineStore} from 'pinia'; + +type menu = 'light' | 'dark' +export interface UserState { + token: string; + info: any; + loginVisible: boolean; +} +const useUserInfo = defineStore('user', { + state: (): UserState => ({ + token: '', + info: {}, + loginVisible: false, + }), + + actions: { + setToken(token: string):void { + this.token = token; + }, + setInfo(info: any):void { + this.info = info; + }, + setLoginVisible(val: boolean):void { + this.loginVisible = val; + }, + + async login(data: any){ + const { commonApi } = useApi() + const res = await commonApi.login(data); + // if (res.data) + console.log('login>>>>', res) + + return res; + } + + }, + getters:{ + getLoginVisible:(state)=> state.loginVisible, + }, + persist: process.client && { + storage: localStorage, + paths: ['info', 'token'] + } + +}) +export default useUserInfo; +if (import.meta.hot) { + import.meta.hot.accept(acceptHMRUpdate(useUserInfo, import.meta.hot)) +} diff --git a/layouts/tabLayout.vue b/layouts/tabLayout.vue index 4735a37..07f297b 100644 --- a/layouts/tabLayout.vue +++ b/layouts/tabLayout.vue @@ -5,12 +5,20 @@