文件访问地址统一加到proxy
This commit is contained in:
parent
81f93e8366
commit
61be5baacf
@ -3,7 +3,7 @@ ENV = 'development'
|
|||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = '/dev-api'
|
VUE_APP_BASE_API = '/dev-api'
|
||||||
FILE_SERVER_URL = 'http://localhost:10010/'
|
VUE_APP_BASE_FILE_API = '/dev-file'
|
||||||
|
|
||||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||||
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
||||||
|
|||||||
@ -3,4 +3,4 @@ ENV = 'production'
|
|||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = '/prod-api'
|
VUE_APP_BASE_API = '/prod-api'
|
||||||
|
VUE_APP_BASE_FILE_API = '/prod-file'
|
||||||
|
|||||||
@ -39,11 +39,6 @@
|
|||||||
@click="newFolderNameClick"
|
@click="newFolderNameClick"
|
||||||
>
|
>
|
||||||
</el-button>
|
</el-button>
|
||||||
<!--<el-button-->
|
|
||||||
<!--slot="append"-->
|
|
||||||
<!--class="el-icon-bottom-left"-->
|
|
||||||
<!-->-->
|
|
||||||
<!--</el-button>-->
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</form>
|
</form>
|
||||||
</a>
|
</a>
|
||||||
@ -207,7 +202,7 @@
|
|||||||
<script>
|
<script>
|
||||||
// import MenuPopover from '@/components/popover/MenuPopover'
|
// import MenuPopover from '@/components/popover/MenuPopover'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import defaultSettings from '@/settings'
|
// import defaultSettings from '@/settings'
|
||||||
import { getPath, getPathList, setPath, removePath } from '@/utils/path'
|
import { getPath, getPathList, setPath, removePath } from '@/utils/path'
|
||||||
import Bus from '@/assets/js/bus'
|
import Bus from '@/assets/js/bus'
|
||||||
import api from '@/api/upload-api'
|
import api from '@/api/upload-api'
|
||||||
@ -741,7 +736,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
fileIds.push(this.selectRowData[0].id)
|
fileIds.push(this.selectRowData[0].id)
|
||||||
}
|
}
|
||||||
window.open(defaultSettings.FILE_SERVER_URL + 'download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self')
|
window.open(process.env.VUE_APP_BASE_FILE_API + 'download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self')
|
||||||
break
|
break
|
||||||
case 'remove':
|
case 'remove':
|
||||||
console.log('operation', '删除')
|
console.log('operation', '删除')
|
||||||
@ -821,7 +816,7 @@ export default {
|
|||||||
this.getFileList()
|
this.getFileList()
|
||||||
} else {
|
} else {
|
||||||
const fileIds = [row.id]
|
const fileIds = [row.id]
|
||||||
const url = defaultSettings.FILE_SERVER_URL + 'preview/' + row.name + '?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds
|
const url = process.env.VUE_APP_BASE_FILE_API + 'preview/' + row.name + '?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds
|
||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,14 @@ module.exports = {
|
|||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
[process.env.VUE_APP_BASE_FILE_API]: {
|
||||||
|
target: 'http://localhost:10010/',
|
||||||
|
// target: `http://127.0.0.1:${port}/mock`,
|
||||||
|
changeOrigin: true,
|
||||||
|
pathRewrite: {
|
||||||
|
['^' + process.env.VUE_APP_BASE_FILE_API]: ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// before: require('./mock/mock-server.js')
|
// before: require('./mock/mock-server.js')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user