Changed: npm search api url

This commit is contained in:
Molunerfinn
2018-10-12 14:56:25 +08:00
parent ea5b937c93
commit 094b83b30b
5 changed files with 6 additions and 21 deletions

View File

@@ -250,7 +250,7 @@ export default {
},
confirmKeyBinding () {
const oldKey = this.$db.read().get('settings.shortKey').value()
this.db.read().set('settings.shortKey', this.shortKey).write()
this.$db.read().set('settings.shortKey', this.shortKey).write()
this.keyBindingVisible = false
this.$electron.ipcRenderer.send('updateShortKey', oldKey)
},
@@ -261,7 +261,7 @@ export default {
confirmCustomLink () {
this.$refs.customLink.validate((valid) => {
if (valid) {
this.db.read().set('settings.customLink', this.customLink.value).write()
this.$db.read().set('settings.customLink', this.customLink.value).write()
this.customLinkVisible = false
this.$electron.ipcRenderer.send('updateCustomLink')
} else {

View File

@@ -233,9 +233,10 @@ export default {
}
},
getSearchResult: function (val) {
this.$http.get(`https://api.npms.io/v2/search?q=${val}`)
// this.$http.get(`https://api.npms.io/v2/search?q=${val}`)
this.$http.get(`https://registry.npmjs.com/-/v1/search?text=${val}`)
.then(res => {
this.pluginList = res.data.results.map(item => {
this.pluginList = res.data.objects.map(item => {
return this.handleSearchResult(item)
})
this.loading = false