|
@@ -32,11 +32,17 @@ class LoginService extends CrudService {
|
|
|
throw new BusinessError(ErrorCode.BAD_PASSWORD);
|
|
|
}
|
|
|
if (_user.role === '2' || _user.role === '3') {
|
|
|
- // const marketuser = await this.ctx.app.curl('http://127.0.0.1:9004/api/market/user/fetch/' + _user.uid);
|
|
|
- // console.log(marketuser);
|
|
|
- // if (marketuser.status !== '1') {
|
|
|
- // throw new BusinessError(ErrorCode.ACCESS_DENIED);
|
|
|
- // }
|
|
|
+ const url = 'http://127.0.0.1:9004/api/market/user/' + _user.uid;
|
|
|
+ const marketuser = await this.ctx.curl(url, {
|
|
|
+ method: 'get',
|
|
|
+ headers: {
|
|
|
+ 'content-type': 'application/json',
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ });
|
|
|
+ if (marketuser.data.data.status !== '1') {
|
|
|
+ throw new BusinessError(ErrorCode.ACCESS_DENIED);
|
|
|
+ }
|
|
|
}
|
|
|
// 取出用户的类型,根据用户类型返回相应信息
|
|
|
const state = uuid();
|