Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

init #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const UNI_APP = {
BASE_API: 'http://localhost:8000',
BASE_API: 'http://127.0.0.1:3000',
}
module.exports = UNI_APP;
2 changes: 1 addition & 1 deletion .env.prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const UNI_APP = {
BASE_API: 'http://localhost:8000',
BASE_API: 'http://127.0.0.1:3000',
}
module.exports = UNI_APP;
2 changes: 1 addition & 1 deletion .env.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const UNI_APP = {
BASE_API: 'http://localhost:8000',
BASE_API: 'http://127.0.0.1:3000',
}
module.exports = UNI_APP;
5 changes: 4 additions & 1 deletion App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@
<style lang="scss">
@import '@/uni_modules/uv-ui-tools/index.scss';
@import '@/static/font/iconfont.css';

svg{
width: 26rpx;
height: 26rpx;
}
</style>
153 changes: 32 additions & 121 deletions api/outer.js
Original file line number Diff line number Diff line change
@@ -1,140 +1,51 @@
import request from '@/common/network';
export const getToTchTheFish=(type)=>{
export const postLogin=(data)=>{
return request({
url:'/v1/h5/outer/touchTheFish',
data:{
type
}
})
}
export const getHotlistall=(data)=>{
return request( {
url : '/v1/h5/outer/hotlistall' ,
data
url:'/login',
data,
method:'post'
})
}
export const getMobile=(mobile)=>{
return request( {
url : '/v1/h5/outer/mobile' ,
data:{
mobile
}
export const postRegister=(data)=>{
return request({
url:'/register',
data,
method:'post'
})
}

export const getDelivery=(nu)=>{
return request( {
url : '/v1/h5/outer/delivery' ,
data:{
nu
}
})
}
export const getRubbish=(name)=>{
return request( {
url : '/v1/h5/outer/rubbish',
data:{
name
}
})
}
export const getHotlist=(data)=>{
return request( {
url : '/v1/h5/outer/hotlist',
data
export const getNote=(data)=>{
return request({
url:'/note/list',
data,
method:'get'
})
}
export const getGasolinePriceQuery=(data)=>{
return request( {
url : '/v1/h5/outer/youjia',
export const addNote=(data)=>{
return request({
url:'/note/add',
data,
method:'post'
})
}
export const getBBaikeaike=(msg)=>{
return request( {
url : '/v1/h5/outer/baike',
data:{
msg
}
})
}
export const getPicture=(page=1)=>{
return request( {
url : '/v1/h5/outer/picture',
data:{
page
}
})
}
export const getKfc=(page=1)=>{
return request( {
url : '/v1/h5/outer/kfc',
data:{
page
}
})
}
export const getHoliday=(year=new Date().getFullYear())=>{
return request( {
url : '/v1/h5/outer/holiday',
data:{
year
}
})
}
export const getWordcloud=(word)=>{
return request( {
url : '/v1/h5/outer/wordcloud',
data:{
word
}
})
}
export const getCity=(word)=>{
return request( {
url : '/v1/h5/outer/city',
data:{
word
}
})
}
export const getHotcity=(number=12)=>{
return request( {
url : '/v1/h5/outer/hotcity',
data:{
number
}
})
}
export const getCityname=(cityname)=>{
return request( {
url : '/v1/h5/outer/cityname',
data:{
cityname
}
})
}
export const getZzxjj=()=>{
return request( {
url : '/v1/h5/outer/zzxjj',
data:{
}
export const delNote=(note_id)=>{
return request({
url:`/note/delete/${note_id}`,
data:{},
method:'post'
})
}

export const getDouyinMM=()=>{
return request( {
url : '/v1/h5/outer/douyinMM',
data:{
}
export const findNote=(note_id)=>{
return request({
url:`/note/find/${note_id}`,
data:{},
method:'get'
})
}

export const getGirlMM=()=>{
return request( {
url : '/v1/h5/outer/girlMM',
data:{
}
export const updateNote=(data)=>{
return request({
url:`/note/update`,
data,
method:'post'
})
}
22 changes: 17 additions & 5 deletions common/network.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ".env"
import store from "@/store";
import { Toast } from "vant";
const request = (options={}) => {
if (!options.url) {
Expand All @@ -21,16 +22,27 @@ const request = (options={}) => {
url,
data: options.data || {},
header: {
"x-token": uni.getStorageSync('token') || ''
"Authorization": uni.getStorageSync('token') || ''
},
method: options.method || 'GET',
timeout: options.timeout || 60000,
dataType: options.dataType || 'json',
success: res=>{
Toast.clear()
const datas=res.data.data
const {code,result,message}=datas

const datas=res.data
const {code,data,message}=datas
if(code===401){

uni.showToast({
title:message,
icon:'none'
})
store.dispatch('clearToken')
uni.reLaunch({
url:'/pages/login/login'
})
return
}
if(code!==200){
uni.showToast({
title:message,
Expand All @@ -39,7 +51,7 @@ const request = (options={}) => {
reject(datas)
return
}
resolve(result)
resolve(datas)
},
fail: err=>{
uni.showToast({
Expand Down
96 changes: 0 additions & 96 deletions components/Mtabbar/index.vue

This file was deleted.

Loading