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