Commit eafb0a00 by 代凡

增加登录相关接口

parent 87c07f97
......@@ -12,7 +12,8 @@
"react-native": "0.60.5",
"react-native-gesture-handler": "^1.4.1",
"react-native-reanimated": "^1.2.0",
"react-navigation": "^3.12.1"
"react-navigation": "^3.12.1",
"axios": "^0.18.0"
},
"devDependencies": {
"@babel/core": "^7.5.5",
......
......@@ -14,6 +14,7 @@ import {
createAppContainer
} from "react-navigation";
const img = require("./img/logo_polyv.png")
const { width, height } = Dimensions.get("window")
export default class PolyvLogin extends Component {
......@@ -25,6 +26,10 @@ export default class PolyvLogin extends Component {
}
}
componentWillMount(){
console.log("componentWillMount");
}
render() {
let title = this.state.showTitleText ?
<Text>POLYV&#160;&#160;云课堂</Text> :
......
'use strict';
import { NativeModules } from 'react-native';
const PolyvRNCloudClassLoginModule = NativeModules.PolyvRNCloudClassLoginModule
export const PolyvCloudClassModule = {
//初始化
async init (vodKey, decodeKey, decodeIv, viewerId, nickName){
console.log(`config_${vodKey}_${decodeKey}_${decodeIv}`)
try {
PolyvRNCloudClassLoginModule.init(vodKey, decodeKey, decodeIv, viewerId, nickName)
.then(ret =>{
console.log('result :token:'+ret.token+" isSign:"+ret.isSign)
})
console.log('result end')
return { "code":0 }
} catch (e) {
var code = e.code;
var message = e.message;
return { code, message }
}
},
async login(handler, userId, channelId,vid,appId,appSecrect){
console.log("login_{userId}_{channelId}")
try {
await PolyvRNCloudClassLoginModule.login(handler, userId, channelId,vid,appId,appSecrect)
return { "code":0 }
} catch (e) {
var code = e.code;
var message = e.message;
return { code, message }
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment