Add user's phonePrefix.

This commit is contained in:
Yang Luo
2021-04-26 17:57:32 +08:00
parent 36895801f0
commit d586efc242
3 changed files with 9 additions and 2 deletions

View File

@ -33,6 +33,7 @@ type User struct {
DisplayName string `xorm:"varchar(100)" json:"displayName"` DisplayName string `xorm:"varchar(100)" json:"displayName"`
Avatar string `xorm:"varchar(255)" json:"avatar"` Avatar string `xorm:"varchar(255)" json:"avatar"`
Email string `xorm:"varchar(100)" json:"email"` Email string `xorm:"varchar(100)" json:"email"`
PhonePrefix string `xorm:"varchar(10)" json:"phonePrefix"`
Phone string `xorm:"varchar(100)" json:"phone"` Phone string `xorm:"varchar(100)" json:"phone"`
Affiliation string `xorm:"varchar(100)" json:"affiliation"` Affiliation string `xorm:"varchar(100)" json:"affiliation"`
Tag string `xorm:"varchar(100)" json:"tag"` Tag string `xorm:"varchar(100)" json:"tag"`

View File

@ -286,7 +286,12 @@ class UserEditPage extends React.Component {
{i18next.t("general:Phone")}: {i18next.t("general:Phone")}:
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.user.phone} onChange={e => { <Input addonBefore={
<Select virtual={false} style={{width: 70}} value={this.state.user.phonePrefix} onChange={(value => {this.updateUserField('phonePrefix', value);})}>
<Option value="1">+1</Option>
<Option value="86">+86</Option>
</Select>
} value={this.state.user.phone} onChange={e => {
this.updateUserField('phone', e.target.value); this.updateUserField('phone', e.target.value);
}} /> }} />
</Col> </Col>

View File

@ -52,7 +52,8 @@ class UserListPage extends React.Component {
displayName: `New User - ${this.state.users.length}`, displayName: `New User - ${this.state.users.length}`,
avatar: "https://casbin.org/img/casbin.svg", avatar: "https://casbin.org/img/casbin.svg",
email: "user@example.com", email: "user@example.com",
phone: "1-12345678", phonePrefix: "86",
phone: "12345678",
affiliation: "Example Inc.", affiliation: "Example Inc.",
tag: "staff", tag: "staff",
isAdmin: false, isAdmin: false,