基于 Beego + Vue 开发的在线问答社区 - 暗黑系风格
source link: https://studygolang.com/articles/16199?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
项目地址:
演示地址:http://goaio.vip
介绍
基于 Beego + Vue 开发的在线问答系统。
功能
- [x] 邮箱注册
- [x] 邮件密码找回
- [x] 会员邮件激活
- [x] markdown内容提问和回答
- [x] XSS安全过滤
- [x] Vue前端小组件
- [x] 完善的会员功能体系
- [x] 后台前后端分离
- [x] API接口
- [x] 程序/数据库定时备份
- [x] ENV环境配置
- [ ] 单元测试
依赖
| 库 | 介绍 |
| --- | --- |
| github.com/astaxie/beego
| Beego框架 |
| github.com/go-sql-driver/mysql
| Mysql库 |
| github.com/russross/blackfriday
| Markdown解析库 |
| github.com/joho/godotenv
| ENV文件读取 |
| github.com/dchest/captcha
| 图形验证码 |
License
GOA采用 MIT 开源许可证,你可以在商业项目中免费使用 GOA 或者基于 GOA 二次 开发而不必支付费用。
安装
拉取代码
go get github.com/Qsnh/goa
安装数据表
将 data
下面的SQL文件导入到数据库中
配置文件
cp .env.example .env
打开 .env
文件,配置相关的信息,如:数据库的链接信息,阿里云的邮件配置,自动备份存储路径等。
编译运行
cd ~/go/src/github.com/Qsnh/goa go build -o goa main.go
后台地址
在访问后台地址前,你需要配置下跨域配置,这个在 .env
文件中的 CORS_ORIGINAL
中。
另外你需要到 static/backend
下面这样操作:
npm install npm build
之后你可以访问下面的地址了:
https://youdomain.app/static/backend/dist/index.html
管理员的账户和密码你可以在 .env
文件中配置:
ADMIN_USER= ADMIN_PASS=
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK