电子商城测试版v2
This commit is contained in:
parent
3d349d405a
commit
3a92a22472
@ -4,13 +4,13 @@
|
||||
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
||||
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
|
||||
// export const BASE_URL = `http://192.168.1.165:40001/lymarket` // 王霞
|
||||
export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
||||
// export const BASE_URL = `https://test.zzfzyc.com/lymarket` // 测试环境
|
||||
// export const BASE_URL = `http://192.168.1.30:40001/lymarket` // 发
|
||||
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
|
||||
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
|
||||
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
|
||||
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||
// export const BASE_URL = `http://192.168.1.224:50002/lymarket` // 添
|
||||
export const BASE_URL = `http://192.168.1.224:50002/lymarket` // 添
|
||||
// export const BASE_URL = `http://192.168.1.15:50001/lymarket` // 杰
|
||||
|
||||
// CDN
|
||||
|
@ -8,3 +8,4 @@ export const CLEAR_SESSIONKEY = 'clearSessionkey'
|
||||
export const CLEAR_USERINFO = 'clearUserInfo'
|
||||
export const CLEAR_ADMINUSERINFO = 'clearAdminUserInfo'
|
||||
export const CLEAR_SORTCODE = 'clearSortCode'
|
||||
export const LOGIN_STATUS = 'loginStatus'
|
@ -10,7 +10,8 @@ import {
|
||||
CLEAR_USERINFO,
|
||||
CLEAR_SESSIONKEY,
|
||||
CLEAR_ADMINUSERINFO,
|
||||
CLEAR_SORTCODE
|
||||
CLEAR_SORTCODE,
|
||||
LOGIN_STATUS
|
||||
} from '../constants/userInfo'
|
||||
|
||||
export type UserParam = {
|
||||
@ -53,6 +54,7 @@ export type DataParam = {
|
||||
userInfo: UserParam,
|
||||
adminUserInfo: UserAdminParam,
|
||||
sort_code: SortCodeParam
|
||||
logingStatus?: false //登录状态 true 正在登录
|
||||
}
|
||||
|
||||
type Action = {
|
||||
@ -67,6 +69,7 @@ const INIT_USER = {
|
||||
token: Taro.getStorageSync('token')||'',
|
||||
session_key: Taro.getStorageSync('session_key')||'',
|
||||
sort_code: Taro.getStorageSync('sort_code')?JSON.parse(Taro.getStorageSync('sort_code')):null,
|
||||
logingStatus: false
|
||||
}
|
||||
|
||||
export default function counter (state = INIT_USER, action: Action) {
|
||||
@ -102,6 +105,8 @@ export default function counter (state = INIT_USER, action: Action) {
|
||||
case CLEAR_SORTCODE:
|
||||
Taro.removeStorageSync('sort_code')
|
||||
return {...state, sortCode: null}
|
||||
case LOGIN_STATUS:
|
||||
return {...state, ...data}
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
@ -85,6 +85,8 @@ const showStatus = (status) => {
|
||||
return `${message},请检查网络或联系管理员!`
|
||||
}
|
||||
|
||||
//登录状态
|
||||
const loginStatus: false|true = false // true:登录中
|
||||
|
||||
/**
|
||||
* axios 请求状态封装,返回响应式数据 fetch(), loading, error, code, msg 等常用方法/状态
|
||||
@ -133,7 +135,6 @@ export const useRequest = (options:option = {
|
||||
const fetchData = async (sub_options?:any) => {
|
||||
stateRef.current.loading = true
|
||||
setState((e) => ({...e, loading:true}))
|
||||
console.log('tf:::', stateRef.current.loading)
|
||||
stateRef.current.query = {
|
||||
...sub_options,
|
||||
...options.pagination && {
|
||||
@ -161,7 +162,6 @@ export const useRequest = (options:option = {
|
||||
}
|
||||
}
|
||||
const result = await Taro.request(q as any)
|
||||
|
||||
const { statusCode } = result
|
||||
const {
|
||||
code,
|
||||
|
Loading…
x
Reference in New Issue
Block a user