quanxianhezhucetiaozhuan
This commit is contained in:
parent
eaa62ddd7e
commit
97f8bdb7e6
|
@ -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({
|
||||
|
|
|
@ -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(){
|
||||
|
|
Loading…
Reference in New Issue