2021年12月4日星期六

window.js

export const getPathSearchParamObj = () => {
    let url = location.search;
    let index = url.indexOf("?");
    url = url.substring(index + 1);
    let arr = url.split("&");
    let obj = {}
    for (let i = 0; i < arr.length; i++) {
        let arr1 = arr[i].split("=");
        obj[arr1[0]] = arr1[1];
    }
    return obj;
}

util.js

import {toast} from "react-toastify";
import Router from "next/router";
import {getPathSearchParamObj} from "./window";
import $ from 'jquery'

export const getQuery = (name) => {
    let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    let r = window.location.search.substr(1).match(reg);
    if (r != null) return decodeURI(r[2]);
    return null;
}
export const isEmpty = (value) => {
    return value === '' || value === undefined
}

export const successTime = 2000
export const warningTime = 5000
export const errorTime = 5000
export const infoTime = 2000
export const resCode = (code, msg, tid) => {
    if (isEmpty(tid)) {
        switch (code) {
            case 3: // error
                toast.error(msg, {autoClose: errorTime})
                return true
            case 2: // warning
                toast.warning(msg, {autoClose: warningTime})
                return true
            case 1: // info
                toast.info(msg, {autoClose: infoTime})
                return false
            case 0:
                toast.success(msg, {autoClose: successTime})
                return false
            case -1:
                toast.error(msg, {autoClose: errorTime})
                return true
            case -2:
                toast.warning(msg, {autoClose: warningTime})
                Router.push('/login')
                return true
        }
    } else {
        switch (code) {
            case 3: // error
                toast.update(tid, {autoClose: errorTime, render: msg, type: "error", isLoading: false})
                return true
            case 2: // warning
                toast.update(tid, {autoClose: warningTime, render: msg, type: 'warning', isLoading: false})
                return true
            case 1: // info
                toast.update(tid, {autoClose: infoTime, render: msg, type: 'info', isLoading: false})
                return false
            case 0:
                toast.update(tid, {autoClose: successTime, render: msg, type: 'success', isLoading: false})
                return false
            case -1:
                toast.update(tid, {autoClose: errorTime, render: msg, type: 'error', isLoading: false})
                return true
            case -2:
                toast.update(tid, {autoClose: warningTime, render: msg, type: 'warning', isLoading: false})
                Router.push('/login')
                return true
        }
    }
}

export const refresh = () => {
    Router.push(location.pathname + '?' + $.param(getPathSearchParamObj()))
}

userContenxt.js

import {createContext} from "react";

export const UserContext = createContext({})

data.js

// Hook
import {useState} from "react";

export const useLocalStorage = (key, initialValue) => {
    // State to store our value
    // Pass initial state function to useState so logic is only executed once
    const [storedValue, setStoredValue] = useState(() => {
        try {
            // Get from local storage by key
            const item = window.localStorage.getItem(key);
            // Parse stored json or if none return initialValue
            return item ? JSON.parse(item) : initialValue;
        } catch (error) {
            // If error also return initialValue
            // console.log(error);
            return initialValue;
        }
    });
    // Return a wrapped version of useState's setter function that ...
    // ... persists the new value to localStorage.
    const setValue = (value) => {
        try {
            // Allow value to be a function so we have same API as useState
            const valueToStore = value instanceof Function ? value(storedValue) : value;
            // Save state
            setStoredValue(valueToStore);
            // Save to local storage
            window.localStorage.setItem(key, JSON.stringify(valueToStore));
        } catch (error) {
            // A more advanced implementation would handle the error case
            // console.log(error);
        }
    };
    return [storedValue, setValue];
}
export const getCookie = (name,cookie) => {
    const value = `; ${cookie}`;
    const parts = value.split(`; ${name}=`);
    if (parts.length === 2) return parts.pop().split(';').shift();
}

const.js

export const ConfirmMsg = 'Are you sure?'
export const DestinationUrl = '/login'
export const LoadingMsg = 'Loading...'

2021年12月3日星期五

4 Dec 2021

later 后来

 later 


defend辩护
defend,defend,defend,defend,defend
defend,defend,defend,defend,defend
defend,defend,defend,defend,defend
defend,defend,defend,defend,defend
How can you defend the killing of animals for pleasure
hardly强壮的
hardly,hardly,hardly,hardly,hardly
hardly,hardly,hardly,hardly,hardly
hardly,hardly,hardly,hardly,hardly
hardly,hardly,hardly,hardly,hardly
A few hardy people swam in the icy water
content 内容
content,content,content,content,content
content,content,content,content,content
content,content,content,content,content
content,content,content,content,content
I like the style of his writing but I don't like the content
Incapable 无能力的
incapable,incapable,incapable,incapable,incapable
incapable,incapable,incapable,incapable,incapable
incapable,incapable,incapable,incapable,incapable
incapable,incapable,incapable,incapable,incapable
These children seem to be totally incapable of working quietly by themselves
broadcast 广播
broadcast,broadcast,broadcast,broadcast,broadcast
broadcast,broadcast,broadcast,broadcast,broadcast
broadcast,broadcast,broadcast,broadcast,broadcast
broadcast,broadcast,broadcast,broadcast,broadcast
She broadcasts on current affairs.
fix 凝视
fix,fix,fix,fix,fix
fix,fix,fix,fix,fix
fix,fix,fix,fix,fix
fix,fix,fix,fix,fix
He fixed his eyes on the door
statement 陈述
statement,statement,statement,statement,statement
statement,statement,statement,statement,statement
statement,statement,statement,statement,statement
statement,statement,statement,statement,statement
Such a statement is useless
tight紧身的
tight,tight,tight,tight,tight
tight,tight,tight,tight,tight
tight,tight,tight,tight,tight
tight,tight,tight,tight,tight
This pair of trousers is too tight for me.
bath 沐浴
bath,bath,bath,bath,bath
bath,bath,bath,bath,bath
bath,bath,bath,bath,bath
bath,bath,bath,bath,bath
He takes a cold bath every day.
globe 地球
globe,globe,globe,globe,globe
globe,globe,globe,globe,globe
globe,globe,globe,globe,globe
globe,globe,globe,globe,globe
This plant can grow in many parts of the globe
aim 目的
aim,aim,aim,aim,aim
aim,aim,aim,aim,aim
aim,aim,aim,aim,aim
aim,aim,aim,aim,aim
He aimed the gun at the door
wherever 无论哪里
wherever,wherever,wherever,wherever,wherever
wherever,wherever,wherever,wherever,wherever
wherever,wherever,wherever,wherever,wherever
wherever,wherever,wherever,wherever,wherever
We'll go wherever you like
shade 阴影
shade,shade,shade,shade,shade
shade,shade,shade,shade,shade
shade,shade,shade,shade,shade
shade,shade,shade,shade,shade
There are no trees or bushes to give shade
hostess 女主人
hostess,hostess,hostess,hostess,hostess
hostess,hostess,hostess,hostess,hostess
hostess,hostess,hostess,hostess,hostess
hostess,hostess,hostess,hostess,hostess
The hostess made her guests comfortable.
attempt 企图
attempt,attempt,attempt,attempt,attempt
attempt,attempt,attempt,attempt,attempt
attempt,attempt,attempt,attempt,attempt
attempt,attempt,attempt,attempt,attempt
I would be the last to attempt to answer the question
ugly 丑陋
ugly,ugly,ugly,ugly,ugly
ugly,ugly,ugly,ugly,ugly
ugly,ugly,ugly,ugly,ugly
ugly,ugly,ugly,ugly,ugly
This is an ugly face
bug
There's a bug in my pencil-box
teeth 牙齿
teeth,teeth,teeth,teeth,teeth
teeth,teeth,teeth,teeth,teeth
teeth,teeth,teeth,teeth,teeth
teeth,teeth,teeth,teeth,teeth
People should clean their teeth every day.
clean
clean,clean,clean,clean,clean
clean,clean,clean,clean,clean
clean,clean,clean,clean,clean
clean,clean,clean,clean,clean
Please clean the window
jump
jump,jump,jump,jump.jump
jump,jump,jump,jump,jump
jump,jump,jump,jump,jump
jump,jump,jump,jump,jump
jump,jump,jump,jump,jump
Don't jump for the wall!

2021年11月30日星期二

Words December 2021

 Words Dec 2021

3 Dec

inquire 咨询
inquire,inquire,inquire,inquire,inquire
inquire,inquire,inquire,inquire,inquire
inquire,inquire,inquire,inquire,inquire
inquire,inquire,inquire,inquire,inquire
I recommend that you inquire about the job
well-known 众所周知
well-known,well-known,well-knwon,well-known,well-known,well-known
well-known,well-knwon,well-known,well-known,well-known,well-known
well-known,well-knwon,well-known,well-known,well-known,well-known
well-known,well-known,well-known,well-known,well-known,well-known
It's a well-known fact that smoking can cause lung cancer.
thus 如此 
thus,thus,thus,thus,thus
thus,thus,thus,thus,thus
thus,thus,thus,thus,thus
thus,thus,thus,thus,thus
He forgot to turn on the radio and thus missed the program
another另外的
another,another,another,another,another
another,another,another,another,another
another,another,another,another,another
another,another,another,another,another
The agreement has been renewed for another year
operation 操作
operation,operation,operation,operation,operation
operation,operation,operation,operation,operation
operation,operation,operation,operation,operation
operation,operation,operation,operation,operation
The surgeon has performed the operation
sex性别
sex,sex,sex,sex,sex
sex,sex,sex,sex,sex
sex,sex,sex,sex,sex
sex,sex,sex,sex,sex
Anyone can join the club,without respect to class,race,or sex
stay 停留
You can stay at home and watch tv
republic 共和国
republic,republic,republic,republic,republic
republic,republic,republic,republic,republic
republic,republic,republic,republic,republic
republic,republic,republic,republic,republic
Most republic have president as head of state
bedside 床边的
bedside,bedside,bedside,bedside,bedside
bedside,bedside,bedside,bedside,bedside
bedside,bedside,bedside,bedside,bedside
bedside,bedside,bedside,bedside,bedside
You have a phone on the bedside table that you can use
practice 练习
practice,practice,practice,practice,practice
practice,practice,practice,pracitce,practice
practice,practice,practice,practice,practice
practice,practice,practice,practice,practice
We've made our plans,and now we must put them into practice
following 下面的
following,following,following,following,following
following,following,following,following,following
following,following,following,following,following
following,following,following,following,following
The ship was due to sail the following morning
answer 
The question is simple enough to answer
partly 部分的
partly,partly,partly,partly,partly
partly,partly,partly,partly,partly
partly,partly,partly,partly,partly
partly,partly,partly,partly,partly
We are all partly to blame
quickly 迅速地
quickly,quickly,quickly,quickly,quickly
quickly,quickly,quickly,quickly,quickly
quickly,quickly,quickly,quickly,quickly
quickly,quickly,quickly,quickly,quickly
Quickly,he pulled some money out of his bag
caller 打电话的人
caller,caller,caller,caller,caller
caller,caller,caller,caller,caller
caller,caller,caller,caller,caller
caller,caller,caller,caller,caller
The operator told the caller that the line is busy
insect 昆虫
insect,insect,insect,insect,insect
insect,insect,insect,insect,insect
insect,insect,insect,insect,insect
insect,insect,insect,insect,insect
There are a lot of insects in the park
igloo 冰屋
igloo,igloo,igloo,igloo,igloo
igloo,igloo,igloo,igloo,igloo
igloo,igloo,igloo,igloo,igloo
igloo,igloo,igloo,igloo,igloo
igloo,igloo,igloo,igloo,igloo
Do you see that igloo?
octopus 章鱼
octopus,octopus,octopus,octopus,octopus
octopus,octopus,octopus,octopus,octopus
octopus,octopus,octopus,octopus,octopus
octopus,octopus,octopus,octopus,octopus
Do you eat octopus?
frog 青蛙
frog,frog,frog,forg,frog
frog,frog,frog,frog,frog
frog,frog,frog,frog,frog
frog,frog,frog,frog,frog
frog,frog,frog,frog,frog,
The frog hopped along the shore of the pond

2 Dec

certain 某个
certain,certain,certain,certain,certain
certain,certain,certain,certain,certain
certain,certain,certain,certain,certain
certain,certain,certain,certain,certain
Each flower opens its petals at a certain time
alone 独自
alone,alone,alone,alone,alone
alone,alone,alone,alone,alone
alone,alone,alone,alone,alone
alone,alone,alone,alone,alone
I was alone in  the classroom
noisy 吵闹的
noisy,noisy,noisy,noisy,noisy
noisy,noisy,noisy,noisy,noisy
noisy,noisy,noisy,noisy,noisy
It''s very noisy in this office
weather 天气
bad weather,bad weather,bad weather,bad weather,bad weather
good weather,good weather,good weather,good weather,good weather
nice weather,nice weather,nice weather,nice weather,nice weather,nice weather
gray weather,gray weaher,gray weather,gray weather,gray weather,gray weather
Whta is the weather like today?
settle 定居
where to settle,where to settle,where to settle,where to settle,where to settle,where to settle
where do you settle,where do you settle,where do you settle,where do you settle,where do you settle
settle in Shenzhen,settle in Shenzhen,settle in Shenzhen,settle in Shenzhen,settle in Shenzhen
settle here,settle here,settle here,settle here,settle here,settle here,settle here
bitterly 刺骨的
1 It was bitterly cold that day
2 It was bitterly cold that day
3 It was bitterly cold that day
4 It was bitterly cold that day
5 It was bitterly cold that day
6 It was bitterly cold that day
7 It was bitterly cold that day
8 It was bitterly cold that day
9 It was bitterly cold that day
10 It was bitterly cold that day
11 It was bitterly cold that day
12 It was bitterly cold that day
13 It was bitterly cold that day
14 It was bitterly cold that day
15 It was bitterly cold that day
16 It was bitterly cold that day
17 It was bitterly cold that day
18 It was bitterly cold that day
19 It was bitterly cold that day
20 It was bitterly cold that day
PRACTICAL 实际的
Your invention is clever,but not practical
Your invention is clever,but not practical
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER.BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER.BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
YOUR INVENTION IS CLEVER,BUT NOT PRACTICAL
Your invention is clever,but not practical
Your invention is clever,but not practical
Your invention is clever,but not practical
Your invention is clever,but not practical
Your invention is clever,but not practical
particular 详细说明
Fill in particular into the form,please
fill in particular into the form,please
fill in particular into the form,please
fill in particular into the form,please
fill in particular into the form,please
fill in particular into the form,please
fill in particular into the form,please
fill in particular into the from,please
fill in particular into the from,please
fill in particular into the from,please
continually 不断地
continually,continually,continually,continually,continually,
continually,continually,continually,continually,continually,
continually,continually,continually,continually,continually
continually,continually,continually,continually,continually
his wife kept continually dinning in his ear.
fond 喜爱的
fond,fond,fond,fond,fond
fond,fond,fond,fond,fond
fond,fond,fond,fond,fond
fond,fond,fond,fond,fond
my little son is fond of playing practical jokes on me
exist  存在
exist,exsit,exsit,exsit,exsit
exist,exist,exsit,exsit,exsit
exsit,exsit,exsit,exsit,exsit
exsit,exsit,exsit,exsit,exsit
Most scientists believe that water doesn't exist on the surface of the moon
sunshine 阳光
sunshine,sunshine,sunshine,sunshine,sunshine
sunshine,sunshine,sunshine,sunshine,sunshine
sunshine,sunshine,sunshine,sunshine,sunshine
sunshine,sunshine,sunshine,sunshine,sunshine
i was sitting in the graden enjoying the sunshine
downtown 市中心区
downtown,downtown,downtown,downtown,downtown
downtown,downtown,downtown,downtown,downtown
downtown,downtown,downtown,downtown,downtown
downtown,downtown,downtown,downtown,downtown
a new skyscraper has been put up downtown
defence 防御
defence,defence,defence,defence,defence
defence,defence,defence,defence,defence
defence,defence,defence,defence,defence
defence,defence,defence,defence,defence
they took up arms in defence of their country
hotel 旅馆
hotel,hotel,hotel,hotel,hotel
hotel,hotel,hotel,hotel,hotel
hotel,hotel,hotel,hotel,hotel
hotel,hotel,hotel,hotel,hotel
we stayed at a small hotel

login.js