Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目很棒,可以建一个交流群 #4

Open
eryajf opened this issue Mar 31, 2022 · 5 comments
Open

项目很棒,可以建一个交流群 #4

eryajf opened this issue Mar 31, 2022 · 5 comments

Comments

@eryajf
Copy link

eryajf commented Mar 31, 2022

如题。
目前感觉文档几乎没有,不太利于新人上手。
另外希望能有个交流群,大家一起交流学习。

@eryajf
Copy link
Author

eryajf commented Mar 31, 2022

如果有新的同学,可以一起交流。

@eryajf
Copy link
Author

eryajf commented Mar 31, 2022

个人整理前后端开发调试流程:

后端

首先将项目克隆到本地,然后检测依赖:

$ git clone https://github.com/gnimli/go-web-mini.git
$ cd go-web-mini
$ go mod tidy

然后根据实际情况,在config.yaml中配置数据库连接信息,注意需要先创建数据库。

然后要注意一个细节,读取配置文件的时候,需要稍微调整下:

viper.AddConfigPath(workDir + "./")

更改如下viper.AddConfigPath(workDir + "/")

否则运行时会报如下错误:

$ go run main.go 
2022/03/31 13:07:13 error: Config File "config" Not Found in "[/Users/eryajf/code/github/go-web-mini.]"
panic: 读取配置文件失败:Config File "config" Not Found in "[/Users/eryajf/code/github/go-web-mini.]" 


goroutine 1 [running]:
go-web-mini/config.InitConfig()
        /Users/eryajf/code/github/go-web-mini/config/config.go:54 +0x29d
main.main()
        /Users/eryajf/code/github/go-web-mini/main.go:21 +0x45
exit status 2

全部配置完毕之后,就可以直接运行启动了。

启动之后会自动将一些初始数据同步到数据库,因此,只要后端能正常启动,那么就没啥问题,可以投入使用了。

前端

一样,先将代码克隆到本地:

$ git clone https://github.com/gnimli/go-web-mini-ui.git
$ cd go-web-mini-ui

需要注意,前端的项目不能直接运行如下命令启动:

$ yarn
$ yarn dev

否则启动时总会报如下的错误:

$ yarn dev
yarn run v1.22.18
$ vue-cli-service serve
 INFO  Starting development server...
98% after emitting CopyPlugin

 ERROR  Failed to compile with 8 errors                                                                                                               上午10:55:21

These dependencies were not found:

* core-js/modules/es.error.cause.js in ./node_modules/@babel/runtime/helpers/nonIterableRest.js, ./node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js and 4 others
* core-js/modules/es.regexp.dot-all.js in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ThemePicker/index.vue?vue&type=script&lang=js&, ./src/utils/index.js

To install them, you can run: npm install --save core-js/modules/es.error.cause.js core-js/modules/es.regexp.dot-all.js

查网上资料说,core-js模块儿版本的问题,此时可以先将package.json中的版本调整如下,然后再次安装依赖。

$ cat package.json | grep core-js
    "core-js": "^3.8.1",

记得先清空node_modules,然后再运行如下命令:

$ yarn
$ yarn dev

这样项目就跑起来了,默认用户名密码为admin:123456,可以直接访问看效果。

@eryajf
Copy link
Author

eryajf commented Apr 1, 2022

本地请求调试的过程中,最好先通过web端,输入用户名密码进行登陆,然后会生成对应的cookie,即可调试。

注意请求时还要对应header配置,以及cookie两项配置方可通过工具请求接口调试。

header内容如下:

image

从这里获取:

image

cookie的配置如下:

image

从这里获取:

image

@ericdai
Copy link

ericdai commented May 21, 2022

有QQ群最好 另外希望支持postgresql 这样就可以支持很多国产数据库

@qishu321
Copy link

有群了麻烦告知我下,项目确实很不错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants