完善店铺游戏设置的权限

This commit is contained in:
zhl 2021-05-08 15:33:05 +08:00
parent 736614cae9
commit 3ee310513b

View File

@ -24,6 +24,7 @@
name="shop"
required
class="w100"
v-if="userLevel === 1"
>
<el-option
v-for="item in allDepts"
@ -71,6 +72,8 @@ import { Component, Vue, Watch } from 'vue-property-decorator'
import { getGames, IGameData } from '@/api/game'
import Sticky from '@/components/Sticky/index.vue'
import { getShopGameInfo, getShops, saveShopGameInfo } from '@/api/shop'
import { checkPermission } from '@/utils/permission'
import { UserModule } from '@/store/modules/user'
@Component({
name: 'GameSetting',
@ -98,9 +101,17 @@ export default class extends Vue {
hasVersion: 1
}
get userLevel() {
return UserModule.level
}
async created() {
await this.getList()
await this.getRemoteDeptList('')
if (UserModule.level === 1) {
await this.getRemoteDeptList('')
} else {
this.shop = UserModule.department
}
}
@Watch('shop')
@ -152,6 +163,9 @@ export default class extends Vue {
}
private async getRemoteDeptList(name: string) {
if (UserModule.level > 1) {
return
}
const { data } = await getShops({ key: name })
if (!data.records) return
this.allDepts = data.records