Commit 6e6bb196 authored by 2breakegg's avatar 2breakegg
parents f206e585 44c673dc
...@@ -3,7 +3,7 @@ let publicPath = 'https://cdn01.moecube.com/accounts/'; ...@@ -3,7 +3,7 @@ let publicPath = 'https://cdn01.moecube.com/accounts/';
const API_ROOT = { const API_ROOT = {
development: 'http://192.168.1.9:3000', development: 'http://192.168.1.9:3000',
test: 'http://114.215.243.95:8082', test: 'http://114.215.243.95:8082',
production: 'https://api.moeube.com/accounts' production: 'https://api.moecube.com/accounts'
}; };
let defineConf = { let defineConf = {
......
...@@ -4,7 +4,7 @@ env: ...@@ -4,7 +4,7 @@ env:
global: global:
secure: NObcZ6fY1VQuoDfxRxKVOZ+p7g3LTDkonG4Ow4HIbx2g8wJ24mMqs9gN0J3Asbdbz68isDMpkKy7IW1mK9+N9fM0pBauqD1YMbglnEv+HhYjhiEsQdRdDM2nzDIjS4PCwavI1Da5TLhaUjSAM4lrHx7bVOK4YsvF3s8JEApS54QgSlbeJgvSbPcCiapl0VwwaL36cGndChc3tawq4xseuk4bP2NrTEd7ifYZMt+iojId+UuhRQk4w0HUlBhEDKiT/fLxeQDwMRv2WIdIPW7D7+Wo01iX+T0Ti629QhQBe/S76affkG6G085HIPin3VvXDQaiYbK4ALbc79O+9jqSxEFd9nwG8xbp2jezzvclUSXPhIyZe7VSRS6z1MdevlyQa56AUEP7My7IMqj8j7NPoUgrnVlKtR8WPHQacfAVkrcOIX+Tzwl2IMOCqonamDtJjUNX5xpYB+IEj+INvQmRqT2NicExGWj9LZp3L3kscwq1u+0hPzgoQ9yovE+OvLFNE/R5AE90GIaSlwXw4MqOeB+8l+ou2JzNZFJhHBvAsOFwQTloFz/pu7ichJ+P0KsMPteLFA4Btuo6bBu31K7R310CmlIdYJIeeybMuM6e6bG8IkbVcMq5skg9LNa64KuDG46oopwGLiWkdRwDzG3VmXGwVm+OF2EWZi/B0wIcTwY= secure: NObcZ6fY1VQuoDfxRxKVOZ+p7g3LTDkonG4Ow4HIbx2g8wJ24mMqs9gN0J3Asbdbz68isDMpkKy7IW1mK9+N9fM0pBauqD1YMbglnEv+HhYjhiEsQdRdDM2nzDIjS4PCwavI1Da5TLhaUjSAM4lrHx7bVOK4YsvF3s8JEApS54QgSlbeJgvSbPcCiapl0VwwaL36cGndChc3tawq4xseuk4bP2NrTEd7ifYZMt+iojId+UuhRQk4w0HUlBhEDKiT/fLxeQDwMRv2WIdIPW7D7+Wo01iX+T0Ti629QhQBe/S76affkG6G085HIPin3VvXDQaiYbK4ALbc79O+9jqSxEFd9nwG8xbp2jezzvclUSXPhIyZe7VSRS6z1MdevlyQa56AUEP7My7IMqj8j7NPoUgrnVlKtR8WPHQacfAVkrcOIX+Tzwl2IMOCqonamDtJjUNX5xpYB+IEj+INvQmRqT2NicExGWj9LZp3L3kscwq1u+0hPzgoQ9yovE+OvLFNE/R5AE90GIaSlwXw4MqOeB+8l+ou2JzNZFJhHBvAsOFwQTloFz/pu7ichJ+P0KsMPteLFA4Btuo6bBu31K7R310CmlIdYJIeeybMuM6e6bG8IkbVcMq5skg9LNa64KuDG46oopwGLiWkdRwDzG3VmXGwVm+OF2EWZi/B0wIcTwY=
script: npm run build:test script: npm run build
before_deploy: before_deploy:
- curl --location --retry 5 --output ossutil 'https://github.com/mycard/ossutil/releases/download/1.0.0.Beta2/ossutil' - curl --location --retry 5 --output ossutil 'https://github.com/mycard/ossutil/releases/download/1.0.0.Beta2/ossutil'
- chmod +x ossutil - chmod +x ossutil
......
...@@ -44,7 +44,7 @@ class EmailForm extends React.Component { ...@@ -44,7 +44,7 @@ class EmailForm extends React.Component {
label: messages.email, label: messages.email,
hasFeedback: true, hasFeedback: true,
validateStatus: checkEmail, validateStatus: checkEmail,
help: isEmailExists ? 'email exists' : '', extra: isEmailExists ? '//i18n email exists' : '',
...formItemLayout, ...formItemLayout,
}, },
decorator: { decorator: {
...@@ -87,7 +87,7 @@ class EmailForm extends React.Component { ...@@ -87,7 +87,7 @@ class EmailForm extends React.Component {
</FormItem> </FormItem>
<FormItem {...passwordProps.fromItem}> <FormItem {...passwordProps.fromItem}>
{getFieldDecorator('password')( {getFieldDecorator('password', { ...passwordProps.decorator })(
<Input {...passwordProps.input} />, <Input {...passwordProps.input} />,
)} )}
</FormItem> </FormItem>
......
import React from 'react';
const Example = () => {
return (
<div>
Example
</div>
);
};
Example.propTypes = {};
export default Example;
...@@ -62,7 +62,7 @@ class EmailForm extends React.Component { ...@@ -62,7 +62,7 @@ class EmailForm extends React.Component {
const passwordProps = { const passwordProps = {
fromItem: { fromItem: {
label: 'old passwrod', label: messages['old-password'],
...formItemLayout, ...formItemLayout,
}, },
decorator: { decorator: {
......
...@@ -43,7 +43,7 @@ class EmailForm extends React.Component { ...@@ -43,7 +43,7 @@ class EmailForm extends React.Component {
label: messages.email, label: messages.email,
hasFeedback: true, hasFeedback: true,
validateStatus: checkEmail, validateStatus: checkEmail,
help: isEmailExists ? 'email exists' : '', extra: isEmailExists ? '//i18n email exists' : '',
...formItemLayout, ...formItemLayout,
}, },
decorator: { decorator: {
......
...@@ -43,7 +43,7 @@ class EmailForm extends React.Component { ...@@ -43,7 +43,7 @@ class EmailForm extends React.Component {
label: messages.username, label: messages.username,
hasFeedback: true, hasFeedback: true,
validateStatus: checkUsername, validateStatus: checkUsername,
help: isUserNameExists ? 'username exists' : '', extra: isUserNameExists ? 'username exists' : '',
...formItemLayout, ...formItemLayout,
}, },
decorator: { decorator: {
...@@ -84,7 +84,7 @@ class EmailForm extends React.Component { ...@@ -84,7 +84,7 @@ class EmailForm extends React.Component {
</FormItem> </FormItem>
<FormItem {...passwordProps.fromItem}> <FormItem {...passwordProps.fromItem}>
{getFieldDecorator('password')( {getFieldDecorator('password', { ...passwordProps.decorator })(
<Input {...passwordProps.input} />, <Input {...passwordProps.input} />,
)} )}
</FormItem> </FormItem>
......
...@@ -38,9 +38,10 @@ function UserPanel({ dispatch, user }) { ...@@ -38,9 +38,10 @@ function UserPanel({ dispatch, user }) {
<img <img
alt="avatar" src={avatar || defaultAvatar} alt="avatar" src={avatar || defaultAvatar}
style={{ borderRadius: '45px', style={{ borderRadius: '45px',
height: '45px', height: '40px',
weight: '45px', weight: '40px',
border: '2px solid rgba(255,255,255,0.2' }} /> boxSizing: 'content-box',
border: '2px solid rgba(255,255,255,0.3' }} />
</div> </div>
</Dropdown> </Dropdown>
); );
......
...@@ -168,15 +168,16 @@ export default { ...@@ -168,15 +168,16 @@ export default {
message.success(messages['Your-account-has-been-successfully-activated!'], 3); message.success(messages['Your-account-has-been-successfully-activated!'], 3);
} }
} catch (error) { } catch (error) {
message.error(error.message, 3); message.error(messages[error.message] || error.message, 3);
} }
}, },
*checkEmail({ payload }, { call, put }) { *checkEmail({ payload }, { call, put, select }) {
if (!payload.email) { if (!payload.email) {
yield put({ type: 'check', payload: { checkEmail: 'error' } }); yield put({ type: 'check', payload: { checkEmail: 'error' } });
return; return;
} }
const { messages } = yield select(state => state.common);
try { try {
const { data } = yield call(checkUserExists, { const { data } = yield call(checkUserExists, {
email: payload.email, email: payload.email,
...@@ -186,15 +187,20 @@ export default { ...@@ -186,15 +187,20 @@ export default {
yield put({ type: 'check', payload: { isEmailExists: true, checkEmail: 'warning' } }); yield put({ type: 'check', payload: { isEmailExists: true, checkEmail: 'warning' } });
} }
} catch (error) { } catch (error) {
yield put({ type: 'check', payload: { isEmailExists: false, checkEmail: 'success' } }); if (error.message === 'i_not_found') {
yield put({ type: 'check', payload: { isEmailExists: false, checkEmail: 'success' } });
} else {
message.error(messages[error.message] || error.message, 3);
}
} }
}, },
*checkUsername({ payload }, { call, put }) { *checkUsername({ payload }, { call, put, select }) {
if (!payload.username) { if (!payload.username) {
yield put({ type: 'check', payload: { checkUsername: 'error' } }); yield put({ type: 'check', payload: { checkUsername: 'error' } });
return; return;
} }
const { messages } = yield select(state => state.common);
try { try {
const { data } = yield call(checkUserExists, { const { data } = yield call(checkUserExists, {
username: payload.username, username: payload.username,
...@@ -204,7 +210,11 @@ export default { ...@@ -204,7 +210,11 @@ export default {
yield put({ type: 'check', payload: { isUserNameExists: true, checkUsername: 'warning' } }); yield put({ type: 'check', payload: { isUserNameExists: true, checkUsername: 'warning' } });
} }
} catch (error) { } catch (error) {
yield put({ type: 'check', payload: { isUserNameExists: false, checkUsername: 'success' } }); if (error.message === 'i_not_found') {
yield put({ type: 'check', payload: { isUserNameExists: false, checkUsername: 'success' } });
} else {
message.error(messages[error.message] || error.message, 3);
}
} }
}, },
*login({ payload }, { call, put, select }) { *login({ payload }, { call, put, select }) {
......
...@@ -114,7 +114,8 @@ class Profiles extends React.Component { ...@@ -114,7 +114,8 @@ class Profiles extends React.Component {
this.cropper = cropper; this.cropper = cropper;
}} }}
src={imageUrl || defaultAvatar} src={imageUrl || defaultAvatar}
style={{ maxHeight: '20vw', maxWidth: '20vw' }} className="cropper-image"
style={{ height: '20vw', width: '20vw' }}
aspectRatio={1 / 1} aspectRatio={1 / 1}
guides guides
/> />
...@@ -124,7 +125,7 @@ class Profiles extends React.Component { ...@@ -124,7 +125,7 @@ class Profiles extends React.Component {
</div> </div>
<div style={{ display: !isUpload ? 'flex' : 'none', flexDirection: 'column' }}> <div style={{ display: !isUpload ? 'flex' : 'none', flexDirection: 'column' }}>
<img alt="avatar" src={avatar || imageUrl || defaultAvatar}/> <img alt="avatar" style={{ height: '20vw', width: '20vw' }} src={avatar || imageUrl || defaultAvatar}/>
<Button style={{ padding: '4px 0' }}> <Button style={{ padding: '4px 0' }}>
<label style={{ display: 'flex', flex: 1, justifyContent: 'center', alignItems: 'center' }}> <label style={{ display: 'flex', flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Icon type="plus"/><Format id="Change-Avatar"/> <Icon type="plus"/><Format id="Change-Avatar"/>
......
:global { :global {
.app-detail-nav {
}
.ant-card { .ant-card {
margin: 2vh 0; margin: 2vh 0;
} }
......
...@@ -68,9 +68,7 @@ class Verify extends React.Component { ...@@ -68,9 +68,7 @@ class Verify extends React.Component {
return ( return (
<div <div style={{ display: 'flex', flex: 1, justifyContent: 'center', alignItems: 'center', height: '100%' }}>
style={{ display: 'flex', flex: 1, justifyContent: 'center', alignItems: 'center', height: '100%' }}
>
<Spin spinning={loading} delay={100}> <Spin spinning={loading} delay={100}>
<Steps size="large" current={1}> <Steps size="large" current={1}>
......
...@@ -20,6 +20,7 @@ export const handleSSO = (user) => { ...@@ -20,6 +20,7 @@ export const handleSSO = (user) => {
params.set('return_sso_url', sso.get('return_sso_url')); params.set('return_sso_url', sso.get('return_sso_url'));
params.set('nonce', sso.get('nonce')); params.set('nonce', sso.get('nonce'));
params.set('external_id', user.id); params.set('external_id', user.id);
params.set('avatar_url', user.avatar);
const payload = Buffer.from(params.toString()).toString('base64'); const payload = Buffer.from(params.toString()).toString('base64');
url.searchParams.set('sso', payload); url.searchParams.set('sso', payload);
......
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 to comment