|
|
@@ -89,27 +89,27 @@ export const doWecomLogin = async (code: string, wxId?: string): Promise<void> =
|
|
|
window.localStorage.setItem('isRefreshProvider', res.Data.isRefreshProvider);
|
|
|
window.localStorage.setItem('weChat', res.Data.weChat);
|
|
|
// 处理身份,身份可能为多个,只能按身份权限大小来固定为某个身份;
|
|
|
- if (res.Data.userType) {
|
|
|
- // 使用位运算
|
|
|
- const ROLE_CONFIG = [
|
|
|
- { bit: 1 << 0, code: 'ssb', desc: '经销商' }, // 1
|
|
|
- { bit: 1 << 1, code: 'hbs', desc: '立邦用户' }, // 2
|
|
|
- { bit: 1 << 2, code: 'stoneLikePaint', desc: '服务商' }, // 4
|
|
|
- { bit: 1 << 3, code: 'goldShop', desc: '金牌店' }, // 8
|
|
|
- { bit: 1 << 4, code: 'dg', desc: '导购' }, // 16
|
|
|
- { bit: 1 << 5, code: 'xlskf', desc: '新零售客服' } // 32
|
|
|
- ];
|
|
|
- const userType = Number(res.Data.userType);
|
|
|
- console.log("userType=", userType);
|
|
|
- const matchRole = ROLE_CONFIG.find(item => (userType & item.bit) === item.bit);
|
|
|
- console.log("matchRole=", matchRole)
|
|
|
- const agent = matchRole && matchRole.code || 'xlskf';
|
|
|
- window.localStorage.setItem('agentFrom', agent);
|
|
|
- window.localStorage.setItem('agentFromAI', agent);
|
|
|
- }else{
|
|
|
+ // if (res.Data.userType) {
|
|
|
+ // // 使用位运算
|
|
|
+ // const ROLE_CONFIG = [
|
|
|
+ // { bit: 1 << 0, code: 'ssb', desc: '经销商' }, // 1
|
|
|
+ // { bit: 1 << 1, code: 'hbs', desc: '立邦用户' }, // 2
|
|
|
+ // { bit: 1 << 2, code: 'stoneLikePaint', desc: '服务商' }, // 4
|
|
|
+ // { bit: 1 << 3, code: 'goldShop', desc: '金牌店' }, // 8
|
|
|
+ // { bit: 1 << 4, code: 'dg', desc: '导购' }, // 16
|
|
|
+ // { bit: 1 << 5, code: 'xlskf', desc: '新零售客服' } // 32
|
|
|
+ // ];
|
|
|
+ // const userType = Number(res.Data.userType);
|
|
|
+ // console.log("userType=", userType);
|
|
|
+ // const matchRole = ROLE_CONFIG.find(item => (userType & item.bit) === item.bit);
|
|
|
+ // console.log("matchRole=", matchRole)
|
|
|
+ // const agent = matchRole && matchRole.code || 'xlskf';
|
|
|
+ // window.localStorage.setItem('agentFrom', agent);
|
|
|
+ // window.localStorage.setItem('agentFromAI', agent);
|
|
|
+ // }else{
|
|
|
window.localStorage.setItem('agentFrom', 'xlskf');
|
|
|
window.localStorage.setItem('agentFromAI', 'xlskf');
|
|
|
- }
|
|
|
+ // }
|
|
|
isLogging = false;
|
|
|
} else {
|
|
|
isLogging = false;
|