generated from ccsens_fe/uni-vue3-template
10 changed files with 155 additions and 53 deletions
@ -1,3 +1,15 @@ |
|||
{ |
|||
"cSpell.words": ["dcloudio", "easyinput", "FILESYSTEMS", "localdata", "NIHSS", "nvue", "splashscreen", "uview", "vueuse"] |
|||
"cSpell.words": [ |
|||
"dcloudio", |
|||
"easyinput", |
|||
"FILESYSTEMS", |
|||
"localdata", |
|||
"NIHSS", |
|||
"nvue", |
|||
"plusempty", |
|||
"splashscreen", |
|||
"uniui", |
|||
"uview", |
|||
"vueuse" |
|||
] |
|||
} |
|||
|
@ -0,0 +1,37 @@ |
|||
const baseUrl = '' |
|||
|
|||
export interface IParam { |
|||
pageNum?: number |
|||
pageSize?: number |
|||
sort?: string |
|||
param: object |
|||
} |
|||
|
|||
export const post = (path: string, params: IParam) => { |
|||
let url = baseUrl + path |
|||
console.log('post: ', url) |
|||
|
|||
// #ifdef APP-PLUS
|
|||
if (!uni.host) { |
|||
const host = uni.getStorageSync(uni.$u.LOCAL_KEY.HOST) |
|||
if (!host) { |
|||
uni.showModal({ |
|||
title: '提示', |
|||
content: '请先配置服务地址', |
|||
showCancel: true, |
|||
success: ({ confirm }) => { |
|||
if (confirm) { |
|||
// 跳转到配置地址的地方
|
|||
} |
|||
}, |
|||
}) |
|||
return |
|||
} |
|||
uni.host = host |
|||
} |
|||
url = `${uni.host}${baseUrl}` |
|||
// #endif
|
|||
console.log(params) |
|||
|
|||
return uni.$u.post(url, params) |
|||
} |
@ -1,7 +1,6 @@ |
|||
import { post } from '@/api/base' |
|||
|
|||
export const userApi = { |
|||
// 登录
|
|||
login: async query => { |
|||
console.log(query) |
|||
return null |
|||
}, |
|||
login: async (padNo: string) => post('/pad/login', { param: { padNo } }), |
|||
} |
|||
|
Loading…
Reference in new issue