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", "appid" : "__UNI__EDB5E94",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",

6
pages.json

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

19
pages/atlas/atlas.vue

@ -27,7 +27,8 @@
import { import {
listType, listType,
signImgList, signImgList,
querySignImg querySignImg,
querySignImgBySignName
} from '@/api/atlas.js' } from '@/api/atlas.js'
export default { export default {
data() { data() {
@ -75,6 +76,20 @@
methods: { methods: {
search(res) { search(res) {
if (res.value) { 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({ uni.setStorage({
key: 'atlas_detailId', key: 'atlas_detailId',
data: { data: {
@ -87,6 +102,8 @@
}) })
} }
}) })
}
});
} else { } else {
uni.showToast({ uni.showToast({
title: '请输入要搜索的标签名', title: '请输入要搜索的标签名',

5
pages/userInfo/myCollection/myCollection.vue

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

2
pages/userInfo/question/question.vue

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

2
pages/userInfo/secretSign/secretSign.vue

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

4
pages/userInfo/setting/setting.vue

@ -81,9 +81,9 @@
logout().then(res => { logout().then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index', url: '/pages/index/indexProto',
success() { success() {
uni.clearStorage(); uni.clearStorageSync();
uni.showToast({ uni.showToast({
title: '注销成功!', title: '注销成功!',
duration: 2000 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() { onShow() {
this.userInfo = uni.getStorage('userInfo')
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
if (res.from === 'button') { // if (res.from === 'button') { //
// console.log(res) // console.log(res)
} }
return { return {
title: '想要好看的图片就来[节点壁纸]吧!', title: '想要好看的图片就来[次元意境]吧!',
path: `/pages/index/index?id=${this.userInfo.id}` 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; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: calc(50% - 10rpx); //width
//width: calc(50% - 10rpx);
width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx; border-radius: 10rpx;
background-image: linear-gradient(-225deg, #E3FDF5 0%, #FFE6FA 100%); 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 => { loginTiktok(params).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
uni.setStorage({ uni.setStorageSync({
key: 'token',
data: res.data.data.access_token,
});
uni.setStorageSync({
key: 'userInfo', key: 'userInfo',
data: res.data.data.userInfo, data: res.data.data.userInfo,
}) })
this.userInfo = res.data.data.userInfo; this.userInfo = res.data.data.userInfo;
uni.setStorage({
key: 'token',
data: res.data.data.access_token
})
} else { } else {
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
@ -125,35 +126,28 @@ const refreshToken = () => {
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
const token = uni.getStorageSync('token'); const token = uni.getStorageSync('token');
// console.log('获取到的token',token)
if (token) { if (token) {
// 给请求头添加user-token
// console.log('进入携带token方法')
config.headers["TiktokAuthorization"] = token; config.headers["TiktokAuthorization"] = token;
// console.log('token放入headers',config.headers)
} }
config.headers['Content-Type'] = 'application/json' config.headers['Content-Type'] = 'application/json'
// config.method === 'post' ?
// config.data = qs.stringify({ ...config.data
// }) :
// config.params = { ...config.params
// };
return config; return config;
}, },
error => { error => {
// console.log(error); // for debug
return Promise.reject(error); return Promise.reject(error);
} }
); );
//配置成功后的拦截器 //配置成功后的拦截器
service.interceptors.response.use(res => { service.interceptors.response.use(res => {
if (res.data.code === 200) {
return res return res
// if (res.data.status == 200) { } else if (res.data.code === 401) {
// return res //登录过期,刷新token
// } else { refreshToken();
// return Promise.reject(res.data.msg); //return Promise.reject(res.data.msg);
// } }else{
return res;
}
}, error => { }, error => {
if(error.response.status === 401){ if(error.response.status === 401){
refreshToken() //刷新token并重置token refreshToken() //刷新token并重置token

Loading…
Cancel
Save