Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/casdoor/casdoor-uniapp-example

Uniapp Example of Casdoor via casdoor-uniapp-sdk
https://github.com/casdoor/casdoor-uniapp-example

auth casdoor iam miniprogram mobile oauth sdk sso uni-app uniapp wechat

Last synced: about 2 months ago
JSON representation

Uniapp Example of Casdoor via casdoor-uniapp-sdk

Awesome Lists containing this project

README

        

Casdoor Uniapp SDK Example

## Quick Start

- download the code

```shell
git clone https://github.com/casdoor/casdoor-uniapp-example
cd casdoor-uniapp-example
```

- install dependencies

```shell
yarn install
```

- run

```shell
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:

```js
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 |