Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
fix: 更正 auth api 参数名错误
Browse files Browse the repository at this point in the history
  • Loading branch information
yvvw committed May 28, 2019
1 parent 1edac89 commit 1c98527
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react-native-wechat

[WeChat SDK](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list) [![npm version](https://badge.fury.io/js/%40yyyyu%2Freact-native-wechat.svg)](https://www.npmjs.com/package/@yyyyu/react-native-wechat)
[WeChat SDK](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list) [![npm version](https://badge.fury.io/js/%40yyyyu%2Freact-native-wechat.svg)](https://www.npmjs.com/package/@yyyyu/react-native-wechat) [![Build Status](https://travis-ci.org/yyyyu/react-native-wechat.svg?branch=master)](https://travis-ci.org/yyyyu/react-native-wechat)

**SDK Version**
iOS 1.8.4
Expand All @@ -10,6 +10,8 @@ Android 5.3.1
Xcode 10.2.1
react-native 0.59.5

## [Example](example/App.js)

## Getting Started

```bash
Expand Down Expand Up @@ -147,7 +149,7 @@ RNWechat.getSDKVersion()
interface IAuthOption {
state: string;
scope?: AuthScope;
supportWeb?: boolean;
fallback?: boolean;
}
RNWechat.auth({
state: "",
Expand Down
2 changes: 1 addition & 1 deletion dist/api/OAuth2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PromiseResult } from "../module";
export interface IOAuth2Option {
scope?: OAuth2Scope;
state: string;
supportWeb?: boolean;
fallback?: boolean;
}
export declare enum OAuth2Scope {
UserInfo = "snsapi_userinfo"
Expand Down
6 changes: 3 additions & 3 deletions dist/api/OAuth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function OAuth2(option) {
const defaultOption = {
scope: OAuth2Scope.UserInfo,
state: "",
supportWeb: false,
fallback: false,
};
function parseOption(o) {
const option = Object.assign({}, defaultOption);
Expand All @@ -22,8 +22,8 @@ function parseOption(o) {
if (typeof o.state === "string") {
option.state = o.state;
}
if (typeof o.supportWeb === "boolean") {
option.supportWeb = o.supportWeb;
if (typeof o.fallback === "boolean") {
option.fallback = o.fallback;
}
return option;
}
2 changes: 1 addition & 1 deletion dist/api/auth.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PromiseResult } from "../module";
export interface IAuthOption {
scope?: AuthScope;
state: string;
supportWeb?: boolean;
fallback?: boolean;
}
export declare enum AuthScope {
UserInfo = "snsapi_userinfo"
Expand Down
6 changes: 3 additions & 3 deletions dist/api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function auth(option) {
const defaultOption = {
scope: AuthScope.UserInfo,
state: "",
supportWeb: false,
fallback: false,
};
function parseOption(o) {
const option = Object.assign({}, defaultOption);
Expand All @@ -22,8 +22,8 @@ function parseOption(o) {
if (typeof o.state === "string") {
option.state = o.state;
}
if (typeof o.supportWeb === "boolean") {
option.supportWeb = o.supportWeb;
if (typeof o.fallback === "boolean") {
option.fallback = o.fallback;
}
return option;
}
2 changes: 1 addition & 1 deletion example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class App extends Component {
// interface IAuthOption {
// state: string;
// scope?: AuthScope;
// supportWeb?: boolean;
// fallback?: boolean;
// }
console.log("invoke auth");
console.log(
Expand Down

0 comments on commit 1c98527

Please sign in to comment.