Skip to content

Commit

Permalink
chore: 调整基础域名
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjue666 committed Jul 26, 2024
1 parent 99bc8dd commit 6c7ef55
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/yi_jing_tong/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export class YiJingTong {

async genRequest<T>(action: string, sendData: Recordable = {}): Promise<T> {
const url =
(this.config.base_url || 'http://szy.kjwlxt.com/hwc_api/') + action;
(this.config.base_url || 'http://www.eastsunrisewarehouse.com/hwc_api/') +
action;
const res = await postJSONRequest<T>(url, {
token: this.config.app_token,
...sendData,
});

return res;
}
}
12 changes: 12 additions & 0 deletions packages/yi_jing_tong/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Recordable } from '@cn-international-express-sdk/utils';
import { YiJingTong } from '../src/index';

describe('Default cases', () => {
test('hello world test', async () => {
const token = 'YOUR_TOKEN';
const yjt = new YiJingTong({ app_token: token });
const res = await yjt.genRequest<Recordable>('hwc_storage_list.php');

expect(res.error).toBe('T');
});
});

0 comments on commit 6c7ef55

Please sign in to comment.