diff --git a/README.md b/README.md index 05dc909a..952bb351 100644 --- a/README.md +++ b/README.md @@ -30,20 +30,43 @@ Yi框架最新版本标签:`v3.0.0`,具体版本可以查看标签迭代 **分支:** -(本项目由EFCore版本历经3年不断迭代至Sqlsugar版本,现EFcore版本已弃用,目前sqlsugar已带业务功能) +(本项目由EFCore版本历经4年不断迭代至Sqlsugar版本,现EFcore版本已弃用,目前sqlsugar已带业务功能) -- **Framework**: 框架分支,所有东西都在这里 +- (推荐) **Furion**: 基于Furion分支,回归开发本质,极度简单,用起来贼爽 -- **Furion**: 基于Furion分支,回归开发本质,极度简单,用起来贼爽 +- ~~**Framework**~~: 框架分支,所有东西都在这里 - ~~**SqlSugar**:.Net6 DDD领域驱动设计 简单分层微服务架构~~ - ~~**SqlSugar-Dev**:为sqlsugar分支的实时开发版本~~ -- ~~**ec**: EFcore完整电商项目~~ +- ~~**abp**:基于abp.vnext项目~~ **** +**目录:** + +Yi后端框架分为3个部分: + +- Infrastructure(基础设施,框架底层+sqlsugar+furion) +- Module(应用模块,可选项,例如缓存模块、微信模块、文件模块、日志模块等) +- Application(业务模块,用于开发) + +另外,光说不练假把式,我们不仅仅提供一个空白的框架,还同时提供3个基于yi框架的业务模块,没有听错,目前为1个后端,支持3个前端。各个模块关系解耦,可单独使用其中的任意业务模块 + +- Yi.RuoYi.Vue3:Ruoyi后台管理系统Rbac Vue3前端(推荐) + +- Yi.Furion.Net6:.NET6后端(推荐) + +- Yi.App.Vue3:移动端App Vue3前端 + +- Yi.BBS.Vue3:Web网页端BBS论坛 Vue3+Ts前端 + +后续我们持续更新各大应用模块及业务模块:shop商场、erp进销存、mes工厂系统等 + +业务支持并扩展至各个领域,用于具体项目的二次开发极大复用后端代码及前端代码,以通用的部分+不通的部分快速二开 + + ### 演示地址: 废话少说直接上地址,**请不要**更改里面的数据 @@ -54,14 +77,15 @@ Bbs社区系统:[ccnetcore.com](https://ccnetcore.com) (已上线,欢迎加 Rbac后台管理系统:[yi.ccnetcore.com](http://yi.ccnetcore.com) (已上线)~~管理员账号:cc 、 123456~~ -网关地址:~~[gate.ccnetcore.com/swagger](http://gate.ccnetcore.com/swagger)~~(目前使用单体架构) +App移动端系统:[xxx](xxx)正在部署 + +网关地址:~~[gate.ccnetcore.com/swagger](http://gate.ccnetcore.com/swagger)~~(目前使用单体架构部署,无需网关) ### 支持: - [x] 完全支持单体应用架构 - [x] 完全支持分布式应用架构 - [x] 完全支持微服务架构 -- [ ] 即将支持网格服务架构(我们将在后续版本加入dapr) **** ### 详细到爆炸的Yi框架教程导航: @@ -125,11 +149,12 @@ Rbac后台管理系统:[yi.ccnetcore.com](http://yi.ccnetcore.com) (已上 - 操作日志管理 - Sms短信 - 微信支付 -- 模板代码生成 +- WebFirst代码生成 ### 业务项目 - RABC后台管理系统 - BBS社区系统 +- APP移动端系统 > 重复的东西,无需再写一遍,这也是优雅的体现之一 @@ -184,7 +209,7 @@ RABC权限管理系统(正在更新) - 定时任务 - 缓存列表 - 服务监控 -- 等等 +- WebFirst代码生成工具 **演示截图:** ![输入图片说明](readme/1.png) @@ -197,6 +222,8 @@ RABC权限管理系统(正在更新) ![输入图片说明](readme/8.png) ![输入图片说明](readme/9.png) ![输入图片说明](readme/10.png) +![输入图片说明](readme/1696760969217.jpg) +![输入图片说明](readme/1696761014270.jpg) BBS论坛系统(持续迭代) - 文章管理 @@ -206,7 +233,11 @@ BBS论坛系统(持续迭代) - 点赞管理 - 等等 -ERP进销存系统(正在更新) +APP移动端系统(持续迭代) +- 动态查询 +- 我的资料 + +ERP进销存系统(持续迭代) - 供货商管理 - 等等 diff --git a/Yi.App.Vue3/components.d.ts b/Yi.App.Vue3/components.d.ts index d4bc2f34..26d80cd0 100644 --- a/Yi.App.Vue3/components.d.ts +++ b/Yi.App.Vue3/components.d.ts @@ -14,14 +14,33 @@ declare module '@vue/runtime-core' { HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + VanActionBar: typeof import('vant/es')['ActionBar'] + VanActionBarButton: typeof import('vant/es')['ActionBarButton'] + VanActionBarIcon: typeof import('vant/es')['ActionBarIcon'] VanActionSheet: typeof import('vant/es')['ActionSheet'] VanButton: typeof import('vant/es')['Button'] + VanCell: typeof import('vant/es')['Cell'] + VanCellGroup: typeof import('vant/es')['CellGroup'] VanCol: typeof import('vant/es')['Col'] + VanDivider: typeof import('vant/es')['Divider'] VanField: typeof import('vant/es')['Field'] + VanGrid: typeof import('vant/es')['Grid'] + VanGridItem: typeof import('vant/es')['GridItem'] VanIcon: typeof import('vant/es')['Icon'] + VanImage: typeof import('vant/es')['Image'] + VanList: typeof import('vant/es')['List'] + VanLoading: typeof import('vant/es')['Loading'] VanNavBar: typeof import('vant/es')['NavBar'] + VanPopup: typeof import('vant/es')['Popup'] + VanPullRefresh: typeof import('vant/es')['PullRefresh'] VanRow: typeof import('vant/es')['Row'] + VanSticky: typeof import('vant/es')['Sticky'] + VanSwipe: typeof import('vant/es')['Swipe'] + VanSwipeItem: typeof import('vant/es')['SwipeItem'] + VanTab: typeof import('vant/es')['Tab'] VanTabbar: typeof import('vant/es')['Tabbar'] VanTabbarItem: typeof import('vant/es')['TabbarItem'] + VanTabs: typeof import('vant/es')['Tabs'] + VanUploader: typeof import('vant/es')['Uploader'] } } diff --git a/Yi.App.Vue3/src/api/articleApi.ts b/Yi.App.Vue3/src/api/articleApi.ts index c7ad11a1..b76f955e 100644 --- a/Yi.App.Vue3/src/api/articleApi.ts +++ b/Yi.App.Vue3/src/api/articleApi.ts @@ -1,17 +1,16 @@ import myaxios from '@/utils/myaxios' -import { ArticleEntity } from '@/type/interface/ArticleEntity' export default { add(data:any) { return myaxios({ - url: `/article/add`, + url: `/Trends`, method: 'post', data: data }) }, pageList(data:any) { return myaxios({ - url: '/article/pageList', + url: '/Trends', method: 'get', params: data }) diff --git a/Yi.App.Vue3/src/api/fileApi.ts b/Yi.App.Vue3/src/api/fileApi.ts index bcd09760..f0b09f5d 100644 --- a/Yi.App.Vue3/src/api/fileApi.ts +++ b/Yi.App.Vue3/src/api/fileApi.ts @@ -1,11 +1,11 @@ import myaxios from '@/utils/myaxios' export default{ - upload(type:string,data:any){ + upload(data:any){ return myaxios({ - url: `/file/upload/${type}`, + url: `/file`, headers:{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}, - method: 'POST', + method: 'post', data:data }); } diff --git a/Yi.App.Vue3/src/api/login.ts b/Yi.App.Vue3/src/api/login.ts index cb1f59c1..900fead9 100644 --- a/Yi.App.Vue3/src/api/login.ts +++ b/Yi.App.Vue3/src/api/login.ts @@ -33,7 +33,7 @@ export function register(data:any) { // 获取用户详细信息 export function getInfo() { return myaxios({ - url: '/account/getUserAllInfo', + url: '/account', method: 'get' }) } diff --git a/Yi.App.Vue3/src/permission.ts b/Yi.App.Vue3/src/permission.ts index 00dae628..a9a940df 100644 --- a/Yi.App.Vue3/src/permission.ts +++ b/Yi.App.Vue3/src/permission.ts @@ -4,7 +4,7 @@ import router from './router' // import 'nprogress/nprogress.css' import { getToken } from '@/utils/auth' // import { isHttp } from '@/utils/validate' -import useUserStore from '@/store/modules/user' +import useUserStore from '@/store/modules/user.js' import { isRelogin } from '@/utils/myaxios' // import useSettingsStore from '@/store/modules/settings' // import usePermissionStore from '@/store/modules/permission' diff --git a/Yi.App.Vue3/src/store/modules/user.ts b/Yi.App.Vue3/src/store/modules/user.ts index bb84d008..cbbec122 100644 --- a/Yi.App.Vue3/src/store/modules/user.ts +++ b/Yi.App.Vue3/src/store/modules/user.ts @@ -21,21 +21,23 @@ const useUserStore = defineStore( return new Promise((resolve, reject) => { login(username, password, code, uuid).then(res => { - if(!res.status) + if(!(res as any).succeeded) { reject(res) } setToken(res.data.token); this.token = res.data.token; - resolve(res); + + return resolve(res); }).catch(error => { - reject(error) + return reject(error) }) }) }, // 获取用户信息 getInfo() { return new Promise((resolve, reject) => { + getInfo().then(response => { const res=response.data; const user = res.user @@ -55,9 +57,9 @@ const useUserStore = defineStore( this.user.username = user.userName; this.user.nick=user.nick this.user.icon = user.icon; - resolve(res) + resolve(res) }).catch(error => { - reject(error) + reject(error) }) diff --git a/Yi.App.Vue3/src/utils/myaxios.ts b/Yi.App.Vue3/src/utils/myaxios.ts index 8b8ee565..726f9a2e 100644 --- a/Yi.App.Vue3/src/utils/myaxios.ts +++ b/Yi.App.Vue3/src/utils/myaxios.ts @@ -5,37 +5,43 @@ import axios from 'axios' import JsonBig from 'json-bigint' import { getToken } from '@/utils/auth' import { useRouter } from "vue-router"; -import useUserStore from '@/store/modules/user' +import useUserStore from '@/store/modules/user.js' import { Notify } from 'vant'; // import VuetifyDialogPlugin from 'vuetify-dialog/nuxt/index'; export let isRelogin = { show: false }; const myaxios = axios.create({ - // baseURL:'/'// - baseURL: import.meta.env.VITE_APP_BASE_API, // /dev-apis - timeout: 50000, - headers: { - 'Authorization': 'Bearer ' + "" - }, - //雪花id精度问题 - transformResponse: [ data => { - const json = JsonBig({ - storeAsString: true - }) - return json.parse(data) - }], - }) - // 请求拦截器 -myaxios.interceptors.request.use(function(config:any) { - const isToken = (config.headers || {}).isToken === false - // 是否需要防止数据重复提交 - const isRepeatSubmit = (config.headers || {}).repeatSubmit === false - if (getToken() && !isToken) { - config.headers['Authorization'] = 'Bearer ' + getToken() - } - // store.dispatch("openLoad"); - return config; -}, function(error) { - return Promise.reject(error); + // baseURL:'/'// + baseURL: import.meta.env.VITE_APP_BASE_API, // /dev-apis + timeout: 50000, + headers: { + 'Authorization': 'Bearer ' + "" + }, + //雪花id精度问题 + transformResponse: [data => { + const json = JsonBig({ + storeAsString: true + }); + try { + return json.parse(data); + } + catch + { + return data; + } + }], +}) +// 请求拦截器 +myaxios.interceptors.request.use(function (config:any) { + const isToken = (config.headers || {}).isToken === false + // 是否需要防止数据重复提交 + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken() + } + // store.dispatch("openLoad"); + return config; +}, function (error) { + return Promise.reject(error); }); // 响应拦截器 @@ -53,18 +59,25 @@ myaxios.interceptors.response.use(async function(response) { } // store.dispatch("closeLoad"); return resp; -}, async function(error) { +}, +async function(error) { +const code=error.response.status; +const message=error.message; //未授权、失败 if(error.response==undefined) { Notify({ type: 'danger', message: `服务器异常:${error.message}` }); + + // useUserStore().logOut().then(() => { + // location.href = '/'; + // }) + return Promise.reject(error);; } -const resp = error.response.data -if (resp.code == undefined && resp.message == undefined) { +if (code == undefined &&message == undefined) { Notify({ type: 'danger', message: '未知错误' }); -} else if (resp.code == 401) { +} else if (code == 401) { // if (!isRelogin.show) { Notify({ type: 'warning', message: '登录过期' }); //登出 @@ -73,9 +86,10 @@ if (resp.code == undefined && resp.message == undefined) { }) isRelogin.show = false; // } -} else if (resp.code !== 200) { - Notify({ type: 'danger', message: `错误代码:${resp.code},原因:${resp.message}` }); +} else if (code !== 200) { + Notify({ type: 'danger', message: `错误代码:${code},原因:${message}` }); } return Promise.reject(error); }); + export default myaxios \ No newline at end of file diff --git a/Yi.App.Vue3/src/view/login.vue b/Yi.App.Vue3/src/view/login.vue index 0bd37a7e..14072869 100644 --- a/Yi.App.Vue3/src/view/login.vue +++ b/Yi.App.Vue3/src/view/login.vue @@ -36,8 +36,9 @@