|
|
|
@ -21,20 +21,19 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref, reactive } from 'vue'
|
|
|
|
|
import { ref, reactive, getCurrentInstance } from 'vue'
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
import axios from 'axios'
|
|
|
|
|
axios.defaults.baseURL = '/api'
|
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const route = useRoute()//获取上层路由传递的参数
|
|
|
|
|
|
|
|
|
|
const {appContext} = getCurrentInstance()
|
|
|
|
|
|
|
|
|
|
let user = reactive({ name: '', tel: '', pwd: '' })
|
|
|
|
|
|
|
|
|
|
function register() {
|
|
|
|
|
axios.post('/auth/register', null,
|
|
|
|
|
async function register() {
|
|
|
|
|
await appContext.config.globalProperties.$http.post('/auth/register', null,
|
|
|
|
|
{
|
|
|
|
|
params: {
|
|
|
|
|
name: user.name,
|
|
|
|
|