master
xy 3 years ago
parent 3373b1b0d1
commit 5b3cd3f923

@ -5,3 +5,4 @@ ENV = 'development'
VUE_APP_BASE_API = http://weiyuan-ziliao-test.ali251.langye.net VUE_APP_BASE_API = http://weiyuan-ziliao-test.ali251.langye.net
VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file
VUE_APP_AUTH_BASE_API = https://sso.szhct.edu.cn/cas/oauth2.0/authorize VUE_APP_AUTH_BASE_API = https://sso.szhct.edu.cn/cas/oauth2.0/authorize
VUE_APP_VIEW_API=http://view.ali251.langye.net:8012/onlinePreview

@ -1,7 +1,11 @@
# just a flag # just a flag
ENV = 'production' ENV='production'
# base api # base api
VUE_APP_BASE_API = http://weiyuan-ziliao-test.ali251.langye.net #VUE_APP_BASE_API=http://192.168.105.242
VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file VUE_APP_BASE_API = https://zlhb.szhct.edu.cn
VUE_APP_AUTH_BASE_API = https://sso.szhct.edu.cn/cas/oauth2.0/authorize #VUE_APP_UPLOAD_API=http://192.168.105.242/api/admin/upload-file
VUE_APP_UPLOAD_API = https://zlhb.szhct.edu.cn/api/admin/upload-file
VUE_APP_AUTH_BASE_API=https://sso.szhct.edu.cn/cas/oauth2.0/authorize
#VUE_APP_AUTH_BASE_API = https://zlhb.szhct.edu.cn/cas/oauth2.0/authorize
VUE_APP_VIEW_API=https://zlhbview.szhct.edu.cn/onlinePreview

@ -87,7 +87,6 @@
}, },
methods: { methods: {
handleImgUpload(blobInfo, success, failure) { handleImgUpload(blobInfo, success, failure) {
console.log("我要上传", blobInfo);
let self = this; let self = this;
let file = blobInfo.blob(); let file = blobInfo.blob();
const isLt2M = file.size / 1024 < 2048; const isLt2M = file.size / 1024 < 2048;
@ -100,6 +99,7 @@
uploads(formdate).then(res => { uploads(formdate).then(res => {
if (res) { if (res) {
let url = res.url; let url = res.url;
console.log(url,333)
success(url); //url success(url); //url
} else { } else {
failure(res.errmsg); failure(res.errmsg);

@ -33,7 +33,9 @@ router.beforeEach(async(to, from, next) => {
}) })
} else { } else {
let redirectUri = encodeURIComponent(window.location.href) let redirectUri = encodeURIComponent(window.location.href)
window.location.href = `${process.env.VUE_APP_AUTH_BASE_API}?client_id=d05e4c9d07f705ef&redirect_uri=${redirectUri}&response_type=code&scope=base_api&state=wyd` let client_id = 'db85478e4dd36937'
//let client_id = 'd05e4c9d07f705ef' dev
window.location.href = `${process.env.VUE_APP_AUTH_BASE_API}?client_id=${client_id}&redirect_uri=${redirectUri}&response_type=code&scope=base_api&state=wyd`
} }
} }

@ -398,7 +398,7 @@ export default {
res[i._relations.link_with_name] instanceof Array res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => { ? res[i._relations.link_with_name].map((i) => {
return { return {
name: i?.name, name: i?.original_name,
url: i?.url, url: i?.url,
response: i, response: i,
}; };

@ -620,7 +620,7 @@ export default {
prop: i.field, prop: i.field,
label: i.name, label: i.name,
width: i.width, width: i.width,
fixed: i.field === 'biaoti' ? 'left' : 'center', align: i.field === 'biaoti' ? 'left' : 'center',
}, },
linkOb linkOb
); );

@ -14,6 +14,7 @@
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-success="onSuccess" :on-success="onSuccess"
:on-remove="onRemove" :on-remove="onRemove"
multiple
:on-error="onError"> :on-error="onError">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="$refs['upload'].submit()"></el-button> <el-button style="margin-left: 10px;" size="small" type="success" @click="$refs['upload'].submit()"></el-button>
@ -83,7 +84,13 @@ export default {
watch: { watch: {
'form.id_material_fujian_uploads_material_id_relation': { 'form.id_material_fujian_uploads_material_id_relation': {
handler (newVal) { handler (newVal) {
this.fileList = newVal this.fileList = newVal.map(i => {
return {
name: i?.original_name,
url: i?.url,
response: i,
}
})
}, },
deep: true deep: true
} }

@ -97,7 +97,7 @@ export default {
}).catch(err => this.loading = false) }).catch(err => this.loading = false)
}, },
open(e) { open(e) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent( this.codeUri = `${process.env.VUE_APP_VIEW_API}?url=${encodeURIComponent(
new Buffer(e.url).toString("base64") new Buffer(e.url).toString("base64")
)}`; )}`;
@ -166,6 +166,9 @@ export default {
position: relative; position: relative;
left: 50%; left: 50%;
} }
.content {
overflow: scroll;
}
.file { .file {
margin-top: 10px; margin-top: 10px;

@ -250,7 +250,7 @@ export default {
}, },
methods: { methods: {
open (e) { open (e) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent(new Buffer(e.url).toString('base64'))}` this.codeUri = `${process.env.VUE_APP_VIEW_API}?url=${encodeURIComponent(new Buffer(e.url).toString('base64'))}`
this.showModal = true this.showModal = true
//window.open(`http://view.ali251.langye.net:8012/onlinePreview?url=${codeUri}`) //window.open(`http://view.ali251.langye.net:8012/onlinePreview?url=${codeUri}`)

@ -57,7 +57,7 @@
:command="item" :command="item"
v-for="item in uploadsList" v-for="item in uploadsList"
> >
{{ item.name }} {{ item.original_name }}
</el-dropdown-item> </el-dropdown-item>
</template> </template>
<template v-else> <template v-else>
@ -236,7 +236,7 @@ export default {
}, },
open(e) { open(e) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent( this.codeUri = `${process.env.VUE_APP_VIEW_API}?url=${encodeURIComponent(
new Buffer(e.url).toString("base64") new Buffer(e.url).toString("base64")
)}`; )}`;

Loading…
Cancel
Save