Security News
Supply Chain Attack Detected in @solana/web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@interaction/http-function
Advanced tools
使用的类必须注入HttpClient,如
constructor(
public http: HttpClient
) { }
备注:
如果使用的组件库
方法名 | 参数(请情见下表) | 返回数据格式 |
---|---|---|
GET | url: string, code: string = '1000000' errMsg: string = null | code: "1000000" message: "SUCCESS" data: {} |
GET_DATA | url: string, code: string = '1000000' errMsg: string = null | data: {} |
POST | url: string, code: string = '1000000' errMsg: string = null | code: "1000000" message: "SUCCESS" data: {} |
DELETE | url: string, code: string = '1000000' errMsg: string = null | code: "1000000" message: "SUCCESS" data: {} |
PATCH | url: string, code: string = '1000000' errMsg: string = null | code: "1000000" message: "SUCCESS" data: {} |
PUT | url: string, code: string = '1000000' errMsg: string = null | code: "1000000" message: "SUCCESS" data: {} |
参数名称 | 是否必填 | 参数介绍 |
---|---|---|
url: string | 必填 | 接口url路径 |
code: string | 非必填 | 接口url返回的数据code,默认为'1000000' |
errMsg | 非必填 | 如果使用此参数,必须注入ng-zorro-antd的modal: ModalService(这个参数,目前只有集成在用,后期会将此参数删除) |
@Injectable({
providedIn: 'root'
})
export class Service {
constructor(
public http: HttpClient,
) { }
}
import { GET, POST } from '@interaction/http-function'
@Injectable({
providedIn: 'root'
})
export class Service {
constructor(
public http: HttpClient,
) { }
@GET('/getdata')
getData(params: { params: HttpParams }): Observable<any> {
return null;
}
@POST('/getdata')
postData(params): Observable<any> {
return null;
}
}
export class HomeComponent {
constructor(
public service: Service
){}
get(): void {
const params: HttpParams = new HttpParams().set('id', `${id}`);
this.service.getData({ params: params }).subscribe(
(sucess)=> {},
(error) => {}
)
}
post(): void {
const params = {id: `${id}`};
this.service.postData(params).subscribe(
(sucess)=> {},
(error) => {}
)
}
}
FAQs
```js npm i @interaction/http-function ```
The npm package @interaction/http-function receives a total of 1 weekly downloads. As such, @interaction/http-function popularity was classified as not popular.
We found that @interaction/http-function demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.