mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 14:50:25 +08:00
将缓存默认key改为${scheme}://${host}${requestPath}${isArgs}${args}
This commit is contained in:
33
web/public/js/components/common/request-variables.js
Normal file
33
web/public/js/components/common/request-variables.js
Normal file
@@ -0,0 +1,33 @@
|
||||
// 将变量转换为中文
|
||||
Vue.component("request-variables-describer", {
|
||||
data: function () {
|
||||
return {
|
||||
vars:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
update: function (variablesString) {
|
||||
this.vars = []
|
||||
let that = this
|
||||
variablesString.replace(/\${.+?}/g, function (v) {
|
||||
let def = that.findVar(v)
|
||||
if (def == null) {
|
||||
return v
|
||||
}
|
||||
that.vars.push(def)
|
||||
})
|
||||
},
|
||||
findVar: function (name) {
|
||||
let def = null
|
||||
window.REQUEST_VARIABLES.forEach(function (v) {
|
||||
if (v.code == name) {
|
||||
def = v
|
||||
}
|
||||
})
|
||||
return def
|
||||
}
|
||||
},
|
||||
template: `<span>
|
||||
<span v-for="(v, index) in vars"><code-label :title="v.description">{{v.code}}</code-label> - {{v.name}}<span v-if="index < vars.length-1">;</span></span>
|
||||
</span>`
|
||||
})
|
||||
Reference in New Issue
Block a user