Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5d640a5

Browse files
committed
update for rematch
1 parent 963de79 commit 5d640a5

File tree

2 files changed

+26
-30
lines changed

2 files changed

+26
-30
lines changed

‎src/models/app.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ export default {
5252
* 登录
5353
* @param { username, password } params
5454
* */
55-
async onLogin(params: {
56-
username: string;
57-
password: string;
58-
}): Promise<any> {
55+
async onLogin(params: { username: string; password: string }) {
5956
try {
6057
const res: Res = await axios.post("/api/login", params);
6158
return res;
@@ -68,7 +65,7 @@ export default {
6865
* 退出登录
6966
* @param null
7067
* **/
71-
async onLogout(): Promise<any> {
68+
async onLogout() {
7269
try {
7370
// 同 dispatch.app.reducerLogout();
7471

@@ -84,7 +81,7 @@ export default {
8481
* 设置用户信息
8582
* @param: {*} params
8683
* **/
87-
async setUserInfo(params: UserInfo): Promise<string> {
84+
async setUserInfo(params: UserInfo) {
8885
dispatch.app.reducerUserInfo(params);
8986
return "success";
9087
},

‎src/models/sys.ts‎

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default {
6464
* 根据菜单ID获取对应的菜单信息
6565
* @param {number} id 可以是一个数字也可以是一个数组
6666
* **/
67-
async getMenusById(params: { id: number | number[] }): Promise<any> {
67+
async getMenusById(params: { id: number | number[] }) {
6868
try {
6969
const res: Res = await axios.post(`/api/getMenusById`, params);
7070
return res;
@@ -78,7 +78,7 @@ export default {
7878
* 添加菜单
7979
* @param params MenuParam
8080
*/
81-
async addMenu(params: MenuParam): Promise<any> {
81+
async addMenu(params: MenuParam) {
8282
try {
8383
const res: Res = await axios.post("/api/addmenu", params);
8484
return res;
@@ -90,7 +90,7 @@ export default {
9090
/**
9191
* 修改菜单
9292
* **/
93-
async upMenu(params: MenuParam): Promise<any> {
93+
async upMenu(params: MenuParam) {
9494
try {
9595
const res: Res = await axios.post("/api/upmenu", params);
9696
return res;
@@ -102,7 +102,7 @@ export default {
102102
/**
103103
* 删除菜单
104104
* **/
105-
async delMenu(params: { id: number }): Promise<any> {
105+
async delMenu(params: { id: number }) {
106106
try {
107107
const res: Res = await axios.post("/api/delmenu", params);
108108
return res;
@@ -115,9 +115,7 @@ export default {
115115
/**
116116
* 根据菜单ID查询其下的权限数据
117117
* **/
118-
async getPowerDataByMenuId(params: {
119-
menuId: number | null;
120-
}): Promise<any> {
118+
async getPowerDataByMenuId(params: { menuId: number | null }) {
121119
try {
122120
const res: Res = await axios.get(
123121
`/api/getpowerbymenuid?${qs.stringify(params)}`
@@ -133,7 +131,7 @@ export default {
133131
* 根据权限ID查询对应的权限数据
134132
* @param id 可以是一个数字也可以是一个数组
135133
* **/
136-
async getPowerById(params: { id: number | number[] }): Promise<any> {
134+
async getPowerById(params: { id: number | number[] }) {
137135
try {
138136
const res: Res = await axios.post(`/api/getPowerById`, params);
139137
return res;
@@ -159,7 +157,7 @@ export default {
159157
/**
160158
* 添加权限
161159
* **/
162-
async addPower(params: PowerParam): Promise<Res> {
160+
async addPower(params: PowerParam) {
163161
try {
164162
const res: Res = await axios.post("/api/addpower", params);
165163
return res;
@@ -172,7 +170,7 @@ export default {
172170
/**
173171
* 修改权限
174172
* **/
175-
async upPower(params: PowerParam): Promise<Res> {
173+
async upPower(params: PowerParam) {
176174
try {
177175
const res: Res = await axios.post("/api/uppower", params);
178176
return res;
@@ -185,7 +183,7 @@ export default {
185183
/**
186184
* 删除权限
187185
* **/
188-
async delPower(params: { id: number }): Promise<Res> {
186+
async delPower(params: { id: number }) {
189187
try {
190188
const res: Res = await axios.post("/api/delpower", params);
191189
return res;
@@ -203,7 +201,7 @@ export default {
203201
pageSize: number;
204202
title?: string;
205203
conditions?: number;
206-
}): Promise<Res> {
204+
}) {
207205
try {
208206
const res: Res = await axios.get(
209207
`/api/getroles?${qs.stringify(params)}`
@@ -220,7 +218,7 @@ export default {
220218
* @param id 可以是一个数字,也可以是一个数组
221219
* @return 返回值是数组
222220
* **/
223-
async getRoleById(params: { id: number | number[] }): Promise<Res> {
221+
async getRoleById(params: { id: number | number[] }) {
224222
try {
225223
const res: Res = await axios.post(`/api/getRoleById`, params);
226224
return res;
@@ -233,7 +231,7 @@ export default {
233231
/**
234232
* 添加角色
235233
* **/
236-
async addRole(params: RoleParam): Promise<Res> {
234+
async addRole(params: RoleParam) {
237235
try {
238236
const res: Res = await axios.post("/api/addrole", params);
239237
return res;
@@ -245,7 +243,7 @@ export default {
245243
/**
246244
* 修改角色
247245
* **/
248-
async upRole(params: RoleParam): Promise<Res> {
246+
async upRole(params: RoleParam) {
249247
try {
250248
const res: Res = await axios.post("/api/uprole", params);
251249
return res;
@@ -258,7 +256,7 @@ export default {
258256
/**
259257
* 删除角色
260258
* **/
261-
async delRole(params: { id: number }): Promise<Res> {
259+
async delRole(params: { id: number }) {
262260
try {
263261
const res: Res = await axios.post("/api/delrole", params);
264262
return res;
@@ -271,7 +269,7 @@ export default {
271269
/**
272270
* 通过角色ID查询该角色拥有的所有菜单和权限详细信息
273271
* **/
274-
async findAllPowerByRoleId(params: { id: number }): Promise<Res> {
272+
async findAllPowerByRoleId(params: { id: number }) {
275273
try {
276274
const res: Res = await axios.get(
277275
`/api/findAllPowerByRoleId?${qs.stringify(params)}`
@@ -285,6 +283,7 @@ export default {
285283

286284
/**
287285
* 获取所有的菜单及权限详细信息
286+
* 如果你在sys.ts中引用了sys本身,则需要显式的注明返回值的类型
288287
* **/
289288
async getAllMenusAndPowers(): Promise<Res> {
290289
try {
@@ -306,7 +305,7 @@ export default {
306305
id: number;
307306
menus: number[];
308307
powers: number[];
309-
}): Promise<Res> {
308+
}) {
310309
try {
311310
const res: Res = await axios.post("/api/setPowersByRoleId", params);
312311
return res;
@@ -326,7 +325,7 @@ export default {
326325
menus: number[];
327326
powers: number[];
328327
}[]
329-
): Promise<Res> {
328+
) {
330329
try {
331330
const res: Res = await axios.post("/api/setPowersByRoleIds", params);
332331
return res;
@@ -344,7 +343,7 @@ export default {
344343
pageSize: number;
345344
username?: string;
346345
conditions?: number;
347-
}): Promise<Res> {
346+
}) {
348347
try {
349348
const res: Res = await axios.get(
350349
`/api/getUserList?${qs.stringify(params)}`
@@ -359,7 +358,7 @@ export default {
359358
/**
360359
* 添加用户
361360
* **/
362-
async addUser(params: UserBasicInfoParam): Promise<Res> {
361+
async addUser(params: UserBasicInfoParam) {
363362
try {
364363
const res: Res = await axios.post("/api/addUser", params);
365364
return res;
@@ -372,7 +371,7 @@ export default {
372371
/**
373372
* 修改用户
374373
* **/
375-
async upUser(params: UserBasicInfoParam): Promise<Res> {
374+
async upUser(params: UserBasicInfoParam) {
376375
try {
377376
const res: Res = await axios.post("/api/upUser", params);
378377
return res;
@@ -385,7 +384,7 @@ export default {
385384
/**
386385
* 删除用户
387386
* **/
388-
async delUser(params: { id: number }): Promise<Res> {
387+
async delUser(params: { id: number }) {
389388
try {
390389
const res: Res = await axios.post("/api/delUser", params);
391390
return res;
@@ -399,7 +398,7 @@ export default {
399398
* 给用户分配角色
400399
* 用的也是upUser接口
401400
* **/
402-
async setUserRoles(params: { id: number; roles: number[] }): Promise<Res> {
401+
async setUserRoles(params: { id: number; roles: number[] }) {
403402
try {
404403
const res: Res = await axios.post("/api/upUser", params);
405404
return res;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /