当前位置: 首页 > news >正文

福田设计网站百度提交工具

福田设计网站,百度提交工具,郑州影楼网站建设,婚庆类的模板网站接uni-app写的微信小程序如何实现账号密码登录后获取token,并且每天的第一次登录后都会直接获取参数而不是耀重新登录(1), 在main.js中 import App from ./App// #ifndef VUE3 import Vue from vue import ./uni.promisify.adap…

接uni-app写的微信小程序如何实现账号密码登录后获取token,并且每天的第一次登录后都会直接获取参数而不是耀重新登录(1),

在main.js中

import App from './App'// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'const app = new Vue({...App
})
app.$mount()
// #endif// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {const app = createSSRApp(App)return {app}
}
// #endifasync function checkAndLogin() {const token = uni.getStorageSync('token');const username = uni.getStorageSync('userName');const password = uni.getStorageSync('userPassword');if (!token) {try {const response = await request({url: '/login',method: 'POST',data: { username, password }});if (response.token) {uni.setStorageSync('token', response.token);} else {throw new Error('用户名或密码不正确');}} catch (error) {uni.showModal({title: '登录失败',content: error.message || '用户名或密码不正确',showCancel: false,});}}
}// 在 App.vue 或 main.js 中调用 checkAndLogin
async function onLaunch() {await checkAndLogin();
}

在pages.json

创建一个空的{
            "path": "pages/login/login",
            "style": {
                "navigationBarTitleText": "登录"
            }
        },

让路径为pages/login/login里面什么内容都没有,这样保证每次进入的第一个页面都是空白页面

"pages": [{"path": "pages/login/login","style": {"navigationBarTitleText": "登录"}},{"path": "pages/mine/mine","style": {"navigationBarTitleText": "我的"}},{"path": "pages/home/home","style": {"navigationBarTitleText": "首页"}},{"path": "pages/Operation/Operation","style": {"navigationBarTitleText": "运维"}},{"path": "pages/index/index","style": {"navigationBarTitleText": "服务"}},{"path" : "pages/shebe/shebe","style" : {"navigationBarTitleText" : "设备"}}],"globalStyle": {"navigationBarTextStyle":"black","navigationBarBackgroundColor": "#fff","navigationBarTitleText": "uni-app","backgroundColor": "#F8F8F8","enablePullDownRefresh": true,"navigationStyle": "custom"},"uniIdRouter": {},"tabBar": {"custom": true,"color": "#7A7E83","selectedColor": "#1296db","borderStyle": "black","backgroundColor": "#F8F8F8","list": [{"pagePath": "pages/home/home","text": "首页","iconPath": "static/imgs/imgs55.png","selectedIconPath": "static/imgs/imgs5.png"},{"pagePath": "pages/Operation/Operation","text": "运维","iconPath": "static/imgs/imgs66.png","selectedIconPath": "static/imgs/imgs6.png"},{"pagePath": "pages/shebe/shebe","text": "设备","iconPath": "static/imgs/imgs66.png","selectedIconPath": "static/imgs/imgs6.png"},{"pagePath": "pages/index/index","text": "服务","iconPath": "static/imgs/imgs11.png","selectedIconPath": "static/imgs/imgs1.png"},{"pagePath": "pages/mine/mine","text": "我的","iconPath": "static/imgs/imgs44.png","selectedIconPath": "static/imgs/imgs4.png"}]},"subPackages": true,"noParse": [],"subPackages": [{"root": "pagesA/","pages":[{"path": "login/login","style": {"navigationBarTitleText": "登录",// 启⽤⾃定义导航栏"navigationStyle": "custom",// 将导航栏⽂字的颜⾊设置为⽩⾊"navigationBarTextStyle": "white"}}]}]

http://www.hrbkazy.com/news/15426.html

相关文章:

  • 城乡与住房建设部网站成都最好的seo外包
  • 网站建设制作设计公司十大最靠谱培训机构
  • 绍兴cms建站模板整站优化方案
  • .net网站费用seo优化快速排名
  • 上海嘉定做网站公司seo关键词分析表
  • 泰安有哪些网站互联网推广引流是做什么的
  • 办网站需要多少费用自助建站系统代理
  • 郴州做网站 郴网互联石家庄全网seo
  • 做视频网站怎么赚钱风云榜百度
  • 荆州网站建设费用制作企业网站的公司
  • 阿里云云服务器 网站配置微信小程序免费制作平台
  • 村网站建设计划书江西seo推广
  • 怎么才能注册做网站合肥网站优化技术
  • 深圳做网站好的公司宁波seo快速排名
  • 网站怎么做背景图片百度软件应用中心下载
  • 新闻动态网站的设计下载百度卫星导航
  • 哪个网站可以做会计题全网自媒体平台大全
  • 销售营销方案100例网络优化工程师前景
  • 网站开发合同编号如何编写指数函数图像
  • 南通营销网站建设网络推广费用大概价格
  • 扬中网站网站优化公司哪家效果好
  • 网站建设供需网站推荐
  • 哪里有做枪网站的怎么寻找网站关键词并优化
  • wordpress政府网站网络销售怎么样
  • 眉山手机网站建设seo是什么级别
  • ui设计技能就业培训谷歌优化的最佳方案
  • 开县网站建设肇庆seo外包公司
  • 天津网站定制网络推广都是收费
  • 可以做长页海报的网站凡科建站和华为云哪个好
  • 成都大型网站设计公司站长之家ping检测