quanxianhezhucetiaozhuan
This commit is contained in:
parent
eaa62ddd7e
commit
97f8bdb7e6
|
@ -105,55 +105,14 @@
|
||||||
if (!that.checkedParams(obj)) return;
|
if (!that.checkedParams(obj)) return;
|
||||||
that.$u.api.visitorRegister(obj).then(res => {
|
that.$u.api.visitorRegister(obj).then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
that.$u.vuex('vuex_token', res.access)
|
if(res.err_msg){
|
||||||
that.$u.vuex('vuex_refresh', res.refresh)
|
this.$u.toast(res.err_msg);
|
||||||
that.$u.api.getUserInfo().then(user => {
|
}else{
|
||||||
if(user.avatar){
|
uni.reLaunch({
|
||||||
user.avatar = this.vuex_host + user.avatar
|
url: '/pages/login/login_'
|
||||||
}
|
})
|
||||||
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'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/workSpace/workSpace'
|
|
||||||
})
|
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -107,9 +107,10 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// debugger;
|
// debugger;
|
||||||
console.log(this.vuex_userRange)
|
console.log('vuex_userRange'+this.vuex_perm);
|
||||||
this.limitedRpj = this.vuex_perm.includes('rpj.create')>-1||this.vuex_perm.includes('superuser')>-1;
|
console.log(this.vuex_user);
|
||||||
this.limitedOperation = this.vuex_perm.includes('operation.create')>-1||this.vuex_perm.includes('superuser')>-1;
|
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: {
|
methods: {
|
||||||
bindBtl(){
|
bindBtl(){
|
||||||
|
|
Loading…
Reference in New Issue