🌈 style(eslint): add eslint rules

This commit is contained in:
xuan
2022-11-26 14:35:05 +08:00
parent f3aa20f049
commit 99a920975f
245 changed files with 14909 additions and 14349 deletions
+42 -43
View File
@@ -2,7 +2,7 @@
import Taro from '@tarojs/taro'
import { UserInfoActionType } from '../constants/userInfo'
export type UserParam = {
export interface UserParam {
department_code?: string
department_id?: string
department_name?: string
@@ -16,58 +16,57 @@ export type UserParam = {
avatar_url?: string
}
export type UserAdminParam = {
avatar_url?: string,
open_id?: string,
physical_warehouse?: number,
physical_warehouse_name?: string,
union_id?: string,
user_code?: string,
user_id?: number,
user_name?: string,
wechat_user_open_id?: number
is_authorize_name?: boolean,
is_authorize_phone?: boolean,
phone?:string,
authentication_status?:number,
authentication_status_name: string,
company_id?: number,
company_name?: string,
founder_user_id?: string,
founder_user_name?: string,
order_access_status?: number,
order_access_status_name?: string,
purchaser_type?: number,
purchaser_type_name?: string
export interface UserAdminParam {
avatar_url?: string
open_id?: string
physical_warehouse?: number
physical_warehouse_name?: string
union_id?: string
user_code?: string
user_id?: number
user_name?: string
wechat_user_open_id?: number
is_authorize_name?: boolean
is_authorize_phone?: boolean
phone?: string
authentication_status?: number
authentication_status_name: string
company_id?: number
company_name?: string
founder_user_id?: string
founder_user_name?: string
order_access_status?: number
order_access_status_name?: string
purchaser_type?: number
purchaser_type_name?: string
}
export type SortCodeParam = {
shareShortDetail?: {title:string, code: string, img: string}, //详情分享页面短码
shareShortPage?: {title:string, code: string, img: string}, //右上角分享页面短码
export interface SortCodeParam {
shareShortDetail?: { title: string; code: string; img: string } // 详情分享页面短码
shareShortPage?: { title: string; code: string; img: string } // 右上角分享页面短码
}
export type DataParam = {
token?: string
session_key?: string,
userInfo: UserParam,
adminUserInfo: UserAdminParam,
sort_code: SortCodeParam
logingStatus?: boolean //登录状态 true 正在登录
}
export interface DataParam {
token?: string
session_key?: string
userInfo: UserParam
adminUserInfo: UserAdminParam
sort_code: SortCodeParam
logingStatus?: boolean // 登录状态 true 正在登录
}
export type UserInfoAction = {
export interface UserInfoAction {
type: UserInfoActionType
data?: DataParam
}
const INIT_USER = {
userInfo: Taro.getStorageSync('userInfo')?JSON.parse(Taro.getStorageSync('userInfo')):null,
adminUserInfo: Taro.getStorageSync('adminUserInfo')?JSON.parse(Taro.getStorageSync('adminUserInfo')):null,
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
userInfo: Taro.getStorageSync('userInfo') ? JSON.parse(Taro.getStorageSync('userInfo')) : null,
adminUserInfo: Taro.getStorageSync('adminUserInfo') ? JSON.parse(Taro.getStorageSync('adminUserInfo')) : null,
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 (state = INIT_USER, action: UserInfoAction) => {