完善不同页面加载方式下的表现
This commit is contained in:
parent
9395f1126c
commit
ab7f83229e
@ -21,7 +21,7 @@ export default class extends Vue {
|
||||
if (mini && token) {
|
||||
console.log(`link from partner, token: ${token}`)
|
||||
AppModule.SetMini(1)
|
||||
// UserModule.updatePageToken(token)
|
||||
UserModule.updatePageToken(token)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators'
|
||||
import { getSidebarStatus, getSize, setSidebarStatus, setLanguage, setSize } from '@/utils/cookies'
|
||||
import { getSidebarStatus, getSize, setSidebarStatus, setLanguage, setSize, setMini, getMini } from '@/utils/cookies'
|
||||
import { getLocale } from '@/lang'
|
||||
import store from '@/store'
|
||||
|
||||
@ -29,7 +29,7 @@ class App extends VuexModule implements IAppState {
|
||||
public device = DeviceType.Desktop
|
||||
public language = getLocale()
|
||||
public size = getSize() || 'medium'
|
||||
public mini = 0
|
||||
public mini = getMini() ? Number(getMini()) : 0
|
||||
|
||||
@Mutation
|
||||
private TOGGLE_SIDEBAR(withoutAnimation: boolean) {
|
||||
@ -69,6 +69,7 @@ class App extends VuexModule implements IAppState {
|
||||
@Mutation
|
||||
private SET_MINI(mini: number) {
|
||||
this.mini = mini
|
||||
setMini(mini + '')
|
||||
}
|
||||
|
||||
@Action
|
||||
@ -99,7 +100,7 @@ class App extends VuexModule implements IAppState {
|
||||
@Action
|
||||
public SetMini(mini: number) {
|
||||
this.SET_MINI(mini)
|
||||
this.CloseSideBar(false)
|
||||
if (mini) this.CloseSideBar(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,10 @@ const sizeKey = 'size'
|
||||
export const getSize = () => Cookies.get(sizeKey)
|
||||
export const setSize = (size: string) => Cookies.set(sizeKey, size)
|
||||
|
||||
const miniKey = 'mini'
|
||||
export const getMini = () => Cookies.get(miniKey)
|
||||
export const setMini = (mini: string) => Cookies.set(miniKey, mini)
|
||||
|
||||
// User
|
||||
const tokenKey = 'vue_typescript_admin_access_token'
|
||||
export const getToken = () => Cookies.get(tokenKey)
|
||||
|
@ -25,6 +25,7 @@
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator'
|
||||
import { UserModule } from '@/store/modules/user'
|
||||
import { AppModule } from '@/store/modules/app'
|
||||
|
||||
@Component({
|
||||
name: 'Dashboard'
|
||||
@ -45,6 +46,10 @@ export default class extends Vue {
|
||||
get deptname() {
|
||||
return UserModule.deptname
|
||||
}
|
||||
|
||||
created() {
|
||||
AppModule.SetMini(0)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -95,6 +95,7 @@ import { UserModule } from '@/store/modules/user'
|
||||
import { isValidUsername } from '@/utils/validate'
|
||||
import LangSelect from '@/components/LangSelect/index.vue'
|
||||
import SocialSign from './components/SocialSignin.vue'
|
||||
import { AppModule } from '@/store/modules/app'
|
||||
|
||||
@Component({
|
||||
name: 'Login',
|
||||
@ -149,6 +150,10 @@ export default class extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
created() {
|
||||
AppModule.SetMini(0)
|
||||
}
|
||||
|
||||
mounted() {
|
||||
if (this.loginForm.username === '') {
|
||||
(this.$refs.username as Input).focus()
|
||||
|
Loading…
x
Reference in New Issue
Block a user