056970d8
Key
feat: api
|
1
|
import 'package:dio/dio.dart';
|
05f9b20a
Key
fixed: api调用方式,未完善
|
2
|
import 'package:wow_english/common/request/config.dart';
|
056970d8
Key
feat: api
|
3
4
5
6
|
class TokenInterceptor extends Interceptor {
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
|
05f9b20a
Key
fixed: api调用方式,未完善
|
7
8
9
10
|
// 判断token不为空插入, todo token的取法应该跟user在一起,这里取不到user
if (RequestConfig.token.isNotEmpty) {
options.headers["Auth-token"] = RequestConfig.token;
}
|
056970d8
Key
feat: api
|
11
12
13
14
|
options.headers["version"] = '1.0.0';
super.onRequest(options, handler);
}
}
|