图片路径前缀配置

main
xuechunyuan 3 years ago
parent 30bfb682a8
commit 434c8ee1b2
  1. 2
      package.json
  2. 1
      src/config/website.js
  3. 2
      src/option/user/info.js
  4. 2
      src/page/index/top/index.vue
  5. 14
      src/views/articlelist/index.vue
  6. 6
      src/views/system/dept.vue
  7. 4
      src/views/system/user.vue
  8. 152
      src/views/system/userinfo.vue
  9. 5
      vue.config.js

@ -11,7 +11,7 @@
"test:e2e": "vue-cli-service test:e2e"
},
"dependencies": {
"avue-plugin-ueditor": "^0.1.4",
"avue-plugin-ueditor": "^0.1.7",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"classlist-polyfill": "^1.2.0",

@ -48,4 +48,5 @@ export default {
ssoUrl: 'http://localhost:8100/oauth/authorize?client_id=saber&response_type=code&redirect_uri=',
// 单点登录回调地址(Saber服务的地址)
redirectUri: 'http://localhost:1888',
filePrex: 'http://192.168.1.106:9000',//'http://www.qdscgs.com:9091' 图片前缀
}

@ -1,3 +1,4 @@
import website from "../../config/website"
export default {
tabs: true,
tabsActive: 1,
@ -10,6 +11,7 @@ export default {
type: 'upload',
listType: 'picture-img',
propsHttp: {
home: website.filePrex,
res: 'data',
url: 'link',
},

@ -75,7 +75,7 @@
</div>
</el-tooltip>
<img class="top-bar__img"
:src="userInfo.avatar">
:src="userInfo.avatar ? website.filePrex + userInfo.avatar : require('@/assets/image/hospital_logo.png')">
<el-dropdown>
<span class="el-dropdown-link">
{{userInfo.user_name}}

@ -3,7 +3,8 @@
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
@search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
:upload-after="uploadAfter">
<template slot-scope="{row}" slot="menu">
<el-button type="text" icon="el-icon-check" size="small" @click="rowPublish(row)">{{
row.publishSta == 1 ? '取消发布' : row.publishSta == 2 ? '重新发布'
@ -96,8 +97,12 @@ export default {
component: 'AvueUeditor',
overHidden: true,
options: {
customConfig: {
menus: ['head', 'bold', 'fontSize', 'fontName', 'italic', 'underline', 'strikeThrough', 'foreColor', 'backColor', 'link', 'list', 'justify', 'quote', 'emoticon', 'table', 'code', 'undo', 'redo']
},
action: '/api/blade-resource/oss/endpoint/put-file',
props: {
home: this.website.filePrex,
res: "data",
url: "link",
}
@ -105,7 +110,7 @@ export default {
minRows: 12,
span: 24,
formatter: (val) => {
return decodeURIComponent(val.content);
return decodeURIComponent(val.content).replace(/src=\"/gi, 'src="' + this.website.filePrex);
}
},
{
@ -144,6 +149,11 @@ export default {
mounted() {
},
methods: {
//
uploadAfter(res, done) {
console.log(res)
done();
},
//
rowPublish(row) {
this.$confirm("确定" + (row.publishSta == 1 ? "取消发布该条数据吗" : "发布该条数据吗") + "?", {

@ -16,7 +16,7 @@
</el-button>
</template>
<template slot-scope="{row}" slot="imgUrl2">
<img v-if="row.imgUrl" :src="row.imgUrl" style="width:30px;height:30px;"/>
<img v-if="row.imgUrl" :src="website.filePrex + row.imgUrl" style="width:30px;height:30px;"/>
<img v-else src="@/assets/image/hospital_logo.png" style="width:30px;height:30px;"/>
</template>
<template slot-scope="{row}" slot="deptCategory">
@ -80,6 +80,9 @@ export default {
label: "机构logo",
prop: "imgUrl2",
slot: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: "机构logo",
@ -89,6 +92,7 @@ export default {
span: 24,
fileType: 'img',//img/video/audio
propsHttp: {
home: this.website.filePrex,
res: 'data',
url: "link",
},

@ -43,11 +43,11 @@
<template slot-scope="{row}" slot="status">
<el-tag size="small" :type="row.status == 1 ? '' : 'danger'">{{ row.status == 1 ? '启用' : '禁用' }}</el-tag>
</template>
<template slot-scope="scope" slot="menu">
<!-- <template slot-scope="scope" slot="menu">
<el-button type="text" icon="el-icon-circle-plus-outline" size="small"
@click.stop="handleUpdate(scope.row, scope.index)" v-if="userInfo.role_name.includes('admin')">封禁
</el-button>
</template>
</template> -->
<template slot-scope="{row}" slot="status">
<el-tag>{{ row.status == 1 ? '启用' : '封禁' }}</el-tag>
</template>

@ -1,94 +1,92 @@
<template>
<div>
<basic-container>
<avue-form :option="option"
v-model="form"
@tab-click="handleTabClick"
@submit="handleSubmit"></avue-form>
<avue-form :option="option" v-model="form" @tab-click="handleTabClick" @submit="handleSubmit"></avue-form>
</basic-container>
</div>
</template>
<script>
import option from "@/option/user/info";
import {getUserInfo, updateInfo, updatePassword} from "@/api/system/user";
import md5 from 'js-md5';
import func from "@/util/func";
import option from "@/option/user/info";
import { getUserInfo, updateInfo, updatePassword } from "@/api/system/user";
import md5 from 'js-md5';
import func from "@/util/func";
export default {
data() {
return {
index: 0,
option: option,
form: {}
};
},
created() {
this.handleWitch();
export default {
data() {
return {
index: 0,
option: option,
form: {}
};
},
created() {
this.handleWitch();
},
methods: {
handleSubmit(form, done) {
if (this.index === 0) {
updateInfo(form).then(res => {
if (res.data.success) {
this.$message({
type: "success",
message: "修改信息成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
done();
}, error => {
window.console.log(error);
done();
})
} else {
updatePassword(md5(form.oldPassword), md5(form.newPassword), md5(form.newPassword1)).then(res => {
if (res.data.success) {
this.$message({
type: "success",
message: "修改密码成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
done();
}, error => {
window.console.log(error);
done();
})
}
},
methods: {
handleSubmit(form, done) {
if (this.index === 0) {
updateInfo(form).then(res => {
if (res.data.success) {
this.$message({
type: "success",
message: "修改信息成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
done();
}, error => {
window.console.log(error);
done();
})
} else {
updatePassword(md5(form.oldPassword), md5(form.newPassword), md5(form.newPassword1)).then(res => {
if (res.data.success) {
this.$message({
type: "success",
message: "修改密码成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
done();
}, error => {
window.console.log(error);
done();
})
}
},
handleWitch() {
if (this.index === 0) {
getUserInfo().then(res => {
const user = res.data.data;
this.form = {
id: user.id,
avatar: user.avatar,
name: user.name,
realName: user.realName,
phone: user.phone,
email: user.email,
}
});
}
},
handleTabClick(tabs) {
this.index = func.toInt(tabs.index);
this.handleWitch();
handleWitch() {
if (this.index === 0) {
getUserInfo().then(res => {
const user = res.data.data;
this.form = {
id: user.id,
avatar: user.avatar,
name: user.name,
realName: user.realName,
phone: user.phone,
email: user.email,
}
});
}
},
handleTabClick(tabs) {
this.index = func.toInt(tabs.index);
this.handleWitch();
}
};
}
};
</script>
<style>
</style>

@ -26,8 +26,9 @@ module.exports = {
proxy: {
"/api": {
//本地服务接口地址
target: "http://192.168.1.3:8080",
// target: "http://192.168.1.106",
// target: "http://www.qdscgs.com:80",//生成
// target: "http://192.168.1.3:8080",
target: "http://192.168.1.106",
//远程演示服务地址,可用于直接启动项目
// target: 'https://saber.bladex.vip/api',
ws: true,

Loading…
Cancel
Save