许多第三方Python模块都有一个属性,它保存模块的版本信息(通常类似于module.VERSION或者module.__version__),但有些则没有.
这些模块的特定示例是libxslt和libxml2.
我需要检查在运行时是否正在使用这些模块的正确版本.有没有办法做到这一点?
一个潜在的解决方案是在运行时读取源代码,哈希它,然后将它与已知版本的哈希值进行比较,但那是令人讨厌的.
有更好的解决方案吗?
axios 未使用 nuxt.config.js 中的 baseURL 和 browserBaseURL 的 axios 设置,并且请求将转至 localhost。
这是 nuxt.config.js 的摘录:
modules: [
'@nuxtjs/axios'
],
axios: {
baseURL: 'http://192.168.8.137:8081',
browserBaseURL: 'http://192.168.8.137:8081'
},
Run Code Online (Sandbox Code Playgroud)
这是 vue 文件中的代码:
<template>
<v-treeview
v-model="tree"
:open="open"
:items="items"
activatable
item-key="id"
:load-children="listDir"
:active.sync="active"
return-object
>
....
</template>
<script>
import axios from 'axios'
export default {
....
methods: {
async listDir(item) {
// let url = 'http://192.168.8.137:8081/filemanager/ls' // Works fine if hardcoded here
let url = '/filemanager/ls'
await axios.get(url)
.then(....
Run Code Online (Sandbox Code Playgroud)
我认为问题是我使用的是 axios.get(url) 而不是 $this.axios.get(url),但是我的方法是从 vuetify treeview 组件调用的,而 …