akun-y / casdoor-uniapp-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Casdoor Uniapp SDK Example

Quick Start

nodejs version:16.20.1

请使用 yarn

  • download the code
git clone https://github.com/casdoor/casdoor-uniapp-example
cd casdoor-uniapp-example
  • install dependencies
yarn install
  • run
yarn serve

After running, you will see the following two interface:

Configure

Now open ./src/main.js file and you can see the following code:

import App from './App'
// #ifndef VUE3
import Vue from 'vue'
import Sdk from 'casdoor-uniapp-sdk'
Vue.config.productionTip = false
Vue.use(Sdk, {
  serverUrl: "https://door.casdoor.com", //casdoor server url
  clientId: "014ae4bd048734ca2dea",
  organizationName: "casbin",
  appName: "app-casnode",
  redirectPath: "/callback",
})
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()

The meanings of some fields are explained as follows:

Name (in order) Must Description
serverUrl Yes your Casdoor server URL
clientId Yes the Client ID of your Casdoor application
appName Yes the name of your Casdoor application
organizationName Yes the name of the Casdoor organization connected with your Casdoor application
redirectPath No the path of the redirect URL for your Casdoor application, will be /callback if not provided

About

License:Apache License 2.0


Languages

Language:JavaScript 35.4%Language:Vue 30.8%Language:SCSS 22.3%Language:HTML 11.5%