Commit 8dfd16f0 authored by huanglu's avatar huanglu

新增util文件夹下内容

parent 03127771
......@@ -82,7 +82,7 @@ const config = {
},
geekProxy: {
"/service-profile": {
target: "http://192.168.32.35:3000/", //process.env.SERVER_ENDPOINT,
target: "http://192.168.32.35:3000/",
logLevel: "debug",
changeOrigoin: true,
},
......
const cart = require('./cart')
module.exports = {
user: {
'service-gos': {
'GET /login':() => {
return {
name: 'huanglu'
......@@ -13,10 +13,9 @@ module.exports = {
}
}
},
common: {
'service-user': {
'GET /config': {
version: '1.1.10'
}
},
cart
}
}
\ No newline at end of file
......@@ -13,16 +13,11 @@ const app = dva.createApp({
const store = app.getStore()
class App extends Component {
/**
* 指定config的类型声明为: Taro.Config
*
* 由于 typescript 对于 object 类型推导只能推出 Key 的基本类型
* 对于像 navigationBarTextStyle: 'black' 这样的推导出的类型是 string
* 提示和声明 navigationBarTextStyle: 'black' | 'white' 类型冲突, 需要显示声明类型
*/
config: Config = {
pages: ["pages/index/index", "pages/home/index"],
subPackages: [],
subPackages: [
],
preloadRule: {},
window: {
backgroundTextStyle: "light",
......@@ -33,7 +28,6 @@ class App extends Component {
};
// 在 App 类中的 render() 函数没有实际作用
// 请勿修改此函数
render() {
return (
<Provider store={store}>
......
import Taro from '@tarojs/taro'
const showLoading = (txt: string, mask: boolean = false) => {
Taro.showLoading({
title: txt,
mask
})
}
const hideLoading = () => {
Taro.hideLoading()
}
export default {
showLoading,
hideLoading
}
\ No newline at end of file
export const GET = (path: string, params: any) => {
// TODO
console.log(path, params)
}
export const POST = (path: string, params: any) => {
// TODO
console.log(path, params)
}
export default {
GET,
POST
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment