|
|
@@ -1,16 +1,16 @@
|
|
|
/**
|
|
|
- TypeScript API妯″潡.
|
|
|
- 璇ュ姛鑳藉熀浜嶸3 Admin鏀硅繘鐨剆ervice妯″潡锛屾敮鎸乽rl鍙傛暟鍜宖rom post
|
|
|
+ TypeScript API模块.
|
|
|
+ 该功能基于V3 Admin改进的service模块,支持url参数和from post
|
|
|
|
|
|
usage:
|
|
|
- 1) import * as adminAPI from '@/api/adminAPI.vue', 鍏朵腑adminAPI鏄�埆鍚嶏紝鍚庡彴API寤鸿�鐢╝dminAPI锛屽墠鍙扮敤memberAPI
|
|
|
- 2) adminAPI.<controller鍚�>.<鏂规硶鍚�> 鏉ヨ�闂�柟娉曘€傛敞鎰忓�涓�弬鏁拌�浣跨敤瀵硅薄鏂瑰紡浼犲叆
|
|
|
- 3) 鏂规硶杩斿洖涓€涓狿romise锛屼娇鐢�.then鏉ユ墽琛屽洖璋冨弬鏁版帴鏀�
|
|
|
- 4) 鍚庡彴鐨刢ontroller澶氫釜鍘熷�绫诲瀷鍙傛暟鑷�姩缁勮�涓篴pplication/x-www-form-urlencoded鐨勫舰寮忔潵浼犻€掞紝閬垮厤鐢熸垚澶��VO锛屽彧鏈変娇鐢≧equestBody鏂瑰紡鏃讹紝鎵嶄娇鐢╝pplication/json鏉ュ彂閫佸�璞�
|
|
|
- 5) application/json鏉ュ彂閫佸�璞℃椂锛屽厑璁稿�鍔犲叾浠栧師濮嬬被鍨嬪弬鏁帮紝鑷�姩浣滀负URL鐨勫弬鏁版潵浼犻€掔粰鍚庡彴
|
|
|
- 6) 涓氬姟绫诲紓甯窧usinessException鑷�姩婵€鍙戝脊绐楁彁绀�(渚濊禆鏀硅繘鐨剆ervice妯″潡)
|
|
|
+ 1) import * as adminAPI from '@/api/adminAPI.vue', 其中adminAPI是别名,后台API建议用adminAPI,前台用memberAPI
|
|
|
+ 2) adminAPI.<controller名>.<方法名> 来访问方法。注意多个参数要使用对象方式传入
|
|
|
+ 3) 方法返回一个Promise,使用.then来执行回调参数接收
|
|
|
+ 4) 后台的controller多个原始类型参数自动组装为application/x-www-form-urlencoded的形式来传递,避免生成太多VO,只有使用RequestBody方式时,才使用application/json来发送对象
|
|
|
+ 5) application/json来发送对象时,允许增加其他原始类型参数,自动作为URL的参数来传递给后台
|
|
|
+ 6) 业务类异常BusinessException自动激发弹窗提示(依赖改进的service模块)
|
|
|
|
|
|
- Auto generate by ccframeTool@JIM at 2023-10-26 15:55:30
|
|
|
+ Auto generate by ccframeTool@JIM at 2024-1-18 21:28:13
|
|
|
*/
|
|
|
/* eslint-disable quotes */
|
|
|
import { request } from '@/utils/service'
|
|
|
@@ -47,7 +47,7 @@ export interface QueryObject {
|
|
|
}
|
|
|
|
|
|
export const commonApiController = {
|
|
|
- // 鐢ㄦ埛鍚嶅瘑鐮佹柟寮忎細鍛樼櫥褰�
|
|
|
+ // 用户名密码方式会员登录
|
|
|
doLogin(loginId: string | null, sid: string | null, userPsw: string | null, validateCode: string | null) {
|
|
|
return request({
|
|
|
url: `api/common/doLogin`,
|
|
|
@@ -61,7 +61,7 @@ export const commonApiController = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 鎵嬫満鐭�俊鏂瑰紡浼氬憳鐧诲綍
|
|
|
+ // 手机短信方式会员登录
|
|
|
mobileLogin(sid: string | null, userMobile: string | null, validateCode: string | null) {
|
|
|
return request({
|
|
|
url: `api/common/mobileLogin`,
|
|
|
@@ -74,7 +74,7 @@ export const commonApiController = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 淇�敼褰撳墠鐢ㄦ埛鐨勫瘑鐮�
|
|
|
+ // 修改当前用户的密码
|
|
|
modUserPass(modPassword: string | null) {
|
|
|
return request({
|
|
|
url: `api/common/modUserPass`,
|
|
|
@@ -92,7 +92,7 @@ export const commonApiController = {
|
|
|
method: 'get'
|
|
|
})
|
|
|
},
|
|
|
- // 涓存椂娴嬭瘯鏂规硶
|
|
|
+ // 临时测试方法
|
|
|
mytest1(
|
|
|
page: number | null,
|
|
|
size: number | null,
|
|
|
@@ -108,7 +108,7 @@ export const commonApiController = {
|
|
|
data
|
|
|
})
|
|
|
},
|
|
|
- // 缁欎細鍛樺彂閫侀壌鏉冪煭淇�
|
|
|
+ // 给会员发送鉴权短信
|
|
|
sendAuthCode(sid: string | null, userMobile: string | null) {
|
|
|
return request({
|
|
|
url: `api/common/sendAuthCode`,
|
|
|
@@ -120,7 +120,7 @@ export const commonApiController = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 椤甸潰鍞�竴key
|
|
|
+ // 页面唯一key
|
|
|
uuid() {
|
|
|
return request({
|
|
|
url: `api/common/uuid`,
|