添加必填校验和vue文件大小、登录验证码校验

This commit is contained in:
haozq 2025-02-24 14:39:33 +08:00
parent 3bc8808210
commit 01cfdd1131
9 changed files with 44 additions and 31 deletions

View File

@ -1,23 +1,23 @@
import { getToDoNum } from '@/api/system/notice'
export function lookFile() {
return 'http://192.168.0.14:21626/file/statics' //14服务器
// return 'http://192.168.0.14:21626/file/statics' //14服务器
// return 'http://112.29.103.165:14413/file/statics' //1.6演示服务器
// return 'http://218.21.27.6:1999/file/statics' //生产服务器
return 'http://218.21.27.6:1999/file/statics' //生产服务器
}
export function lookFaceFile() {
return 'http://192.168.0.14:21626/file/statics/' //14服务器
// return 'http://192.168.0.14:21626/file/statics/' //14服务器
//return 'http://112.29.103.165:14413/file/statics/' //1.6演示服务器
// return 'http://218.21.27.6:1999/file/statics/' //生产服务器
return 'http://218.21.27.6:1999/file/statics/' //生产服务器
}
export function filePreview() {
return 'http://192.168.0.14:8012/onlinePreview?url=' //14服务器
// return 'http://192.168.0.14:8012/onlinePreview?url=' //14服务器
// return 'http://112.29.103.165:8012/onlinePreview?url=' //1.6演示服务器
// return 'http://218.21.27.6:18013/onlinePreview?url='
return 'http://218.21.27.6:18013/onlinePreview?url='
}
export function lookMioIoFile() {
// return 'http://218.21.27.6:19090/nxdt-courseware' //生产服务器
return 'http://192.168.0.14:9090/nxdt-courseware-1' //14服务器
return 'http://218.21.27.6:19090/nxdt-courseware' //生产服务器
// return 'http://192.168.0.14:9090/nxdt-courseware-1' //14服务器
}
// lookFile: 'http://218.21.27.6:1999/nxnyback/statics',

View File

@ -18,7 +18,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 10000 * 5,
timeout: 10000 * 20,
})
// request拦截器

View File

@ -350,9 +350,9 @@ export default {
fileList.forEach(item => {
totalSize += item.size
})
const isLtFile = totalSize / 1024 / 1024 < 500
const isLtFile = totalSize / 1024 / 1024 < 600
if (!isLtFile) {
this.$message.error('文件大小不能超过500M')
this.$message.error('文件大小不能超过600M')
fileList = []
this.fileList = []
} else if (fileList.length > 5) {

View File

@ -112,14 +112,14 @@ export default {
trigger: 'blur',
},
],
// code: [{ required: true, trigger: "change", message: "" },
// { validator: (rule, value, callback) => {
// if (/\s/.test(value)) {
// callback(new Error(""));
// } else {
// callback();
// }
// }, trigger: "blur" }]
code: [{ required: true, trigger: "change", message: "请输入验证码" },
{ validator: (rule, value, callback) => {
if (/\s/.test(value)) {
callback(new Error("验证码中不允许包含空格"));
} else {
callback();
}
}, trigger: "blur" }]
},
loading: false,
//

View File

@ -400,6 +400,7 @@ export default {
this.$message.error('请选择需要出场的人员')
return
}
this.uuid = this.ids.join(',')
this.taskId = this.taskId.join(',')
} else {

View File

@ -2243,9 +2243,9 @@ export default {
/** 获取文件数据 */
fileChange(file, fileList) {
//
if (file.size > 1024 * 1024 * 500) {
if (file.size > 1024 * 1024 * 600) {
// 10MB
this.$message.warning('文件大小不能超过500MB')
this.$message.warning('文件大小不能超过600MB')
fileList = fileList.filter(item => item.uid !== file.uid)
}
// fileList

View File

@ -1478,9 +1478,9 @@ export default {
/** 获取文件数据 */
fileChange(file, fileList) {
//
if (file.size > 1024 * 1024 * 500) {
if (file.size > 1024 * 1024 * 600) {
// 10MB
this.$message.warning('文件大小不能超过500MB')
this.$message.warning('文件大小不能超过600MB')
fileList = fileList.filter(item => item.uid !== file.uid)
}
// fileList

View File

@ -481,9 +481,11 @@ export default {
{ label: '经度', prop: 'lon', type: 'input', labelWidth: '120px', disabled: true },
{ label: '纬度', prop: 'lat', type: 'input', labelWidth: '120px', disabled: true }
],
isOne:{
one:false
},
formData: {
proId: undefined,
jlId:undefined,
//
proName: undefined,
@ -599,10 +601,15 @@ export default {
},
'formData.supervisorUnitId'(newVal) {
this.formData.jlId=newVal;
console.log(this.isOne.one,"-->one"
)
if(!this.isOne.one){
this.formData.supervisorUnitUserId='';
this.formData.supervisorUnitUser='';
}else{
this.isOne.one=false;
}
this.supervisorUnitOptions=[];
this.getSupervisionUnit(newVal)
@ -1148,7 +1155,12 @@ export default {
this.loading = true
// TODO
selectProInfoDetails(proId).then(response => {
this.formData = response.projectInfo[0]
this.isOne.one=true;
console.log(5)
console.log( response.projectInfo[0].supervisorUnitUserId)
console.log( response.projectInfo[0].supervisorUnitUser)
console.error(response.projectInfo[0])
this.formData= response.projectInfo[0]
this.loading = false
})
},

View File

@ -38,10 +38,10 @@ module.exports = {
// target: `http://localhost:18080`,
// target: 'http://192.168.0.176:18080',
// target: 'http://192.168.0.58:19090', // 杰
// target: 'http://192.168.0.14:1999/nxdt-api', // 测试环境
//target: 'http://192.168.0.38:18080', // 测试环境
// target: 'http://218.21.27.6:1999/prod-api', // 生产环境
// target: 'http://192.168.0.38:18080', // 郝志权
target: 'http://192.168.2.125:18080', // 梁超
target: 'http://192.168.0.14:38080', // 郝志权
// target: 'http://192.168.2.122:18080', // 梁超
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '',