GithubHelp home page GithubHelp logo

wkl007 / vue-wechat-login Goto Github PK

View Code? Open in Web Editor NEW
299.0 11.0 64.0 2.75 MB

Vue 3.0 + TypeScript 微信网页授权登录示例

Home Page: https://blog.csdn.net/qq_35844177/article/details/79743812

License: MIT License

JavaScript 12.74% HTML 1.35% Vue 6.73% TypeScript 61.38% Less 17.25% Shell 0.55%
vue wechat typescript

vue-wechat-login's Introduction

vue-wechat-login

介绍

项目基于vue 3.0 ,vant,typescript开发的微信授权登录示例。

使用前请阅读 CSDN博客 及微信网页授权 相关文档

运行调试

  1. 克隆项目,终端进入项目根目录
git clone https://github.com/wkl007/vue-wechat-login.git
  1. 安装项目依赖
yarn install || npm install
  1. 修改项目环境变量中APP_URL与APP_ID
VITE_APP_API_URL=YOUR API URL
VITE_APP_WECHAT_APP_ID=YOUR APP ID
  1. 修改登录接口请求地址
static login (data) {
    return request({
      url: '/auth/wechat',// YOUR URL
      method: 'post',
      data
    })
}
  1. 本地运行
yarn serve || npm run serve
  1. 打包
yarn build || npm run build

运行效果图

在这里插入图片描述

vue-wechat-login's People

Contributors

dependabot[bot] avatar wkl007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-wechat-login's Issues

rederect url 默认是localhost 显示参数错误

你好在用这个插件过程中遇到问题

try { wechatAuth.returnFromWechat(to.fullPath) } catch (err) { store.dispatch('setLoginStatus', 0) next() } store.dispatch('loginWechatAuth', wechatAuth.code).then((res) => { if (res.code == 200) { store.dispatch('setLoginStatus', 2) } else { store.dispatch('setLoginStatus', 0) } next() }).catch((err) => { next() })
为啥总走这个catch 导致无限跳转
还有这个wechatAuth.code 为啥一直获取不到呢

npm run serve 报错?

ERROR Error: No files matching the pattern "E:\黄钦\前端\vue-wechat-login-vue_2.0\src**.{vue,htm,html,css,sss,less,scss}" were found.
Error: No files matching the pattern "E:\黄钦\前端\vue-wechat-login-vue_2.0\src*
*.{vue,htm,html,css,sss,less,scss}" were found.
at E:\黄钦\前端\vue-wechat-login-vue_2.0\node_modules\stylelint\lib\standalone.js:212:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:dev: vue-cli-service build --mode dev
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\huang\AppData\Roaming\npm-cache_logs\2020-11-16T02_25_26_868Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.