|
@@ -66,8 +66,6 @@ class LoginService extends CrudService {
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
});
|
|
|
- // console.log('------------------------------------>>>>>>>>>>>>>>vipuser<<<<<<<<<<<*-----------------');
|
|
|
- // console.log(vipuser);
|
|
|
user.remark = vipuser.data.id;
|
|
|
}
|
|
|
// 取出用户的类型,根据用户类型返回相应信息
|
|
@@ -83,20 +81,36 @@ class LoginService extends CrudService {
|
|
|
user.menus = JSON.stringify(_menus);
|
|
|
const token = await this.createJwt(user);
|
|
|
await this.app.redis.set(key, token, 'EX', 60 * 60 * 24);
|
|
|
-
|
|
|
- // const operationlogdata = { login_id: user.id, login_name: user.name, login_role: user.role, type: '0', operation_edit: '登录' };
|
|
|
- // const url = 'http://127.0.0.1:9004/api/market/operationlog/';
|
|
|
- // const operationlog = await this.ctx.curl(url, {
|
|
|
- // method: 'post',
|
|
|
- // headers: {
|
|
|
- // 'content-type': 'application/json',
|
|
|
- // },
|
|
|
- // dataType: 'json',
|
|
|
- // data: JSON.stringify(operationlogdata),
|
|
|
- // });
|
|
|
- // if (operationlog.data.errcode === 0) {
|
|
|
- // console.log('1234');
|
|
|
- // }
|
|
|
+ let logFlag = false;
|
|
|
+ // "4568"如果是456的需要去dock里面查有没有这个人(是否在apply),2,8必存
|
|
|
+ if(_user.role === '4' || _user.role === '5' || _user.role === '6'){
|
|
|
+ const applydata = { user_id: user.id};
|
|
|
+ const url = 'http://127.0.0.1:9004/api/live/dock/getapply/';
|
|
|
+ const apply = await this.ctx.curl(url, {
|
|
|
+ method: 'post',
|
|
|
+ headers: {
|
|
|
+ 'content-type': 'application/json',
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ data: JSON.stringify(applydata),
|
|
|
+ });
|
|
|
+ console.log('-----------------------------apply');
|
|
|
+ console.log(apply);
|
|
|
+ }else if(_user.role === '2' || _user.role === '8'){
|
|
|
+ logFlag = true;
|
|
|
+ }
|
|
|
+ if(logFlag){
|
|
|
+ const operationlogdata = { login_id: user.id, login_name: user.name, login_role: user.role, type: '0', operation_edit: '登录' };
|
|
|
+ const url = 'http://127.0.0.1:9004/api/market/operationlog/';
|
|
|
+ const operationlog = await this.ctx.curl(url, {
|
|
|
+ method: 'post',
|
|
|
+ headers: {
|
|
|
+ 'content-type': 'application/json',
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ data: JSON.stringify(operationlogdata),
|
|
|
+ });
|
|
|
+ }
|
|
|
return { key };
|
|
|
}
|
|
|
|