update
This commit is contained in:
@@ -2,10 +2,12 @@ import {showToast} from "./uils.js";
|
||||
|
||||
const request = (options) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const {url, method} = options;
|
||||
const {url, method, data, params} = options;
|
||||
|
||||
uni.request({
|
||||
method: method,
|
||||
data: data,
|
||||
params: params,
|
||||
url: `${import.meta.env.VITE_API_URL}${url}`,
|
||||
success: ({data}) => {
|
||||
if (data.code !== 0) {
|
||||
|
||||
@@ -19,3 +19,7 @@ export const toPage = (url) => {
|
||||
url: url,
|
||||
}).then();
|
||||
}
|
||||
|
||||
export const backPage = () => {
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user