Skip to content

Commit

Permalink
修复没有自动建表的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiandanin committed Mar 25, 2019
1 parent 69f64a6 commit 5e677c6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions javascript/github/all-tag.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--在这里改 不会生效-->
<el-dialog title="所有标签" :visible.sync="dialogVisible" width="85%" top="10vh" center append-to-body>
<div v-loading="loading" style="min-height: 500px">
<template v-for="item in tags">
Expand Down
21 changes: 20 additions & 1 deletion javascript/github/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ var _create_search_dom = function (el) {
var that = this;
return h('a', {
attrs: {
id:"search_by_tag",
id: "search_by_tag",
class: "btn",
href: "#",
style: "margin-right:8px;margin-left:8px;float: left;"
Expand Down Expand Up @@ -555,10 +555,29 @@ function get_tags_by_project_name(project_name, callback) {
}
}).catch(err => {
console.log(err)
errorInitProjectTags(err, project_name)
});
})
}

/**
* 如果出现没有表的错误 就手动建表
* @param err
* @param project_name
*/
function errorInitProjectTags(err, project_name) {
if (err.code == 101) {
const query = Bmob.Query("project_tags");
query.set('tag_name_array', "[]")
query.set("project_name", project_name)
query.save().then(obj => {
console.log("手动建表--->" + JSON.stringify(obj))
}).catch(err => {
console.log("手动建表--->" + err)
})
}
}

/**
* 保存项目标签
* @param project_name
Expand Down
1 change: 1 addition & 0 deletions javascript/github/search.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--在这里改 不会生效-->
<div class="search-result-container">
<div class="col-12 d-block width-full py-4 border-bottom" v-for="item in items">
<div class="d-inline-block mb-1">
Expand Down
2 changes: 1 addition & 1 deletion javascript/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var btn_edit_id = "btn-edit-appid";
var old_version_id = "div-old-version";
var show_stars_tags = "show-stars-tags";

var current_version = "1.1.1"
var current_version = "1.1.2"

window.onload = function () {
chrome.storage.sync.get("is_migrate", function (rsp) {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "GithubTags",
"version": "1.1.1",
"version": "1.1.2",
"description": "给Github项目添加标签,支持按标签搜索,支持数据云同步",
"manifest_version": 2,
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion update.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.1.1","message":"增加查看所有标签的功能","link":"https://github.com/dengyuhan/github-tags#%E6%9B%B4%E6%96%B0%E8%AF%B4%E6%98%8E"}
{"version":"1.1.2","message":"修复没有自动建表的问题","link":"https://github.com/dengyuhan/github-tags#%E6%9B%B4%E6%96%B0%E8%AF%B4%E6%98%8E"}

0 comments on commit 5e677c6

Please sign in to comment.