This commit is contained in:
snoop 2017-05-27 18:40:13 +09:00
parent 436fd597b2
commit bac329e31e

View File

@ -56,6 +56,8 @@ const muiTheme = getMuiTheme({
},
});
var EMailRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
export class MemberRegist extends React.Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
@ -74,6 +76,8 @@ export class MemberRegist extends React.Component<any, any> {
company: "",
phone: "",
pw: "",
isEmail: true
};
}
@ -95,6 +99,8 @@ export class MemberRegist extends React.Component<any, any> {
"phone": this.state.phone
};
let os: OFRest = new OFRest("Member", "Regist", obj);
os.Call().then(function (res) {
@ -106,39 +112,10 @@ export class MemberRegist extends React.Component<any, any> {
console.log(err);
});
// let exeObj: any;
// exeObj = {
// "serviceName": "Member",
// "methodName": "Regist",
// "param": obj
// }
// output = JSON.stringify(exeObj);
// // obj = { "value": output };
// fetch('http://192.168.1.203:8080/v1/overflow/services', {
// method: 'POST',
// headers: {
// 'Accept': 'application/json',
// // mode: 'no-cors'
// },
// body: output
// }).then(function (response) {
// return response.json();
// }).then(function (json) {
// console.log(json);
// ReactDOM.render(<MemberRegistResult />, document.getElementById('example')
// );
// }).catch((err) => {
// console.log(err);
// });
}
public validateEmail(email: any) {
return EMailRegex.test(email);
}
handleTestRead = () => {
@ -283,11 +260,16 @@ render() {
ref="email"
hintText="smith@gmail.com"
floatingLabelText="Email address*"
errorText=""
errorText={this.state.isEmail ? "":"Please Email Format"}
style={styles.textfield}
underlineShow={true}
value={this.state.email}
onChange={(e, newValue) => this.setState({ email: newValue })}
onChange={(e, newValue) => {
this.setState({ email: newValue });
this.state.isEmail = this.validateEmail(this.state.email);
}
}
/>
<br />
<TextField