添加必填校验和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' import { getToDoNum } from '@/api/system/notice'
export function lookFile() { 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://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() { 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://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() { 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://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() { export function lookMioIoFile() {
// return 'http://218.21.27.6:19090/nxdt-courseware' //生产服务器 return 'http://218.21.27.6:19090/nxdt-courseware' //生产服务器
return 'http://192.168.0.14:9090/nxdt-courseware-1' //14服务器 // return 'http://192.168.0.14:9090/nxdt-courseware-1' //14服务器
} }
// lookFile: 'http://218.21.27.6:1999/nxnyback/statics', // lookFile: 'http://218.21.27.6:1999/nxnyback/statics',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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