当前位置: 首页 > 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.hkea.cn/news/930588/

相关文章:

  • 固原建站公司旺道seo推广系统怎么收费
  • 适合做外链的网站海外广告联盟平台推广
  • 建筑模板规格型号郑州厉害的seo顾问
  • ppt做书模板下载网站有哪些内容国际婚恋网站排名
  • 上海网站建设内容更新网络营销策划目的
  • 重庆市建设信息网站关键词查询网
  • 做哪种网站流量大怎么打广告宣传自己的产品
  • 免费表白网站制作seo网络优化推广
  • 网站建设中可能升级中国科技新闻网
  • 网站制作内容文案网站如何快速被百度收录
  • 淘宝淘宝网页版登录入口免费seo公司
  • 竹溪县县建设局网站短视频营销
  • 好的网站有哪些搜索引擎seo是什么意思
  • 做音乐网站赚钱吗做小程序的公司
  • 坪地网站建设域名流量查询工具
  • 网站建设部署万能推广app
  • 网站的重要性怎么做个网站
  • 做网站的经验百度旗下有哪些app
  • 化工网站开发推广点击器
  • 怎么访问日本竹中建设网站外贸seo推广
  • 惠阳建设局网站引流推广接单
  • 北京通州网站建设公司如何建立公司网站网页
  • 网站换程序301seo优化按天扣费
  • html5 网站自适应长尾关键词挖掘爱站工具
  • 网站设计公司(信科网络)潍坊网站定制模板建站
  • 番禺网站开发报价百度竞价排名软件
  • 做企业网站接单seo网站优化技术
  • 建设网站行业云网络推广理实一体化软件
  • 如何用自己公司网站做邮箱关键字是什么意思
  • 古典网站建设欣赏马鞍山网站seo