Skip to content

Commit e8fdba8

Browse files
author
unknown
committed
update ajax async
1 parent 55f9e82 commit e8fdba8

File tree

5 files changed

+167
-4
lines changed

5 files changed

+167
-4
lines changed

build/webpack.base.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function webpackBaseConfig (NODE_ENV = 'development') {
2929
rules: [
3030
{
3131
test: /\.ts$/,
32-
loader: 'awesome-typescript-loader',
32+
loader: 'ts-loader',
3333
exclude: /(node_modules)/
3434
},
3535
{

package-lock.json

Lines changed: 163 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"source-map-loader": "^0.2.4",
5151
"style-loader": "^0.23.1",
5252
"ts-jest": "^24.0.2",
53+
"ts-loader": "^8.0.14",
5354
"typescript": "^3.4.4",
5455
"url-loader": "^1.1.2",
5556
"webpack": "^4.30.0",

src/app/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ App.prototype = {
3131
new Tip(options);
3232
},
3333

34-
$ajax: function (options: AjaxOptions): Promise<any> {
34+
$ajax: function (options: AjaxOptions): Promise<any> | string {
3535
return ajax(options);
3636
},
3737

src/app/modules/ajax.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import { AjaxOptions, ContentType, JsonpOptions } from '../../interface';
88
/**
99
* ajax
1010
*/
11-
function Ajax(options: AjaxOptions): any {
11+
function Ajax(options: AjaxOptions): Promise<any> | string {
1212
options = { ...Ajax.defaultOptions, ...options };
1313
const xmlHttp: XMLHttpRequest = new XMLHttpRequest();
14-
1514
// define request data
1615
if (options.contentType = ContentType.Urlencoded) {
1716
const keysOfData = Object.keys(options.data);

0 commit comments

Comments
 (0)