Browse Source

feature:fixbug

feature-1.0
Penny 3 years ago
parent
commit
60b7567e6d
  1. 2
      manifest.json
  2. 6
      pages.json
  3. 19
      pages/atlas/atlas.vue
  4. 5
      pages/userInfo/myCollection/myCollection.vue
  5. 2
      pages/userInfo/question/question.vue
  6. 2
      pages/userInfo/secretSign/secretSign.vue
  7. 4
      pages/userInfo/setting/setting.vue
  8. 10
      pages/userInfo/userInfo.vue
  9. 34
      utils/request.js

2
manifest.json

@ -1,5 +1,5 @@
{
"name" : "节点壁纸",
"name" : "次元意境",
"appid" : "__UNI__EDB5E94",
"description" : "",
"versionName" : "1.0.0",

6
pages.json

@ -3,7 +3,7 @@
{
"path": "pages/index/indexProto",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "次元意境",
"enablePullDownRefresh": true
}
},
@ -17,7 +17,7 @@
{
"path": "pages/creator/creator",
"style": {
"navigationBarTitleText": "艺术家",
"navigationBarTitleText": "画廊",
"enablePullDownRefresh": true
}
},
@ -122,7 +122,7 @@
"pagePath": "pages/creator/creator",
"iconPath": "static/art-default.png",
"selectedIconPath": "static/art-select.png",
"text": "艺术家"
"text": "画廊"
},
{
"pagePath": "pages/atlas/atlas",

19
pages/atlas/atlas.vue

@ -27,7 +27,8 @@
import {
listType,
signImgList,
querySignImg
querySignImg,
querySignImgBySignName
} from '@/api/atlas.js'
export default {
data() {
@ -75,6 +76,20 @@
methods: {
search(res) {
if (res.value) {
console.log('res.value',res.value);
const params = {
pageNum: 1,
pageSize: 10,
signName: res.value
}
querySignImgBySignName(params).then(response =>{
console.log('response',response);
if (response.data.code != 200) {
uni.showToast({
title: response.data.msg,
icon: 'none',
})
}else{
uni.setStorage({
key: 'atlas_detailId',
data: {
@ -87,6 +102,8 @@
})
}
})
}
});
} else {
uni.showToast({
title: '请输入要搜索的标签名',

5
pages/userInfo/myCollection/myCollection.vue

@ -32,7 +32,7 @@
isLoadMore:false, //
}
},
created() {
onShow() {
let that = this;
that.userInfo = uni.getStorageSync('userInfo')
if (that.userInfo) {
@ -90,9 +90,10 @@
//
targetDetail(item) {
if (item.id) {
console.log('图片为',item)
uni.setStorage({
key: 'detailId',
data: item.id,
data: item.imgId,
success() {
uni.navigateTo({
url: '../../creator/imgDetail'

2
pages/userInfo/question/question.vue

@ -1,6 +1,6 @@
<template>
<view class="container">
<view class="head">欢迎使用节点壁纸</view>
<view class="head">欢迎使用次元意境</view>
<uni-group mode="card">
<uni-collapse>
<uni-collapse-item title="1.提示“下载成功”,在相册里找不到怎么办?" :show-animation="true">

2
pages/userInfo/secretSign/secretSign.vue

@ -2,7 +2,7 @@
<view>
<uni-card title="隐私协议">
<text class="uni-body">
本指引是节点壁纸小程序开发者收集使用和存储你的信息而制定
本指引是次元意境小程序开发者收集使用和存储你的信息而制定
开发者收集你的用户信息用户昵称头像性别地区用于产品内个人信息展示

4
pages/userInfo/setting/setting.vue

@ -81,9 +81,9 @@
logout().then(res => {
if (res.data.code === 200) {
uni.reLaunch({
url: '/pages/index/index',
url: '/pages/index/indexProto',
success() {
uni.clearStorage();
uni.clearStorageSync();
uni.showToast({
title: '注销成功!',
duration: 2000

10
pages/userInfo/userInfo.vue

@ -69,17 +69,15 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
]
}
},
created() {
this.userInfo = uni.getStorageSync('userInfo')
},
onShow() {
this.userInfo = uni.getStorage('userInfo')
},
onShareAppMessage(res) {
if (res.from === 'button') { //
// console.log(res)
}
return {
title: '想要好看的图片就来[节点壁纸]吧!',
title: '想要好看的图片就来[次元意境]吧!',
path: `/pages/index/index?id=${this.userInfo.id}`
}
},
@ -296,7 +294,9 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
display: flex;
align-items: center;
justify-content: space-between;
width: calc(50% - 10rpx);
//width
//width: calc(50% - 10rpx);
width: 100%;
height: 100%;
border-radius: 10rpx;
background-image: linear-gradient(-225deg, #E3FDF5 0%, #FFE6FA 100%);

34
utils/request.js

@ -18,15 +18,16 @@ const loginFunc = (res, userInfo) => {
// 用户授权登录
loginTiktok(params).then(res => {
if (res.data.code === 200) {
uni.setStorage({
uni.setStorageSync({
key: 'token',
data: res.data.data.access_token,
});
uni.setStorageSync({
key: 'userInfo',
data: res.data.data.userInfo,
})
this.userInfo = res.data.data.userInfo;
uni.setStorage({
key: 'token',
data: res.data.data.access_token
})
} else {
uni.showToast({
title: res.data.msg,
@ -125,35 +126,28 @@ const refreshToken = () => {
service.interceptors.request.use(
config => {
const token = uni.getStorageSync('token');
// console.log('获取到的token',token)
if (token) {
// 给请求头添加user-token
// console.log('进入携带token方法')
config.headers["TiktokAuthorization"] = token;
// console.log('token放入headers',config.headers)
}
config.headers['Content-Type'] = 'application/json'
// config.method === 'post' ?
// config.data = qs.stringify({ ...config.data
// }) :
// config.params = { ...config.params
// };
return config;
},
error => {
// console.log(error); // for debug
return Promise.reject(error);
}
);
//配置成功后的拦截器
service.interceptors.response.use(res => {
if (res.data.code === 200) {
return res
// if (res.data.status == 200) {
// return res
// } else {
// return Promise.reject(res.data.msg);
// }
} else if (res.data.code === 401) {
//登录过期,刷新token
refreshToken();
//return Promise.reject(res.data.msg);
}else{
return res;
}
}, error => {
if(error.response.status === 401){
refreshToken() //刷新token并重置token

Loading…
Cancel
Save