English name
This commit is contained in:
@@ -17,6 +17,9 @@ const en = {
|
|||||||
labelother: 'close other',
|
labelother: 'close other',
|
||||||
labelall: 'close all'
|
labelall: 'close all'
|
||||||
},
|
},
|
||||||
|
info:{
|
||||||
|
realname:'English names can only contain uppercase and lowercase letters, "-", and spaces'
|
||||||
|
},
|
||||||
total: {
|
total: {
|
||||||
author: 'author',
|
author: 'author',
|
||||||
editor: 'editor',
|
editor: 'editor',
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ const zh = {
|
|||||||
label: '标签选项',
|
label: '标签选项',
|
||||||
labelother: '关闭其他',
|
labelother: '关闭其他',
|
||||||
labelall: '关闭所有'
|
labelall: '关闭所有'
|
||||||
|
}, info: {
|
||||||
|
realname: '英文名字只能包含大小写英文字母、"-" 、和 空格'
|
||||||
},
|
},
|
||||||
total: {
|
total: {
|
||||||
author: '作者',
|
author: '作者',
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<el-option v-for="item in df_country" :label="item.en_name" :key="item.en_name" :value="item.en_name"></el-option>
|
<el-option v-for="item in df_country" :label="item.en_name" :key="item.en_name" :value="item.en_name"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Realname :" prop="realname">
|
<el-form-item label="English name :" prop="realname">
|
||||||
<span v-if="this.email_num == 1">{{ addForm.realname }}</span>
|
<span v-if="this.email_num == 1">{{ addForm.realname }}</span>
|
||||||
<el-input v-model="addForm.realname" v-else></el-input>
|
<el-input v-model="addForm.realname" v-else></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -927,7 +927,6 @@ export default {
|
|||||||
// 保存用户的添加
|
// 保存用户的添加
|
||||||
saveAdd(addForm) {
|
saveAdd(addForm) {
|
||||||
this.$refs.add_Form.validate((valid) => {
|
this.$refs.add_Form.validate((valid) => {
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let path_add = '';
|
let path_add = '';
|
||||||
|
|
||||||
@@ -964,7 +963,15 @@ export default {
|
|||||||
// 新的
|
// 新的
|
||||||
path_add = this.urlList.addReviewer;
|
path_add = this.urlList.addReviewer;
|
||||||
if (this.btn_alert) {
|
if (this.btn_alert) {
|
||||||
return false
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$validateString(data.realname)) {
|
||||||
|
console.log('Input string is valid.');
|
||||||
|
} else {
|
||||||
|
console.log('Input string is invalid.');
|
||||||
|
this.$message.error(this.$t('info.realname'));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 重复
|
// 重复
|
||||||
@@ -977,6 +984,10 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
this.$api
|
this.$api
|
||||||
.post(path_add, data)
|
.post(path_add, data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
@@ -123,7 +123,7 @@
|
|||||||
<el-form-item label="Confirm password :" prop="repassword">
|
<el-form-item label="Confirm password :" prop="repassword">
|
||||||
<el-input v-model="addForm.repassword" type="password"></el-input>
|
<el-input v-model="addForm.repassword" type="password"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Realname :" prop="realname">
|
<el-form-item label="English name :" prop="realname">
|
||||||
<el-input v-model="addForm.realname"></el-input>
|
<el-input v-model="addForm.realname"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Phone :" prop="phone">
|
<el-form-item label="Phone :" prop="phone">
|
||||||
@@ -315,6 +315,10 @@
|
|||||||
|
|
||||||
// 检测邮箱弹出框
|
// 检测邮箱弹出框
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
|
this.emailForm = {
|
||||||
|
mark_new: ''
|
||||||
|
}
|
||||||
|
|
||||||
this.email_num = 0
|
this.email_num = 0
|
||||||
this.emailVisible = true
|
this.emailVisible = true
|
||||||
},
|
},
|
||||||
@@ -359,6 +363,7 @@
|
|||||||
this.email_num = 1
|
this.email_num = 1
|
||||||
this.emailForm.mark_new = 'Account already exist!'
|
this.emailForm.mark_new = 'Account already exist!'
|
||||||
} else {
|
} else {
|
||||||
|
this.addForm={}
|
||||||
this.addForm.email = this.emailForm.email
|
this.addForm.email = this.emailForm.email
|
||||||
this.addForm.account = this.emailForm.account
|
this.addForm.account = this.emailForm.account
|
||||||
this.email_num = 2
|
this.email_num = 2
|
||||||
@@ -386,6 +391,16 @@
|
|||||||
this.$refs.addTab.validate((valid) => {
|
this.$refs.addTab.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.addForm.password == this.addForm.repassword) {
|
if (this.addForm.password == this.addForm.repassword) {
|
||||||
|
|
||||||
|
|
||||||
|
if (this.$validateString(this.addForm.realname)) {
|
||||||
|
console.log('Input string is valid.');
|
||||||
|
} else {
|
||||||
|
console.log('Input string is invalid.');
|
||||||
|
this.$message.error(this.$t('info.realname'))
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
this.$api
|
this.$api
|
||||||
.post('api/User/addUser', this.addForm)
|
.post('api/User/addUser', this.addForm)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|||||||
@@ -813,7 +813,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
citeLoading: false, authorList: [],
|
citeLoading: false,
|
||||||
|
authorList: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
authorArticlesList: [],
|
authorArticlesList: [],
|
||||||
userrole: localStorage.getItem('U_status'),
|
userrole: localStorage.getItem('U_status'),
|
||||||
@@ -1300,6 +1301,14 @@ export default {
|
|||||||
|
|
||||||
// 保存个人信息
|
// 保存个人信息
|
||||||
saveMessage() {
|
saveMessage() {
|
||||||
|
if (this.$validateString(this.MessForm.realname)) {
|
||||||
|
console.log('Input string is valid.');
|
||||||
|
} else {
|
||||||
|
console.log('Input string is invalid.');
|
||||||
|
this.$message.error(this.$t('info.realname'))
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
this.$api
|
this.$api
|
||||||
.post('api/Ucenter/updateUserInfo', this.MessForm)
|
.post('api/Ucenter/updateUserInfo', this.MessForm)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import './components/common/directives';
|
|||||||
import 'babel-polyfill';
|
import 'babel-polyfill';
|
||||||
import api from './api/index.js';
|
import api from './api/index.js';
|
||||||
import Common from './components/common/common'
|
import Common from './components/common/common'
|
||||||
|
Vue.prototype.$validateString = function (str) {
|
||||||
|
return /^[a-zA-Z\s-]+$/.test(str);
|
||||||
|
}
|
||||||
|
|
||||||
// 引入富文本编辑器
|
// 引入富文本编辑器
|
||||||
import VueQuillEditor from 'vue-quill-editor'
|
import VueQuillEditor from 'vue-quill-editor'
|
||||||
|
|||||||
Reference in New Issue
Block a user