Skip to content

Commit

Permalink
fix 修改请求地址无效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleBing committed Jan 24, 2024
1 parent ae7549b commit 8899679
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

## v1.24 `2024-01-24`
- fix 修改请求地址无效的问题

## v1.22 `2023-11-10`
- fix 扩展词库类别有重复的问题
- 添加全局快捷键调起程序 ctrl + shift + alt + i
Expand Down
4 changes: 2 additions & 2 deletions js/Dict.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Dict {
this.isGroupMode = this.header.includes('dict_grouped: true') // 根据有没有这一段文字进行判断,是否为分组形式的码表
let body = fileContent.substring(this.indexEndOfHeader)
this.wordsOrigin = this.isGroupMode? this.getDictWordsInGroupMode(body): this.getDictWordsInNormalMode(body)
console.log('处理后的词条:',this.wordsOrigin)
// console.log('处理后的词条:',this.wordsOrigin)
}
}
// 总的词条数量
Expand Down Expand Up @@ -75,7 +75,7 @@ class Dict {

// 返回 word 分组
getDictWordsInGroupMode(fileContent){
console.log(fileContent)
// console.log(fileContent)
let startPoint = new Date().getTime()
fileContent = fileContent.replace(/\r\n/g,'\n')
let lines = fileContent.split(EOL) // 拆分词条与编码成单行
Expand Down
4 changes: 2 additions & 2 deletions js/Global.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const IS_IN_DEVELOP = false // 生产
// const IS_IN_DEVELOP = true // 开发
// const IS_IN_DEVELOP = false // 生产
const IS_IN_DEVELOP = true // 开发

const DEFAULT_BASE_URL = 'http://kylebing.cn/portal/'
// const BASE_URL = 'http://localhost:3000/'
Expand Down
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ function createMainWindow() {

let config = readConfigFile() // 没有配置文件时,返回 false

console.log('config: ', config)
wubiApi
.pushDictFileContent(
userInfo,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wubi-dict-editor",
"version": "1.2.3",
"version": "1.2.4",
"private": true,
"author": {
"name": "KyleBing",
Expand Down Expand Up @@ -34,7 +34,7 @@
"config": {
"forge": {
"packagerConfig": {
"appVersion": "1.2.3",
"appVersion": "1.2.4",
"name": "五笔码表助手",
"appCopyright": "[email protected]",
"icon": "./assets/img/appIcon/appicon",
Expand Down
9 changes: 5 additions & 4 deletions view/index/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ const app = {
wubiApi
.checkDictFileBackupExistence(this.config.userInfo, {
fileName: this.dict.fileName
})
}, this.config.baseURL)
.then(res => {
this.dictBackupInfo = res.data
/* {
Expand All @@ -282,7 +282,7 @@ const app = {
// 获取线上的扩展词库分类列表
getOnlineCategories(){
wubiApi
.getCategories(this.config.userInfo)
.getCategories(this.config.userInfo, this.config.baseURL)
.then(res => {
this.categories = res.data
})
Expand Down Expand Up @@ -311,7 +311,7 @@ const app = {
{
category_id: this.selectedCategoryId,
words: wordsSelected
})
}, this.config.baseURL)
.then(res => {
let message = `添加 ${res.data.addedCount} 条`
if (res.data.existCount > 0){
Expand All @@ -332,8 +332,9 @@ const app = {
// 下载线上扩展词库到本地
updateExtraDict(){
if (this.config.userInfo.password){
console.log('config: ', this.config)
wubiApi
.pullExtraDict(this.config.userInfo)
.pullExtraDict(this.config.userInfo, this.config.baseURL)
.then(res => {
this.tips.push('获取线上分类扩展词库内容成功')

Expand Down

0 comments on commit 8899679

Please sign in to comment.