8000 项目很棒,可以建一个交流群 · Issue #4 · gnimli/go-web-mini · GitHub
[go: up one dir, main page]

Skip to content

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

Open

Description

@eryajf

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

Activity

  1. eryajf commented on Mar 31, 2022

    @eryajf
    Author

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

  2. eryajf commented on Mar 31, 2022

    @eryajf
    Author

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

    后端

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

    $ 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,可以直接访问看效果。

  3. eryajf commented on Apr 1, 2022

    @eryajf
    Author

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

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

    header内容如下:

    image

    从这里获取:

    image

    cookie的配置如下:

    image

    从这里获取:

    image

  4. ericdai commented on May 21, 2022

    @ericdai

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

  5. qishu321 commented on Nov 18, 2022

    @qishu321

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

  6. shinhaoting commented on May 8, 2025

    @shinhaoting

    基于这个项目,我把项目前端升级到vue3 typescript,项目地址在https://gitcode.com/xiayang/gin-mini-admin.git 欢迎大家一起完善这个项目

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0