Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
admin-ci-test
Commits
746a63de
提交
746a63de
authored
6月 03, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:接口跨域
上级
761d6ff3
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
68 行增加
和
70 行删除
+68
-70
.env.development
.env.development
+0
-8
.env.production
.env.production
+0
-6
.env.development
env/.env.development
+13
-4
.env.production
env/.env.production
+13
-4
interface.ts
src/api/interface.ts
+1
-1
commonType.ts
src/api/interface/commonType.ts
+15
-0
common.ts
src/api/modules/common.ts
+4
-39
index.tsx
src/pages/common/login/index.tsx
+19
-6
router.tsx
src/router/router.tsx
+3
-2
没有找到文件。
.env.development
deleted
100644 → 0
浏览文件 @
761d6ff3
#本地
# REACT_APP_BASE_URL='http://192.168.3.100:32015/'
# REACT_APP_BASE_URL='http://10.246.106.74:32015/'
#线上
REACT_APP_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
#REACT_APP_BASE_URL = 'https://csfapi.mmcuav.cn/'
NODE_ENV = 'development'
VERSION='2.2.4.230217.Release'
.env.production
deleted
100644 → 0
浏览文件 @
761d6ff3
#测试
REACT_APP_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
#正式
#REACT_APP_BASE_URL = 'https://csfapi.mmcuav.cn/'
NODE_ENV = 'production'
VERSION='2.2.4.230217.Release'
env/.env.development
浏览文件 @
746a63de
# 请求接口地址
VITE_REQUEST_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
NODE_ENV = 'development'
VERSION = '2.2.4.230217.Release'
#请求接口地址
#VITE_REQUEST_BASE_URL='https://www.iuav.shop'
VITE_REQUEST_BASE_URL='https://test.iuav.shop'
#旧版接口地址
#VITE_REQUEST_BASE_URL='https://iuav.mmcuav.cn'
#VITE_REQUEST_BASE_URL='https://test.iuav.mmcuav.cn'
#本地测试
#VITE_REQUEST_BASE_URL='http://192.168.3.22:10001'
#VITE_REQUEST_BASE_URL='http://192.168.3.22:8099'
#VITE_REQUEST_BASE_URL='http://192.168.3.23:35150'
#版本
NODE_ENV='development'
VERSION='2.2.4.230217.Release'
env/.env.production
浏览文件 @
746a63de
# 请求接口地址
VITE_REQUEST_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
NODE_ENV = 'development'
VERSION = '2.2.4.230217.Release'
#请求接口地址
VITE_REQUEST_BASE_URL='https://www.iuav.shop'
#VITE_REQUEST_BASE_URL='https://test.iuav.shop'
#旧版接口地址
#VITE_REQUEST_BASE_URL='https://iuav.mmcuav.cn'
#VITE_REQUEST_BASE_URL='https://test.iuav.mmcuav.cn'
#本地测试
#VITE_REQUEST_BASE_URL='http://192.168.3.22:10001'
#VITE_REQUEST_BASE_URL='http://192.168.3.22:8099'
#VITE_REQUEST_BASE_URL='http://192.168.3.23:35150'
#版本
NODE_ENV='development'
VERSION='2.2.4.230217.Release'
src/api/interface.ts
浏览文件 @
746a63de
...
...
@@ -44,7 +44,7 @@ export interface InterListFunction<D extends object, T> {
// 通用接口封装函数(不分页) 建议用这个
export
interface
InterFunction
<
D
extends
object
,
T
>
{
(
req
?
:
D
):
Promise
<
ResponseType
<
T
>>
;
(
req
:
D
):
Promise
<
ResponseType
<
T
>>
;
}
// 通用接口封装函数(分页了,但又没有分页) 建议用这个
...
...
src/api/interface/commonType.ts
0 → 100644
浏览文件 @
746a63de
import
{
InterFunction
}
from
'~/api/interface'
;
// 用户登录
export
type
BackEndLoginType
=
InterFunction
<
{
accountNo
:
string
;
passWord
:
string
},
{
token
:
string
;
userAccountId
:
number
;
accountNo
:
string
;
portType
:
null
;
uid
:
null
;
phoneNum
:
null
;
userName
:
null
;
nickName
:
null
;
}
>
;
src/api/modules/common.ts
浏览文件 @
746a63de
import
axios
from
'../request'
;
// 运营人员
export
interface
operateEntity
{
userName
:
string
;
accountNo
:
string
;
id
:
number
;
uid
:
string
;
}
export
interface
loginEntity
{
accountNo
:
string
;
passWord
:
string
;
remember
:
boolean
;
}
import
{
BackEndLoginType
}
from
'~/api/interface/commonType'
;
export
class
CommonAPI
{
static
Login
=
(
data
:
Pick
<
loginEntity
,
'accountNo'
|
'passWord'
>
):
any
=>
{
return
axios
.
post
(
'userservlet/auth/platformLogin'
,
{
...
data
,
portType
:
1
,
});
};
// 上传图片
static
commonUpload
=
(
data
:
FormData
)
=>
{
return
axios
.
post
(
'ossservlet/upload/osses'
,
data
);
};
// 上传图片
static
fileUpload
=
(
data
:
FormData
)
=>
{
return
axios
.
post
(
'ossservlet/upload/oss'
,
data
);
};
// 运营人员列表
static
operateList
(
operateName
:
string
)
{
return
axios
.
post
(
'orderservlet/ordertask/listOperate'
,
{
operateName
});
}
// 销售人员列表
static
getSaleList
()
{
return
axios
.
get
(
'userservlet/useraccount/getSaleList'
);
}
// 用户登录
static
BackEndLogin
:
BackEndLoginType
=
(
params
)
=>
axios
.
post
(
'/userapp/auth/backEndLogin'
,
params
);
}
src/pages/common/login/index.tsx
浏览文件 @
746a63de
import
{
Button
,
Checkbox
,
Form
,
Input
}
from
'antd'
;
import
React
,
{
useEffect
}
from
'react'
;
import
{
useEffect
}
from
'react'
;
import
{
LockOutlined
,
UserOutlined
}
from
'@ant-design/icons'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
Cookies
from
'js-cookie'
;
import
'./index.scss'
;
import
{
InterDataType
,
InterReqType
}
from
'~/api/interface'
;
import
{
BackEndLoginType
}
from
'~/api/interface/commonType'
;
import
{
CommonAPI
}
from
'~/api'
;
// 请求的类型
type
ReqType
=
InterReqType
<
BackEndLoginType
>
;
// 返回的类型
type
ResType
=
InterDataType
<
BackEndLoginType
>
;
function
LoginView
()
{
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const
navigate
=
useNavigate
();
const
[
form
]
=
Form
.
useForm
();
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const
onFinish
=
async
(
values
:
any
)
=>
{
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 提交数据
const
onFinish
=
async
(
values
:
ReqType
)
=>
{
const
res
=
await
CommonAPI
.
BackEndLogin
({
accountNo
:
values
?.
accountNo
,
passWord
:
values
?.
passWord
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
console
.
log
(
'提交数据 --->'
,
res
);
}
// props
// .login(values)
// .then(async (res: any) => {
...
...
src/router/router.tsx
浏览文件 @
746a63de
...
...
@@ -14,6 +14,7 @@ import {
SmileOutlined
,
TeamOutlined
,
SolutionOutlined
,
RedEnvelopeOutlined
,
}
from
'@ant-design/icons'
;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
...
...
@@ -245,7 +246,7 @@ export const routerList: Array<RouteObjectType> = [
meta
:
{
id
:
26200
,
title
:
'现金管理'
,
icon
:
<
Solution
Outlined
/>,
icon
:
<
RedEnvelope
Outlined
/>,
},
},
{
...
...
@@ -254,7 +255,7 @@ export const routerList: Array<RouteObjectType> = [
meta
:
{
id
:
26200
,
title
:
'现金变更'
,
icon
:
<
Solution
Outlined
/>,
icon
:
<
RedEnvelope
Outlined
/>,
hidden
:
true
,
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论