quanxianhezhucetiaozhuan

This commit is contained in:
shijing 2022-10-18 10:28:05 +08:00
parent eaa62ddd7e
commit 97f8bdb7e6
2 changed files with 12 additions and 52 deletions

View File

@ -105,55 +105,14 @@
if (!that.checkedParams(obj)) return;
that.$u.api.visitorRegister(obj).then(res => {
uni.hideLoading();
that.$u.vuex('vuex_token', res.access)
that.$u.vuex('vuex_refresh', res.refresh)
that.$u.api.getUserInfo().then(user => {
if(user.avatar){
user.avatar = this.vuex_host + user.avatar
}
that.$u.vuex('vuex_user', user)
let perms = [];
for (let key in user.perms) {
perms.push(key);
}
console.log(perms);
that.$u.vuex('vuex_perm', perms)
})
// #ifdef APP-PLUS
let secret = that.ranStr(12)
let mySecret = {'username': obj.username, 'secret': secret}
that.$u.api.bindSecret({secret: secret}).then(res=>{
uni.setStorageSync('mySecret', JSON.stringify(mySecret))
}).catch(e=>{})
// #endif
if(res.type==='employee'){
uni.reLaunch({
url: '/pages/home/home_'
})
}else{
//
if(res.id_number==''||res.photo==''||res.id_number==null||res.photo==null){
//
uni.reLaunch({
url: '/pages/my/myInfoChange'
})
}else{
//
if(res.type==='remployee'){
uni.reLaunch({
url: '/pages/home/home_'
})
}else{
uni.reLaunch({
url: '/pages/workSpace/workSpace'
})
}
}
}
if(res.err_msg){
this.$u.toast(res.err_msg);
}else{
uni.reLaunch({
url: '/pages/login/login_'
})
}
uni.reLaunch({
url: '/pages/workSpace/workSpace'
})
}).catch(e => {
console.log(e)
uni.showToast({

View File

@ -71,7 +71,7 @@
</view>
</view>
</view>
<button type="warn" class="backCard" @click="bindBtl">退定位卡</button>
<button v-if="vuex_user.type=='employee'" type="warn" class="backCard" @click="bindBtl">退定位卡</button>
</view>
</template>
@ -107,9 +107,10 @@
},
onShow() {
// debugger;
console.log(this.vuex_userRange)
this.limitedRpj = this.vuex_perm.includes('rpj.create')>-1||this.vuex_perm.includes('superuser')>-1;
this.limitedOperation = this.vuex_perm.includes('operation.create')>-1||this.vuex_perm.includes('superuser')>-1;
console.log('vuex_userRange'+this.vuex_perm);
console.log(this.vuex_user);
this.limitedRpj = this.vuex_perm.includes('rpj.create')||this.vuex_perm.includes('superuser');
this.limitedOperation = this.vuex_perm.includes('operation.create')||this.vuex_perm.includes('superuser');
},
methods: {
bindBtl(){