图片上传及头像
This commit is contained in:
parent
2c92f4dd3d
commit
49e80e1f1c
|
|
@ -5,7 +5,7 @@
|
||||||
"author": "机具",
|
"author": "机具",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
||||||
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
||||||
"build:stage": "vue-cli-service build --mode staging",
|
"build:stage": "vue-cli-service build --mode staging",
|
||||||
"preview": "node build/index.js --preview",
|
"preview": "node build/index.js --preview",
|
||||||
|
|
|
||||||
|
|
@ -273,8 +273,8 @@ export default {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
//上传地址
|
//上传地址
|
||||||
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
||||||
uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
||||||
|
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
contractCode: [
|
contractCode: [
|
||||||
|
|
|
||||||
|
|
@ -338,6 +338,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="dialogList" height="500px">
|
<el-table v-loading="loading" :data="dialogList" height="500px">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
<el-table-column label="序号" sortable align="center" type="index" />
|
<el-table-column label="序号" sortable align="center" type="index" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="类型名称"
|
label="类型名称"
|
||||||
|
|
|
||||||
|
|
@ -309,8 +309,8 @@ export default {
|
||||||
field101fileList:[],
|
field101fileList:[],
|
||||||
//上传地址
|
//上传地址
|
||||||
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
||||||
uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
||||||
// uploadUrl:'http://10.40.92.102:9201',//本地测试
|
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
||||||
dialogImageUrl: '',
|
dialogImageUrl: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
//--------------
|
//--------------
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,8 @@ export default {
|
||||||
field101fileList:[],
|
field101fileList:[],
|
||||||
//上传地址
|
//上传地址
|
||||||
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
||||||
uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
||||||
// uploadUrl:'http://192.168.5.12:9201',//本地测试
|
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
dictName: [
|
dictName: [
|
||||||
|
|
|
||||||
|
|
@ -458,8 +458,9 @@ export default {
|
||||||
field101fileList:[],
|
field101fileList:[],
|
||||||
//上传地址
|
//上传地址
|
||||||
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
||||||
uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
||||||
// uploadUrl:'http://192.168.5.12:9201',//本地测试
|
// uploadUrl:'http://192.168.5.12:9201',//本地测试
|
||||||
|
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: "children",
|
children: "children",
|
||||||
label: "label"
|
label: "label"
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,11 @@ export default {
|
||||||
uploadImg() {
|
uploadImg() {
|
||||||
this.$refs.cropper.getCropBlob(data => {
|
this.$refs.cropper.getCropBlob(data => {
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
|
// console.log(data)
|
||||||
|
// console.log(formData)
|
||||||
formData.append("avatarfile", data);
|
formData.append("avatarfile", data);
|
||||||
|
formData.append("fileType", 'user');
|
||||||
|
// console.log(formData)
|
||||||
uploadAvatar(formData).then(response => {
|
uploadAvatar(formData).then(response => {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
|
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue