Skip to content

Commit

Permalink
添加分词字典,优化学习与回复功能
Browse files Browse the repository at this point in the history
  • Loading branch information
gutrse3321 committed Jun 17, 2018
1 parent 4045076 commit 12dfc53
Show file tree
Hide file tree
Showing 5 changed files with 229 additions and 149 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"axios": "^0.16.1",
"fs-extra": "^6.0.1",
"lowdb": "^1.0.0",
"segment": "^0.1.3",
"vue": "^2.3.3",
"vue-electron": "^1.0.6",
"vue-router": "^2.5.3",
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import db from '../datastore'
import App from './App'
import router from './router'
import store from './store'
import Segment from 'segment'
const segment = new Segment()
segment.useDefault()

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
Expand All @@ -24,6 +27,8 @@ Vue.directive('focus', {

// 注册全局$db
Vue.prototype.$db = db
// 注册全局$dictionary 分词字典
Vue.prototype.$dictionary = segment

/* eslint-disable no-new */
new Vue({
Expand Down
20 changes: 3 additions & 17 deletions src/renderer/store/modules/Counter.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
const state = {
main: 0
}
const state = {}

const mutations = {
DECREMENT_MAIN_COUNTER (state) {
state.main--
},
INCREMENT_MAIN_COUNTER (state) {
state.main++
}
}
const mutations = {}

const actions = {
someAsyncTask ({ commit }) {
// do something async
commit('INCREMENT_MAIN_COUNTER')
}
}
const actions = {}

export default {
state,
Expand Down
Loading

0 comments on commit 12dfc53

Please sign in to comment.