Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
🐛 backend_url
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jan 12, 2021
1 parent f429fbc commit b4a62d0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NODE_ENV = 'development'

VUE_APP_API_URL = '/api/'
VUE_APP_API_URL = './'
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NODE_ENV = 'production'

VUE_APP_API_URL = '/api/'
VUE_APP_API_URL = './'
2 changes: 1 addition & 1 deletion src/utils/get_url.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export const getUrl=(full_url)=>{
full_url=window.location.href
}
let url_arr=full_url.split('/')
return url_arr.slice(0,3).join('/')
return url_arr.slice(0,3).join('/')+'/'
}
2 changes: 1 addition & 1 deletion src/utils/request.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'

const instance = axios.create({
baseURL: process.env.VUE_APP_API_URL,
baseURL: process.env.VUE_APP_API_URL+'api/',
// timeout: 5000
headers: {
'Content-Type': "application/json;charset=utf-8"
Expand Down
6 changes: 3 additions & 3 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default {
this.loadJS(this.info.script)
}
this.info.url=window.location.href
this.info.backend_url=process.env.VUE_APP_API_URL!='/api/'?getUrl(process.env.VUE_APP_API_URL):getUrl()
this.info.backend_url=process.env.VUE_APP_API_URL!='./'?process.env.VUE_APP_API_URL:getUrl()
}else{
this.$msg.error(res.meta.msg)
}
Expand Down Expand Up @@ -429,7 +429,7 @@ export default {
showOther(file){
if (this.info.preview.extensions.includes(file.file_extension)) {
if (file.size<=this.info.preview.max_size) {
let direct_url=this.info.backend_url+"/d/"+this.file_id+'/'+file.name
let direct_url=this.info.backend_url+"d/"+this.file_id+'/'+file.name
for(const v of this.info.preview.pre_process){
switch (v){
case 'base64':
Expand Down Expand Up @@ -474,7 +474,7 @@ export default {
this.$router.go(-1)
},
copyFileLink(){
let content=this.info.backend_url+"/d/"+this.file_id
let content=this.info.backend_url+"d/"+this.file_id
copyToClip(content)
this.$msg.success('链接已复制到剪贴板.');
},
Expand Down

1 comment on commit b4a62d0

@vercel
Copy link

@vercel vercel bot commented on b4a62d0 Jan 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.