Skip to content

Commit

Permalink
release: 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
王建明 committed May 10, 2024
1 parent d6c13ce commit 58b5a0d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

---

## 1.1.3

`2024-5-10`

- 🎉 支持打包后网络请求代理,解决跨域请求问题
- 🌟 预设插件增加`request`
- 🌟 更新 `umi` 版本到 `4.1.10`
- 🐞 修复控制台日志输出Object类型时显示错误

## 1.1.2

`2024-4-24`
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ $ yarn create poros

执行 `pnpm start` 命令

> 第一次启动可能速度稍慢,请耐心等待...
```bash
╔═══════════════════════════════╗
ready - ║ Electron app launch success ║
Expand Down Expand Up @@ -123,6 +125,23 @@ class MainWindow extends PorosBrowserWindow {
export default MainWindow;
```

## 代理

支持打包后的跨域请求,配置同 `umi`,解决网络请求跨域问题,当然你也可以选择其他方式解决,比如:设置窗口属性 `webSecurity: false` (警告:不建议使用)

```ts
// config/config.ts
export default defineConfig({
proxy: {
'/api': {
target: 'https://randomuser.me',
changeOrigin: true,
},
},
}
```
打包后,可以通过 `app://./api/...` 访问到 `https://randomuser.me/api/...`

## API

> import { something } from 'poros';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "poros",
"version": "1.1.3-beta.7",
"version": "1.1.3",
"private": true,
"scripts": {
"bootstrap": "poros-scripts bootstrap",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import { type RequestConfig } from 'poros';
*/
export const request: RequestConfig = {
baseURL: '/api',
timeout: 1000,
timeout: 5000,
headers: { 'X-Requested-With': 'XMLHttpRequest' },
};
2 changes: 1 addition & 1 deletion packages/plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@porosjs/plugins",
"version": "1.1.3-beta.7",
"version": "1.1.3",
"description": "@porosjs/plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/poros/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "poros",
"version": "1.1.3-beta.7",
"version": "1.1.3",
"description": "An electron react framework based on Umi",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 58b5a0d

Please sign in to comment.